Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 9D85D1B25E4D for ; Thu, 15 Mar 2012 11:33:50 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8BkT-00014L-2r for pgsql-bugs@postgresql.org; Thu, 15 Mar 2012 14:33:49 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8BkG-0005hF-O7 for pgsql-bugs@postgresql.org; Thu, 15 Mar 2012 14:33:36 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1S8BkF-0004XZ-Tp for pgsql-bugs@postgresql.org; Thu, 15 Mar 2012 14:33:35 +0000 Date: Thu, 15 Mar 2012 14:33:35 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6533: postgre server crashes by create function (create table as) To: pgsql-bugs@postgresql.org From: vozhdb@gmail.com X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/115 X-Sequence-Number: 32676 The following bug has been logged on the website: Bug reference: 6533 Logged by: Alex Sanin Email address: vozhdb@gmail.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=3DFALSE ); 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=3DFALSE ); 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();