Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."? - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Date
Msg-id 4EB145BD.1060905@dunslane.net
Whole thread Raw
In response to Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?  (Valentine Gogichashvili <valgog@gmail.com>)
Responses Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
List 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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Refactor xlog.c #1 - startup.c
Next
From: Simon Riggs
Date:
Subject: Re: Refactor xlog.c #1 - startup.c