Re: Stored function RETURNS table, but in some cases columns are missing - should I set them to NULL?

2021-03-09 Thread Alexander Farber
Tom, you are so eagle eyed - On Mon, Mar 8, 2021 at 8:53 PM Tom Lane wrote: > Alexander Farber writes: > > However there are cases, when I only have the out_gid value, I do not > want > > to return any other values. > > My question is: do I have to set the other OUT params explicitly to NULL?

Re: Stored function RETURNS table, but in some cases columns are missing - should I set them to NULL?

2021-03-08 Thread Tom Lane
Alexander Farber writes: > However there are cases, when I only have the out_gid value, I do not want > to return any other values. > My question is: do I have to set the other OUT params explicitly to NULL? plpgsql initializes them to null by default, I believe, just like ordinary local

Re: Stored function RETURNS table, but in some cases columns are missing - should I set them to NULL?

2021-03-08 Thread Pavel Stehule
Hi po 8. 3. 2021 v 19:20 odesílatel Alexander Farber < alexander.far...@gmail.com> napsal: > Good evening, > > in PostgreSQL 13.2 I have a custom stored function: > > CREATE OR REPLACE FUNCTION words_join_new_game( > in_uid integer, > in_bid integer >

Stored function RETURNS table, but in some cases columns are missing - should I set them to NULL?

2021-03-08 Thread Alexander Farber
Good evening, in PostgreSQL 13.2 I have a custom stored function: CREATE OR REPLACE FUNCTION words_join_new_game( in_uid integer, in_bid integer ) RETURNS table ( -- the player to be notified (sometimes there is no such user)