Re: Cannot declare record members NOT NULL

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Cultural Sublimation <cultural_sublimation(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Cannot declare record members NOT NULL
Date: 2007-09-12 21:58:06
Message-ID: 191061.44122.qm@web31805.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Cultural Sublimation <cultural_sublimation(at)yahoo(dot)com> wrote:
> > 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;
> > $$
>
>
> SELECT movie_id, movie_name FROM get_movies ();
> => returns a SETOF of (int4 NULL, text NULL)

I don't know if this will work, but here is another idea:

SELECT movie_id, movie_name
FROM get_movies() AS ( int4 NOT NULL, text NOT NULL );

Regards,
Richard Broersma Jr.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cultural Sublimation 2007-09-12 22:08:13 Re: Cannot declare record members NOT NULL
Previous Message Scott Marlowe 2007-09-12 21:47:23 Re: an other provokative question??