Re: Newbie question: returning rowtypes from a plpgsql function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Larry White <ljw1001(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie question: returning rowtypes from a plpgsql function
Date: 2004-12-01 03:58:11
Message-ID: 956.1101873491@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Larry White <ljw1001(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-12-01 04:04:07 Re: Using default tablespace for database?
Previous Message OpenMacNews 2004-12-01 03:27:39 createlang fails w/ 'undef ref to _SPI_restore_connection' on 8b5 on OSX 10.3.6