How to clone a table to an empty one

From: Ramiro Alba <ramiro(at)labtie(dot)mmt(dot)upc(dot)es>
To: pgsql-sql(at)postgresql(dot)org
Subject: How to clone a table to an empty one
Date: 2001-02-17 14:55:36
Message-ID: 3A8E90E7.4BFF6C1@labtie.mmt.upc.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello everyone:

I would need to create an exact reproduction of a certain table
(excluding data) converving primary key attributes and so on. I tried
with:
CREATE TABLE AS ...
I also tried :

SELECT *
INTO TABLE ....

In both cases, it does not maintain the primary key atribute that I need
in order to edit the cloned table with StarBase using the unixODBC
driver. The table reads ok, but it is read only due to the fact that
I mention.
Anyone knows the solution?

Regards

--
Ramiro Alba
Laboratori de Termotecnia i Energetica

Departament de Maquines i Motors Termics
ETS d'Enginyers Industrials de Terrassa

C/Colom 11

Tf: 34 - 93 739 86 46
Fax: 34 - 93 739 81 01

e-mail: ramiro(at)labtie(dot)mmt(dot)upc(dot)es

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-02-17 16:25:09 Re: How to clone a table to an empty one
Previous Message Gena Gurchonok 2001-02-16 22:30:17 Re[3]: [GENERAL] what means "INSERT xxx yyy" ?