Re: Newbie question: returning rowtypes from a plpgsql function - Mailing list pgsql-general

From Tom Lane
Subject Re: Newbie question: returning rowtypes from a plpgsql function
Date
Msg-id 956.1101873491@sss.pgh.pa.us
Whole thread Raw
In response to Newbie question: returning rowtypes from a plpgsql function  (Larry White <ljw1001@gmail.com>)
Responses Re: Newbie question: returning rowtypes from a plpgsql function  (Larry White <ljw1001@gmail.com>)
List pgsql-general
Larry White <ljw1001@gmail.com> writes:
> I wrote a function that returns a rowtype.  The rowtype is assigned a
> value by a query using SELECT INTO.  The query sometimes will return
> no rows.  When it does, the function's return value is a row with no
> values.

> I would have expected it to return 0 rows, like the query itself.

How exactly would SELECT INTO return 0 rows?  Perhaps the target
variables vanish into a black hole?

            regards, tom lane

pgsql-general by date:

Previous
From: OpenMacNews
Date:
Subject: createlang fails w/ 'undef ref to _SPI_restore_connection' on 8b5 on OSX 10.3.6
Next
From: Tom Lane
Date:
Subject: Re: Using default tablespace for database?