pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: marc@bloodnok.com
To: pgsql-bugs@postgresql.org
Subject: BUG #11867: Strange behaviour with composite types after resetting database tablespace
Date: Tue, 04 Nov 2014 01:49:57 +0000
Message-ID: <20141104014957.23088.78673@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      11867
Logged by:          Marc Munro
Email address:      marc@bloodnok.com
PostgreSQL version: 9.3.5
Operating system:   Linux Debian 7.6 (Wheezy) on x86_64
Description:        

I have a script (below) that sets and resets the tablespace for a database
and drops and recreates a composite type.  The script fails when trying to
re-create the previously dropped composite type because the type has
apparently been magically resuscitated by changing the tablespace for the
database.  I assume this is a bug.  

I have reproduced this on postgres 8.4 and 9.3

This is not mission-critical for me but I'd be grateful for suggestions for
work-arounds.

I am running Debian Wheezy (release 7.6) on x86_64, with the following
postgres versions:

 PostgreSQL 9.3.5 on x86_64-unknown-linux-gnu, compiled by gcc (Debian
4.7.2-5) 4.7.2, 64-bit
 PostgreSQL 8.4.22 on x86_64-unknown-linux-gnu, compiled by GCC gcc (Debian
4.7.2-5) 4.7.2, 64-bit

---Shell script follows---
TBS3="/var/lib/postgresql/8.4/main/tbs3"
#TBS3="/var/lib/postgresql/9.3/main/tbs3"

psql -d postgres -v tbs3=$TBS3 <<'CLUSTEREOF'
\set tbs3dir '''':tbs3''''
create tablespace "tbs3" 
  location :tbs3dir;

create database "regressdb" with
 encoding 'UTF8'
 tablespace "tbs3"
 connection limit = -1;
CLUSTEREOF

psql -d regressdb <<'DBEOF'
create type "public"."vv2_t" as (
  "name"   "pg_catalog"."text",
  "type"   "pg_catalog"."text",
  "shared"   "pg_catalog"."bool"
);
DBEOF

psql -d postgres <<'CLUSTEREOF'
alter database regressdb set tablespace pg_default;
CLUSTEREOF

psql -d regressdb <<'DBEOF'
drop type public.vv2_t;
DBEOF

psql -d postgres <<'CLUSTEREOF'
alter database regressdb set tablespace tbs3;
CLUSTEREOF

psql -d regressdb <<'DBEOF'
create type public.vv2_t as (
  name                            pg_catalog.text,
  type                            pg_catalog.text,
  shared                          pg_catalog.bool);
DBEOF
---Shell script ends---

__
Marc


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)  latest in thread

Message-ID: <20141104014957.23088.78673@wrigleys.postgresql.org>
Permalink:  ../20141104014957.23088.78673@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20141104014957.23088.78673@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: marc@bloodnok.com
  Subject: Re: BUG #11867: Strange behaviour with composite types after resetting database tablespace
  In-Reply-To: <20141104014957.23088.78673@wrigleys.postgresql.org>
  References: <20141104014957.23088.78673@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