pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: vozhdb@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6533: postgre server crashes by create function (create table as)
Date: Thu, 15 Mar 2012 14:33:35 +0000
Message-ID: <E1S8BkF-0004XZ-Tp@wrigleys.postgresql.org> (raw)

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=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();





view thread (2+ messages)  latest in thread

Message-ID: <E1S8BkF-0004XZ-Tp@wrigleys.postgresql.org>
Permalink:  ../E1S8BkF-0004XZ-Tp@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1S8BkF-0004XZ-Tp@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: vozhdb@gmail.com
  Subject: Re: BUG #6533: postgre server crashes by create function (create table as)
  In-Reply-To: <E1S8BkF-0004XZ-Tp@wrigleys.postgresql.org>
  References: <E1S8BkF-0004XZ-Tp@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox