Re: Support UPDATE table SET(*)=...

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема Re: Support UPDATE table SET(*)=...
Дата
Msg-id CABRT9RAaA44A=7O8armYFmmXoRTW_0P20acazTdds_=_hoGWJA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Support UPDATE table SET(*)=...  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
<p dir="ltr"><br /> On Oct 17, 2014 6:16 PM, "Tom Lane" <<a
href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>>wrote:<br /> > A more realistic objection goes like
this:<br/> ><br /> > create table foo(f int, g int);<br /> > update foo x set x = (1,2);  -- works<br /> >
altertable foo add column x int;<br /> > update foo x set x = (1,2,3);  -- no longer works<br /> ><br /> >
It'snot a real good thing if a column addition or renaming can<br /> > so fundamentally change the nature of a
query.<pdir="ltr">I think a significant use case for this feature is when you already have a row-value and want to
persistit in the database, like you can do with INSERT:<br /> insert into foo select * from
populate_record_json(null::foo,'{...}');<p dir="ltr">In this case the opposite is true: requiring explicit column names
wouldbreak the query if you add columns to the table. The fact that you can't reasonably use populate_record/_json with
UPDATEis a significant omission. IMO this really speaks for supporting shorthand whole-row assignment, whatever the
syntax.<pdir="ltr">Regards,<br /> Marti 

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Vitesse DB call for testing
Следующее
От: Bruce Momjian
Дата:
Сообщение: Hash index creation warning