Re: plpgsql function returning SETOF

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: plpgsql function returning SETOF
Дата
Msg-id 20051221184457.GB2950@kaufbach.delug.de
обсуждение исходный текст
Ответ на Re: plpgsql function returning SETOF  ("Johannes Brügmann" <johannes@jottbee.org>)
Ответы Re: plpgsql function returning SETOF  ("Johannes Brügmann" <johannes@jottbee.org>)
Список pgsql-novice
Johannes Brügmann <johannes@jottbee.org> schrieb:
> I always had this in mind:
>
> ,----[ ${doc}/postgresql-8.0.3/html/xfunc-sql.html ]
> | 31.4.4. SQL Functions Returning Sets
> |
> | When an SQL function is declared as returning SETOF sometype, the
> | function's final SELECT query is executed to completion, and each row
> | it outputs is returned as an element of the result set.
> `----[ end ]

If you write the function in the language 'sql', then this is right.
But in your function there are things like 'if...', so you need plpgsql.

>
> But this is SQL isn't it, ;-)? And SQL doesn't support timestamp, does
> it? (AAaaarrggghhhh...)

???
timestamp and timestamptz are valid types in SQL.


> A new problem is now, that i still can't get it to work after all:
>
>       CREATE TYPE feiertag AS (bezeichnung VARCHAR(100), datum TIMESTAMP WITH TIME ZONE);
>
>       CREATE OR REPLACE FUNCTION feiertage(TIMESTAMP WITH TIME ZONE)
> ...
>       END;
>       $$ LANGUAGE plpgsql;
>
> Where is the bug now?

I can't see a error-message, sorry ;-)


Btw.: we have a german mailing list too ;-)

HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: "Johannes Brügmann"
Дата:
Сообщение: Re: plpgsql function returning SETOF
Следующее
От: Tom Lane
Дата:
Сообщение: Re: plpgsql function returning SETOF