Gary Chambers wrote:
> CREATE OR REPLACE FUNCTION getnote(INTEGER, BIGINT) RETURNS getnote_t AS
> When I call it with a row where n.is_private is TRUE and n.ownerid IS
> TRUE, I receive a single row of all null values:
>
> notesdb=# select * from getnote(1, 2);
> When I submit the query directly (getnote.sql is simply the query with
> the CASE statement forced to false):
>
> notesdb=# \i getnote.sql
> nid | ownerid | ownername | hostname | entrytime | is_private |
> is_active | notetext
> -----+---------+-----------+----------+-----------+------------+-----------+----------
> (0 rows)
You've defined getnote() as returning a single getnote_t value I think
you probably want "RETURNS SETOF getnote_t".
-- Richard Huxton Archonet Ltd