How to UPDATE in ROW-style?

Поиск
Список
Период
Сортировка
От Dmitry Koterov
Тема How to UPDATE in ROW-style?
Дата
Msg-id d7df81620806200526g7ab62bafgdf074823d449c953@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hello.

How could I write something like:

  DECLARE r table%ROWTYPE;
  ...
  UPDATE table SET (table.*) = (SELECT r.*) WHERE id = r.id;

This syntax is invalid, and I cannot find another proper way to do it without explicit enumeration of table's columns.

I don't want to explicitly specify table's column to minimize later refactoring.



P.S.

The corresponding INSERT operator works fine:

  DECLARE r table%ROWTYPE;
  ...
  INSERT INTO table (SELECT r.*);

Please say if a similar syntax for UPDATE exists.

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

Предыдущее
От: Steve Clark
Дата:
Сообщение: Re: renumber table
Следующее
От: "Kynn Jones"
Дата:
Сообщение: Re: Easiest way to copy table from one db to another?