pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6533: postgre server crashes by create function (create table as)
2+ messages / 2 participants
[nested] [flat]

* BUG #6533: postgre server crashes by create function (create table as)
@ 2012-03-15 14:33 vozhdb@gmail.com
  2012-03-16 01:55 ` Re: BUG #6533: postgre server crashes by create function (create table as) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: vozhdb@gmail.com @ 2012-03-15 14:33 UTC (permalink / raw)
  To: pgsql-bugs

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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #6533: postgre server crashes by create function (create table as)
  2012-03-15 14:33 BUG #6533: postgre server crashes by create function (create table as) vozhdb@gmail.com
@ 2012-03-16 01:55 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2012-03-16 01:55 UTC (permalink / raw)
  To: vozhdb@gmail.com; +Cc: pgsql-bugs

vozhdb@gmail.com writes:
> 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:

This script doesn't crash for me, in HEAD or 9.0 branch tip.  Given the
use of CREATE TABLE AS in a SQL function, I suspect that this is the
same issue fixed in 9.0.7:

	Fix dangling pointer after CREATE TABLE AS/SELECT INTO in a SQL-language function (Tom Lane)

	In most cases this only led to an assertion failure in assert-enabled builds, but worse consequences seem possible.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-03-16 01:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-03-15 14:33 BUG #6533: postgre server crashes by create function (create table as) vozhdb@gmail.com
2012-03-16 01:55 ` Tom Lane <tgl@sss.pgh.pa.us>

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