Create Table xtest (like xtype)

From: TJ O'Donnell <tjo(at)acm(dot)org>
To: PostgreSQL - SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Create Table xtest (like xtype)
Date: 2008-02-06 19:40:30
Message-ID: 47AA0D2E.5040303@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Midgley 2008-02-06 20:33:25 Columns view? (Finding column names for a table)
Previous Message Guillaume Lelarge 2008-02-06 14:01:43 Re: undefined relations in pg_locks