Re: [BUGS] PLPGSQL and FOUND stange behaviour after EXECUTE

2004-10-04 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Yeah, this has been on my to-do list for awhile... > Ah, ok. Is this something you want to handle, or should I take a look? Well, it's not *high* on my to-do list; feel free to take a look. >> One question here is whether Oracle's PL/S

Re: [BUGS] PLPGSQL and FOUND stange behaviour after EXECUTE

2004-10-04 Thread Neil Conway
Tom Lane wrote: Yeah, this has been on my to-do list for awhile... Ah, ok. Is this something you want to handle, or should I take a look? One question here is whether Oracle's PL/SQL has a precedent, and if so which way does it point? I did some limited testing of this, and it appears that PL/SQL's

Re: [BUGS] PLPGSQL and FOUND stange behaviour after EXECUTE

2004-09-30 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > ... One way to fix this would be to reimplement EXECUTE to > be essentially `eval': it would take an arbitrary string and execute it > as a PL/pgSQL statement. That would fix the FOUND problem, and also give > us EXECUTE INTO in one fell swoop. Yeah, this

Re: [BUGS] PLPGSQL and FOUND stange behaviour after EXECUTE

2004-09-30 Thread Neil Conway
On Fri, 2004-10-01 at 13:39, Tom Lane wrote: > Possibly not. Can EXECUTE determine how the executed statement would > have set the flag? At the moment, EXECUTE just feeds the string it finds to spi_execute(). We could probably hack it to figure out how to modify FOUND, but I think it would be ugl

Re: [BUGS] PLPGSQL and FOUND stange behaviour after EXECUTE

2004-09-30 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > On Fri, 2004-10-01 at 02:26, Tom Lane wrote: >> EXECUTE does not set the FOUND flag. > Is there a good reason for this behavior? Possibly not. Can EXECUTE determine how the executed statement would have set the flag? Should we assume that the function d

Re: [BUGS] PLPGSQL and FOUND stange behaviour after EXECUTE

2004-09-30 Thread Neil Conway
On Fri, 2004-10-01 at 02:26, Tom Lane wrote: > EXECUTE does not set the FOUND flag. Is there a good reason for this behavior? -Neil ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs

Re: [BUGS] PLPGSQL and FOUND stange behaviour after EXECUTE

2004-09-30 Thread Tom Lane
=?koi8-r?B?68/O09TBztTJzg==?= <[EMAIL PROTECTED]> writes: > sql := 'insert into tbl' || suffix::text || ' values (1,1)'; > EXECUTE sql; > IF NOT FOUND THEN > RAISE NOTICE 'NOT INSERTED'; > END IF; EXECUTE does not set the FOUND flag. See http://developer.postgresql.org/docs/postgres/plpgsql-sta

[BUGS] PLPGSQL and FOUND stange behaviour after EXECUTE

2004-09-30 Thread Константин
Hello, FreeBSD, I386, Postgres 8.0.0 beta2 Trying issuing such a plpgsql function: Create function test_fun (suffix char(4)) returns integer as $$ DECLARE sql text; BEGIN sql := 'insert into tbl' || suffix::text || ' values (1,1)'; EXECUTE sql; IF NOT FOUND THEN RAISE NOTICE 'NOT INSERTED'; END I