Re: create table like syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;



Regards
Gaetano Mendola


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux