Re: copy table - Mailing list pgsql-admin

From Melissa Peterson
Subject Re: copy table
Date
Msg-id A1FD0C847C4A724CAD5412A2448483CA02B8C4@SBServer.GigaCrete.local
Whole thread Raw
In response to copy table  (Marc Fromm <Marc.Fromm@wwu.edu>)
List pgsql-admin

For your primary key column, does the SQL in your table creation script look like:

column_name integer NOT NULL DEFAULT nextval('rd."table_name_columname_seq"'::regclass)

or

column_name serial

If the former, and if your original sequence wasn't anything custom, try changing it to "column_name serial" (or bigserial, depending on your needs).

Melissa Peterson
R&D Engineer
melissa@gigacrete.com
GigaCrete, Inc.
6775 Speedway Boulevard, Suite M-104
Las Vegas, NV  89115
Phone 702-643-6363
Fax 702-543-7010
www.gigacrete.com

B U I L D  S T R O N G.  B U I L D  F O R W A R D.

This message and any attachments are solely for the intended recipient and may contain confidential or privileged information.  If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is strictly prohibited.  If you have received this communication in error, please notify us by reply email and immediately and permanently delete this message and any attachments.



-----Original Message-----
From: pgsql-admin-owner@postgresql.org on behalf of Marc Fromm
Sent: Mon 2/8/2010 4:38 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] copy table

I created a new database and I want to copy a table from a different database into the new database.
1. I used phpPgAdmin and exported the table that I want a copy of.
2. In the new database I pasted the export into the SQL box in phpPgAdmin and clicked execute to create the table.
The table was created with no errors
The only problem is it did not create the sequence for the primary key.

Do I have to manually create the sequence or did I miss a step in exporting and creating the table?


Thanks

Marc




pgsql-admin by date:

Previous
From: Marc Fromm
Date:
Subject: copy table
Next
From: Kevin Kempter
Date:
Subject: "effective_io_concurrency" cannot be changed error when starting 8.4.2 instance