copy table

--_000_B0D7C0A3F35FE144A70312D086CBCA9B03D3D67F8DExchMailbox 2u_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I created a new database and I want to copy a table from a different databa=
se 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 a=
nd 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


--_000_B0D7C0A3F35FE144A70312D086CBCA9B03D3D67F8DExchMailbox 2u_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>I created a new database and I want to copy a table from=
a
different database into the new database.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>1. I used phpPgAdmin and exported the table that I want =
a
copy of.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>2. In the new database I pasted the export into the SQL =
box
in phpPgAdmin and clicked execute to create the table.<o:p></o:p></span></f=
ont></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>The table was created with no errors<o:p></o:p></span></=
font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>The only problem is it did not create the sequence for t=
he
primary key.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>Do I have to manually create the sequence or did I miss =
a
step in exporting and creating the table?<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>Thanks<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span style=3D'fon=
t-size:10.0pt;
font-family:"Courier New"'>Marc</span></font><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span style=3D=
'font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>

--_000_B0D7C0A3F35FE144A70312D086CBCA9B03D3D67F8DExchMailbox 2u_--
Marc Fromm [ Di, 09 Februar 2010 00:38 ] [ ID #2031698 ]

Re: copy table

This is a multi-part message in MIME format.

------_=_NextPart_001_01CAA91C.7EC86CF6
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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 [at] 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 [at] postgresql.org on behalf of Marc Fromm
Sent: Mon 2/8/2010 4:38 PM
To: pgsql-admin [at] 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





------_=_NextPart_001_01CAA91C.7EC86CF6
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7226.0">
<TITLE>RE: [ADMIN] copy table</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=3D2>For your primary key column, does the SQL in your =
table creation script look like:<BR>
<BR>
column_name integer NOT NULL DEFAULT =
nextval('rd."table_name_columname_seq"'::regclass)<BR>
<BR>
or<BR>
<BR>
column_name serial<BR>
<BR>
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).<BR>
<BR>
Melissa Peterson<BR>
R&D Engineer<BR>
melissa [at] gigacrete.com<BR>
GigaCrete, Inc.<BR>
6775 Speedway Boulevard, Suite M-104<BR>
Las Vegas, NV  89115<BR>
Phone 702-643-6363<BR>
Fax 702-543-7010<BR>
www.gigacrete.com<BR>
<BR>
B U I L D  S T R O N G.  B U I L D  F O R W A R D.<BR>
<BR>
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.<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: pgsql-admin-owner [at] postgresql.org on behalf of Marc Fromm<BR>
Sent: Mon 2/8/2010 4:38 PM<BR>
To: pgsql-admin [at] postgresql.org<BR>
Subject: [ADMIN] copy table<BR>
<BR>
I created a new database and I want to copy a table from a different =
database into the new database.<BR>
1. I used phpPgAdmin and exported the table that I want a copy of.<BR>
2. In the new database I pasted the export into the SQL box in =
phpPgAdmin and clicked execute to create the table.<BR>
The table was created with no errors<BR>
The only problem is it did not create the sequence for the primary =
key.<BR>
<BR>
Do I have to manually create the sequence or did I miss a step in =
exporting and creating the table?<BR>
<BR>
<BR>
Thanks<BR>
<BR>
Marc<BR>
<BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01CAA91C.7EC86CF6--
Melissa Peterson [ Di, 09 Februar 2010 01:11 ] [ ID #2031699 ]
Datenbanken » gmane.comp.db.postgresql.admin » copy table

Vorheriges Thema: "effective_io_concurrency" cannot be changed error when starting 8.4.2 instance
Nächstes Thema: ctrl-c - is it safe to kill a query?