Re: How to clone a table to an empty one - Mailing list pgsql-sql

From Tom Lane
Subject Re: How to clone a table to an empty one
Date
Msg-id 3867.982427109@sss.pgh.pa.us
Whole thread Raw
In response to How to clone a table to an empty one  (Ramiro Alba <ramiro@labtie.mmt.upc.es>)
List pgsql-sql
Ramiro Alba <ramiro@labtie.mmt.upc.es> writes:
> I would need to create an exact reproduction of a certain table
> (excluding data) converving primary key attributes and so on.

Trypg_dump -s -t tablename dbname | psql dbname

There is no easy way to do this directly in SQL ...
        regards, tom lane


pgsql-sql by date:

Previous
From: Ramiro Alba
Date:
Subject: How to clone a table to an empty one
Next
From: Roberto Mello
Date:
Subject: PL/SQL-to-PL/PgSQL-HOWTO beta Available