Re: Cannot declare record members NOT NULL - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: Cannot declare record members NOT NULL
Date
Msg-id 191061.44122.qm@web31805.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Cannot declare record members NOT NULL  (Cultural Sublimation <cultural_sublimation@yahoo.com>)
Responses Re: Cannot declare record members NOT NULL  (Cultural Sublimation <cultural_sublimation@yahoo.com>)
List pgsql-general
--- Cultural Sublimation <cultural_sublimation@yahoo.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.


pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: an other provokative question??
Next
From: Chris Browne
Date:
Subject: Re: Event-driven programming?