From: | "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Joe Conway <mail(at)joeconway(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: I must be blind... |
Date: | 2002-06-14 22:22:35 |
Message-ID: | Pine.LNX.4.21.0206142315460.4131-100000@ponder.fairway2k.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
On Fri, 14 Jun 2002, Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
> > I don't think you can use PERFORM like that. Try:
>
> Actually I believe he can; after looking at the manual I realized that
> the problem is that PERFORM is syntactically a substitute for SELECT.
> In other words he needed to write
>
> PERFORM 1 FROM orders ...
> not
> PERFORM SELECT 1 FROM orders ...
Yes, indeed if one reads what is there rather than reading things that aren't
it does say that PERFORM substitutes for SELECT syntactically.
However, because PERFORM discards the results of a query it is only useful for
side effects of the query. My usage of it was wrong since I wasn't using it for
side effects merely for determining the existance of a result without having to
store that result since it wasn't required. Therefore, with the correct syntax
of PERFORM <query> my function doesn't generate an 'unprogrammed' error but the
test of FOUND always fails, i.e. result is NOT FOUND. Therefore SELECT INTO
dummy ... is still the correct thing for me to be doing.
I just thought I'd clear that up in case anyone was wondering, and yes, I have
tested it.
--
Nigel J. Andrews
Director
---
Logictree Systems Limited
Computer Consultants
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-06-14 22:25:53 | Re: I must be blind... |
Previous Message | Tony Carter | 2002-06-14 22:19:10 | Re: large database on postgres |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-06-14 22:25:53 | Re: I must be blind... |
Previous Message | Manfred Koizar | 2002-06-14 22:18:24 | Re: Reduce heap tuple header size |