pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff MacDonald <jeff@hub.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: bug.. ?
Date: Sat, 24 Feb 2001 00:10:08 -0500
Message-ID: <10818.982991408@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.BSF.4.21.0102221553070.534-100000@wired.hub.org>
References: <Pine.BSF.4.21.0102221553070.534-100000@wired.hub.org>

Jeff MacDonald <jeff@hub.org> writes:
> A person recent pointed this out to me..
> seems a bit funny, because limit 1 pretty much
> say's it't not gonna return multiple values.

>> CREATE FUNCTION vuln_port(int4) RETURNS int4 AS 'SELECT port FROM
>> i_host_vuln WHERE vuln = $1 GROUP BY port ORDER BY count(port) DESC
>> LIMIT 1' LANGUAGE 'sql';
>> 
>> The result:
>> ERROR: function declared to return int4 returns multiple values in final
>> retrieve

It's a combination of a bug and a poorly worded error message.  It is
complaining not about rows, but about the extra column needed to do the
ORDER BY.  The error check forgets to ignore this 'hidden' column.

Fixed some time ago for 7.1...

			regards, tom lane



view thread (10+ messages)  latest in thread

Message-ID: <10818.982991408@sss.pgh.pa.us>
Permalink:  ../10818.982991408@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10818.982991408@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeff@hub.org
  Subject: Re: bug.. ?
  In-Reply-To: <10818.982991408@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox