pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arash Zaryoun <Arash_Zaryoun@CBC.CA>
To: pgsql-sql@postgresql.org
Subject: CREATE TABLE AS SELECT....
Date: Thu, 16 Sep 2004 16:57:19 -0400
Message-ID: <s149c5fe.029@cbc.ca> (raw)

Hi All,

I have a table which has 'SERIAL' datatype. When I use 'create table X
as select * from my-table' , it creates the table but without serial
datatype. I mean without implicit sequence.

test=> \d qptuser
                                    Table "public.qptuser"
  Column   |         Type          |                        Modifiers
-----------+-----------------------+----------------------------------------------------------
 srl       | integer               | not null default
nextval('public.qptuser_srl_seq'::text)
 login_nme | character varying(35) | not null
 password  | character varying(30) | not null
Indexes:
    "pk_qptuser" primary key, btree (srl)
    "i1_qptuser_login_nme" unique, btree (login_nme)

test=> create table x as select * from qptuser;
test=> \d x 

              Table "public.a"
  Column   |         Type          | Modifiers
-----------+-----------------------+-----------
 srl       | integer               |
 login_nme | character varying(35) |
 password  | character varying(30) |

Can you help me on this?

Thanks,
- Arash




view thread (4+ messages)  latest in thread

Message-ID: <s149c5fe.029@cbc.ca>
Permalink:  ../s149c5fe.029@cbc.ca/
Also on:    postgresql.org/message-id/s149c5fe.029@cbc.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: Arash_Zaryoun@CBC.CA
  Subject: Re: CREATE TABLE AS SELECT....
  In-Reply-To: <s149c5fe.029@cbc.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox