Re: Unclear documentation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unclear documentation
Дата
Msg-id 5368.1131599696@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Unclear documentation  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> In the CREATE FUNCTION docs I notice this:
> RETURNS NULL ON NULL INPUT or STRICT indicates that the function always 
> returns null whenever any of its arguments are null. If this parameter 
> is specified, the function is not executed when there are null 
> arguments; instead a null result is assumed automatically.

> I'm wondering what this means when the function returns a composite 
> type,

You get a null rowtype value ... which is not really the same thing as a
row of nulls, though it behaves similarly in the sense that trying to
extract any one field from it produces null.

> or a setof scalar or a setof composite?

You get zero rows.

> So if you indicate STRICT, does PostgreSQL assume one row of all nulls 
> for each column in the return composite type?

No.

> Perhaps someone who knows better could tweak the docs a bit?

Can you propose wording that defines all this without being even more
confusing?  The point that the quoted sentence is making is merely that
the function is never actually called, which is true in all cases.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Comments from a Firebird user via Borland Newsgroups.
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Install issue on Windows and directory permission