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

Re: rename a table name

From: "Henshall, Stuart - WCP" <SHenshall(at)westcountrypublications(dot)co(dot)uk>
To: 'Bai Yan' <baiyan(at)ece(dot)ogi(dot)edu>, pgsql-novice(at)postgresql(dot)org
Subject: Re: rename a table name
Date: 2002-03-19 10:57:05
Message-ID: E2870D8CE1CCD311BAF50008C71EDE8E01F74832@MAIL_EXCHANGE (view raw or flat)
Thread:
Lists: pgsql-novice
CREATE TABLE new_table AS SELECT * FROM old_table
You can also use SELECT INTO, but I believe SQL 92 uses it for a different
purpose, so is probably best avoided.
Hope this helps,
- Stuart

> -----Original Message-----
> From: Bai Yan [mailto:baiyan(at)ece(dot)ogi(dot)edu]
> Sent: 19 March 2002 05:57
> To: pgsql-novice(at)postgresql(dot)org
> Subject: [NOVICE] rename a table name
> 
> 
> Hello all,
> 
> I am new for postgresql and have a big bunch of problems.
> 
> I create a table named 'action-test' but now I want to change 
> the name to
> 'action', ALTER TALBE command doesn't help and I didn't find 
> a command as
> 'rename'.
> 
> How can I create a table copied from another table, say, both 
> have the same
> structure and content?
> 
> Thanks a lot,
> 
> Yan Bai
> 
> 
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
> 

pgsql-novice by date

Next:From: Oliver ElphickDate: 2002-03-19 11:12:49
Subject: Re: Triggers in postgres
Previous:From: Bai YanDate: 2002-03-19 05:57:13
Subject: rename a table name

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