BUG #6533: postgre server crashes by create function (create table as)

From: vozhdb(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6533: postgre server crashes by create function (create table as)
Date: 2012-03-15 14:33:35
Message-ID: E1S8BkF-0004XZ-Tp@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 6533
Logged by: Alex Sanin
Email address: vozhdb(at)gmail(dot)com
PostgreSQL version: 9.0.4
Operating system: Windows XP sp3
Description:

Here is the script:

drop table if exists test;
CREATE TABLE test
(
id serial NOT NULL,
lastname character varying(255) NOT NULL,
firstname character varying(255),
middlename character varying(255),
birthdate date,
listid integer,
CONSTRAINT test_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);

insert into test select a, a::character varying, a::character varying,
a::character varying, now()::date + a, a from generate_series(1,10000)
t(a);

CREATE OR REPLACE FUNCTION create_test_child() RETURNS void AS $$
DROP TABLE IF EXISTS test_child;
CREATE TABLE test_child AS SELECT test.* FROM test as test;
$$ LANGUAGE sql VOLATILE;

select create_test_child();

-------------------------------------
---------same without aliases--------

drop table if exists test;
CREATE TABLE test
(
id serial NOT NULL,
lastname character varying(255) NOT NULL,
firstname character varying(255),
middlename character varying(255),
birthdate date,
listid integer,
CONSTRAINT test_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);

insert into test select a, a::character varying, a::character varying,
a::character varying, now()::date + a, a from generate_series(1,10000)
t(a);

CREATE OR REPLACE FUNCTION create_test_child() RETURNS void AS $$
DROP TABLE IF EXISTS test_child;
CREATE TABLE test_child AS SELECT * FROM test;
$$ LANGUAGE sql VOLATILE;

select create_test_child();

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message barry_bell 2012-03-15 19:04:58 BUG #6534: Passing numeric Bind variables to ODBC driver convers to "Double precision"
Previous Message Stuart Bishop 2012-03-15 14:18:36 Re: BUG #6532: pg_upgrade fails on Python stored procedures