Re: Cannot declare record members NOT NULL

From: Cultural Sublimation <cultural_sublimation(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Cannot declare record members NOT NULL
Date: 2007-09-12 21:22:46
Message-ID: 848551.20203.qm@web63415.mail.re1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> CREATE FUNCTION get_movies ()
> RETURNS SETOF get_movies_t
> LANGUAGE sql STABLE
> AS
> $$
> SELECT movie_id, movie_name FROM movies
> WHERE movie_id NOT NULL AND movie_name NOT NULL;
> $$

Hey,

Thanks for the suggestion. Unfortunately, it still doesn't work.
Here is what Postgresql is telling the client for two different
statements, one using a direct SELECT, the other using the get_movies
function:

SELECT movie_id, movie_name FROM movies;
=> returns a SETOF of (int4 NOT NULL, text NOT NULL)

SELECT movie_id, movie_name FROM get_movies ();
=> returns a SETOF of (int4 NULL, text NULL)

One note: I know this information because the client is using the
"describe" feature of Postgresql to retrieve the types returned
by a statement.

So, is this a bug or what?

Cheers,
C.S.

____________________________________________________________________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
http://tv.yahoo.com/collections/3658

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2007-09-12 21:28:01 Re: Event-driven programming?
Previous Message Osvaldo Rosario Kussama 2007-09-12 21:00:17 Re: Cannot declare record members NOT NULL