Обсуждение: Clarification of "void" type

Поиск
Список
Период
Сортировка

Clarification of "void" type

От
"David G. Johnston"
Дата:
The section on pseudo-types names "void" and describes is thusly:

"""
Indicates that a function returns no value.
"""

This can be reasonably interpreted to mean:  "Use this when you don't want the execution of a function to return a value." (i.e., the empty set)

The following paragraph, suitably marked up, would be a nice addition:

If a function declares "RETURNS void" the result of executing the function will be a single row and column whose type pg_typeof() returns "void".  Void is not null and typically displays textually as the empty string.

I'd maybe modify the table to read:

void : A value that has no content: used to indicate that a function returns no value.


David J.