pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Leif B. Kristensen <leif@solumslekt.org>
To: pgsql-sql@postgresql.org
Subject: Re: Strange bug
Date: Tue, 29 Nov 2005 17:47:49 +0100
Message-ID: <200511291747.49570.leif@solumslekt.org> (raw)
In-Reply-To: <200511291701.26148.leif@solumslekt.org>
References: <200511291531.30441.leif@solumslekt.org>
	<200511291552.53024.leif@solumslekt.org>
	<200511291701.26148.leif@solumslekt.org>

On Tuesday 29 November 2005 17:01, Leif B. Kristensen wrote:
>Is there an easy and non-disruptive way to do this?

For the record, I just did the following:

pgslekt=> create table rel_cits (
pgslekt(> relation_fk integer references relations (relation_id),
pgslekt(> source_fk integer references sources (source_id),
pgslekt(> PRIMARY KEY (relation_fk, source_fk)
pgslekt(> );
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 
"rel_cits_pkey" for table "rel_cits"
CREATE TABLE
pgslekt=> insert into rel_cits (select relation_fk, source_fk from 
relation_citations);
INSERT 0 19837
pgslekt=> create table event_cits (
pgslekt(> event_fk integer references events (event_id),
pgslekt(> source_fk integer references sources (source_id),
pgslekt(> PRIMARY KEY (event_fk, source_fk)
pgslekt(> );
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 
"event_cits_pkey" for table "event_cits"
CREATE TABLE
pgslekt=> insert into event_cits (select event_fk, source_fk from 
event_citations);
INSERT 0 29139
pgslekt=> drop table event_citations cascade;
NOTICE:  drop cascades to rule _RETURN on view event_notes
NOTICE:  drop cascades to view event_notes
DROP TABLE
pgslekt=> drop table relation_citations cascade;
NOTICE:  drop cascades to rule _RETURN on view relation_notes
NOTICE:  drop cascades to view relation_notes
DROP TABLE
pgslekt=> drop table citations;
DROP TABLE
pgslekt=> alter table rel_cits rename to relation_citations;
ALTER TABLE
pgslekt=> alter table event_cits rename to event_citations;
ALTER TABLE
pgslekt=> \i views_and_functions.sql

Seems simple enough :-)
-- 
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE



view thread (7+ messages)

Message-ID: <200511291747.49570.leif@solumslekt.org>
Permalink:  ../200511291747.49570.leif@solumslekt.org/
Also on:    postgresql.org/message-id/200511291747.49570.leif@solumslekt.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: leif@solumslekt.org
  Subject: Re: Strange bug
  In-Reply-To: <200511291747.49570.leif@solumslekt.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