Skip site navigation (1) Skip section navigation (2)

Re: BUG #2914: SELECT query has no destination for result data

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "prasad" <prasad05_qs(at)yahoo(dot)co(dot)in>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2914: SELECT query has no destination for result data
Date: 2007-01-23 05:54:01
Message-ID: 10554.1169531641@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"prasad" <prasad05_qs(at)yahoo(dot)co(dot)in> writes:
> i'm created a function
> ...
> Select * 
> from "vw_getAllMessages" 
> where "Message_Posted_To" = $1 
> order by "Message_ID" desc;
> ...
> i get error
> ERROR:  SELECT query has no destination for result data
> HINT:  If you want to discard the results, use PERFORM instead.
> CONTEXT:  PL/pgSQL function "Get_Inbox" line 5 at SQL statement

This is not a bug.

SELECT in plpgsql should always be a SELECT INTO.  Like the hint
says, if you aren't wanting to send the results anywhere, use PERFORM.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-01-23 06:04:43
Subject: Re: BUG #2915: Not working: GRANT * TO GROUP *
Previous:From: Adriaan van OsDate: 2007-01-22 09:19:25
Subject: Re: [HACKERS] BUG #2907: pg_get_serial_sequence quoting

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group