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

Re: create table like syntax

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: David Durham <ddurham(at)vailsys(dot)com>
Subject: Re: create table like syntax
Date: 2005-10-07 12:36:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
David Durham wrote:
> is there a syntax that would look something like:
>     create table newTable like oldTable without indexes || records ||
> constraints with indexes || records || constraints
> built into postgres?

Try this:

create table newTable as
select * from oldTable limit 0;

Gaetano Mendola

In response to

pgsql-admin by date

Next:From: Gourish SingbalDate: 2005-10-07 12:41:09
Subject: horology test failed
Previous:From: Hannes DorbathDate: 2005-10-07 08:42:54
Subject: Re: hi group,,

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