Skip site navigation (1) Skip section navigation (2)

BUG #4329: Transaction model changed?

From: "Gerd Grossmann" <gerdgrossmann(at)njini(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4329: Transaction model changed?
Date: 2008-07-28 10:48:53
Message-ID: 200807281048.m6SAmrI7006814@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4329
Logged by:          Gerd Grossmann
Email address:      gerdgrossmann(at)njini(dot)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 ..

Responses

pgsql-bugs by date

Next:From: Magnus HaganderDate: 2008-07-28 11:34:05
Subject: Re: BUG #4322: Problems with field not updatable
Previous:From: andrew victoriaDate: 2008-07-28 06:27:28
Subject: BUG #4328: help in creating database encoded with LATIN1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group