Skip site navigation (1) Skip section navigation (2)

Re: Re: [SQL] renaming columns... danger?

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [SQL] renaming columns... danger?
Date: 2001-01-07 06:12:15
Message-ID: 20010107151215W.t-ishii@sra.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-sql
As for the latest CVS source, it looks still we have problems
regarding alter table rename column and pg_dump as Grant has
mentioned.  Results of pg_dump is attached.

test=# create table a ( aa serial primary key );
NOTICE:  CREATE TABLE will create implicit sequence 'a_aa_seq' for SERIAL column 'a.aa'
NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'a_pkey' for table 'a'
CREATE
test=# alter TABLE a RENAME aa to new_aa;
ALTER
test=# \q
[t-ishii(at)srapc1474 current]$ pg_dump test > /tmp/aaa
[t-ishii(at)srapc1474 current]$ dropdb test
DROP DATABASE
[t-ishii(at)srapc1474 current]$ createdb test
CREATE DATABASE
[t-ishii(at)srapc1474 current]$ psql test < /tmp/aaa
Using pager is off.
You are now connected as new user t-ishii.
CREATE
ERROR:  CREATE TABLE: column "aa" named in key does not exist
UPDATE 53
ERROR:  Relation 'a' does not exist
invalid command \.
BEGIN
CREATE
INSERT 18819 1
UPDATE 1
DROP
COMMIT
 setval 
--------
      1
(1 row)

[t-ishii(at)srapc1474 current]$ psql test
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

Using pager is off.
test=# \dt
No relations found.
test=# 

------------------------------ attachments ------------------------------
      Multipart/Mixed                                           2/
     1  Text/Plain(guess)                                         CoverPage*
B    2  Application/Octet-Stream                                  aaa.gz
     3                                                            .
--------0-1-2-3-4-5-6-7-8-9----------------------------------------------

In response to

Responses

pgsql-hackers by date

Next:From: Tatsuo IshiiDate: 2001-01-07 06:15:38
Subject: Re: Re: [SQL] renaming columns... danger?
Previous:From: The Hermit HackerDate: 2001-01-07 05:20:07
Subject: Re: beta2 bundled ... will officially announce sunday evening ...

pgsql-sql by date

Next:From: Tatsuo IshiiDate: 2001-01-07 06:15:38
Subject: Re: Re: [SQL] renaming columns... danger?
Previous:From: Najm HashmiDate: 2001-01-06 18:33:02
Subject: pqReadData()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group