Returning a RECORD, not SETOF RECORD

Поиск
Список
Период
Сортировка
От Thomas Hallgren
Тема Returning a RECORD, not SETOF RECORD
Дата
Msg-id 4268281A.4080006@mailblocks.com
обсуждение исходный текст
Ответы Re: Returning a RECORD, not SETOF RECORD
Список pgsql-general
I just discovered that my previous post concerning this had the same
subject line as a discussion that took place in January. I'm not asking
the same question though, so here I go again with my question about
syntax and feasibility.

I do the following:

CREATE FUNCTION xyz(int, int) RETURNS RECORD AS '...'
CREATE TABLE abc(a int, b int);

Now I want to call my xyz function once for each row in abc and I want
my RECORD to be (x int, y int, z timestamptz). How do I write that
query? I.e. where do specify my RECORD definition? Is it possible at
all? Ideally I'd like to write something like this:

SELECT xyz(a, b) AS (x int, y int, z timestamptz) FROM abc;

but that yields a syntax error.

Regards,
Thomas Hallgren



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

Предыдущее
От: "Steve - DND"
Дата:
Сообщение: Re: timezone() with timeofday() converts the wrong direction?
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: timezone() with timeofday() converts the wrong direction?