Re: Strange bug

From: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Strange bug
Date: 2005-11-29 16:47:49
Message-ID: 200511291747.49570.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2005-11-29 23:25:02 Re: Triggers
Previous Message Jaime Casanova 2005-11-29 16:14:26 Re: 'AS' in 'DELETE/UPDATE'