From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Valentine Gogichashvili <valgog(at)gmail(dot)com> |
Cc: | Eric Ridge <eebbrr(at)gmail(dot)com>, Darren Duncan <darren(at)darrenduncan(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."? |
Date: | 2011-11-02 13:29:33 |
Message-ID: | 4EB145BD.1060905@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 11/02/2011 03:16 AM, Valentine Gogichashvili wrote:
>
> Putting aside arguments like "it is not a good idea to use * because
> it generates not sustainable code especially in case when you extend
> table structure", I think this construct would be really nice for
> building ROWs, for example in plpgsql triggers or in conditions for
> big update statements:
>
> IF (NEW.* EXCLUDING ( last_modified ) ) IS DISTINCT FROM (OLD.*
> EXCLUDING ( last_modified ) ) THEN NEW.last_modified =
> clock_timestamp() ; END IF
>
>
That's a very good use case. I could certainly have used this in the past.
cheers
andrew
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2011-11-02 13:33:51 | Re: Refactor xlog.c #1 - startup.c |
Previous Message | Robert Haas | 2011-11-02 13:14:45 | Re: Refactor xlog.c #1 - startup.c |