RETURNING clause: how to specifiy column indexes?

Поиск
Список
Период
Сортировка
От Ken Johanson
Тема RETURNING clause: how to specifiy column indexes?
Дата
Msg-id 475F7766.2040005@kensystem.com
обсуждение исходный текст
Ответы Re: RETURNING clause: how to specifiy column indexes?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I am attempting to implement (in a driver)(PG JDBC) support for
specifying which column indexes (that generated keys) to return, so I'm
searching for a way to get the server to return the values of the
columns by their index, not name. By name, it is simply to append the
RETURNING clause and column names to the query:

INSERT... RETURNING foo,bar

Does anyone know how (if) this is possible by index? A standard or
server-specific syntax is fine since this is being implemented in a
server-driver.

Something like?:

INSERT... RETURNING [1],[2] (obviously this will not work)

Would I otherwise need to?:

INSERT... RETURNING *

then extract the user-requested columns? This seems inefficient as it
returns all columns / non-key ones (blobs etc).

While the values of an API that specifies the table's columns by
ordinaility may seem dubious, it is an API that I think should be
implemented anyway.

Thanks,
Ken



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

Предыдущее
От: "Chris Velevitch"
Дата:
Сообщение: Terminology definitions/meaning
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Terminology definitions/meaning