Ami Ganguli <ami.ganguli@gmail.com> writes:
> SELECT queue.apply_routing_rule(
> (SELECT * from queue.messages WHERE id = 1),
> (SELECT * from queue.routing_rules WHERE id = 1)
> );
Not sure if that particular syntax should be expected to work,
but why not
SELECT queue.apply_routing_rule(messages.*, routing_rules.*)
FROM queue.messages, queue.routing_rules
WHERE messages.id = 1 AND routing_rules.id = 1;
The query as you want to write it will certainly fail anyway if there's
more than one row with id = 1 in either table, so it's not like there's
some huge inefficiency in doing it as a join.
regards, tom lane