BUG #4329: Transaction model changed? - Mailing list pgsql-bugs

From Gerd Grossmann
Subject BUG #4329: Transaction model changed?
Date
Msg-id 200807281048.m6SAmrI7006814@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4329: Transaction model changed?
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4329
Logged by:          Gerd Grossmann
Email address:      gerdgrossmann@njini.com
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 ..

pgsql-bugs by date:

Previous
From: "andrew victoria"
Date:
Subject: BUG #4328: help in creating database encoded with LATIN1
Next
From: Magnus Hagander
Date:
Subject: Re: BUG #4322: Problems with field not updatable