The following bug has been logged online:

Bug reference:      4329
Logged by:          Gerd Grossmann
Email address:      [EMAIL PROTECTED]
PostgreSQL version: 8.0.17
Operating system:   Red Hat Enterprise Linux 4
Description:        Transaction model changed?
Details: 

Executing the following
 
CREATE OR REPLACE FUNCTION compatTest() RETURNS void
    AS $$
DECLARE
    createStmnt TEXT;
BEGIN
    createStmnt:='CREATE TABLE test (val integer);INSERT INTO test (val)
VALUES (1);';
    EXECUTE createStmnt;
    RETURN;
END;
$$
    LANGUAGE plpgsql;
 
SELECT compatTest();

would just work fine under postgresql 8.3 but does not work with postgresql
8.0. It complains that the table test does not exist! Instead it has to be
written like this:
 
CREATE OR REPLACE FUNCTION compatTest() RETURNS void
    AS $$
DECLARE
    createStmnt TEXT;
BEGIN
    createStmnt:='CREATE TABLE test (val integer);';
    EXECUTE createStmnt;
    createStmnt:='INSERT INTO test (val) VALUES (1);';
    EXECUTE createStmnt;
    RETURN;
END;
$$
    LANGUAGE plpgsql;
 
SELECT compatTest();

To me it looks like 8.3 is correct. I assume this is also the reason why it
changed. But since it was not documented anywhere ..

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to