On Fri, Jun 03, 2005 at 05:44:59PM +0300, Ami Ganguli wrote:
>
> SELECT queue.apply_routing_rule( 
>                       (SELECT * from queue.messages WHERE id = 1),
>                       (SELECT * from queue.routing_rules WHERE id = 1)
>                       );
> 
> I get an error message along the lines of "sub-query must return a
> single value".

The error I get is "subquery must return only one column".  Queries
like the following should work in 8.0.x:

SELECT queue.apply_routing_rule(m, r)
FROM (SELECT * FROM queue.messages WHERE id = 1) AS m,
     (SELECT * FROM queue.routing_rules WHERE id = 1) AS r;

SELECT queue.apply_routing_rule(m, r)
FROM queue.messages AS m, 
     queue.routing_rules AS r
WHERE m.id = 1 
  AND r.id = 1;

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to