Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Дата
Msg-id 4EB14FC5.8090902@dunslane.net
обсуждение исходный текст
Ответ на Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

On 11/02/2011 09:56 AM, Tom Lane wrote:
> Andrew Dunstan<andrew@dunslane.net>  writes:
>> 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.
> Well ... this is inventing use cases that have nothing to do with the
> proposed feature and are entirely incapable of being supported by the
> proposed implementation.  And I'm not sure why we should put aside the
> argument that this is only a good idea in ad-hoc queries, either.
>
>             

Well, yes, you're right that it's not covered by the original feature. I 
guess I got interested because a couple of years ago I had to write some 
triggers in PLPerl and with much lower efficiency to achieve the same 
effect as this.

cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Thoughts on "SELECT * EXCLUDING (...) FROM ..."?
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Refactor xlog.c #1 - startup.c