Create Table xtest (like xtype) - Mailing list pgsql-sql

From TJ O'Donnell
Subject Create Table xtest (like xtype)
Date
Msg-id 47AA0D2E.5040303@acm.org
Whole thread Raw
Responses Re: Create Table xtest (like xtype)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
I know I  can create a table using names and types from an existing
table.

Create Table xtable (a Integer, b Text);
Create Table xtest (Like xtable);
This works just fine.

I want to create a table having the same column names and types as
an existing new datatype.

Create Type xtype As (a Integer, b Text);
Create Table xtest (Like xtype);
ERROR:  "xtype" is a composite type
Is that possible some other way?

TJ O'Donnell
http://www.gnova.com


pgsql-sql by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: undefined relations in pg_locks
Next
From: Steve Midgley
Date:
Subject: Columns view? (Finding column names for a table)