Re: Found a bug in the procedural languages code relating to LIMIT 1 - Mailing list pgsql-general

From
Subject Re: Found a bug in the procedural languages code relating to LIMIT 1
Date
Msg-id 20010112041520.2560.qmail@mailhost.sidereal.kz
Whole thread Raw
In response to Re: Found a bug in the procedural languages code relating to LIMIT 1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> > CREATE FUNCTION foo(...) RETURNS INT4 AS '
> > SELECT shoesize FROM customers ORDER BY time LIMIT 1
> > ' LANGUAGE 'sql';
> > It gives an error that returning multiple values is not allowed.
>
> In what version of Postgres, pray tell?  I can't duplicate that behavior
> in 7.0.3 nor current.

It's 7.0.3.  Mail me an example of something which works and I'll try
it out.

> Consider DISTINCT ON.  Here's the example given in the SELECT reference
> manual page:

Is that the optimal way to do this?  What the man page described is
exactly what I'm trying to do.

Thanks

pgsql-general by date:

Previous
From: Lee Joramo
Date:
Subject: COPY error: pqReadData() -- backend closed the channel unexpectedly
Next
From: Michael
Date:
Subject: Select NULL value with cursor