Re: 7.3.x data migration to 7.4.x - inelegant solution

From: <operationsengineer1(at)yahoo(dot)com>
To: operationsengineer1(at)yahoo(dot)com, PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: 7.3.x data migration to 7.4.x - inelegant solution
Date: 2005-09-13 19:35:03
Message-ID: 20050913193503.29107.qmail@web33311.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

--- operationsengineer1(at)yahoo(dot)com wrote:

> phppgadmin (my only access to db - cheesy webhost)
> has
> an "export" link that only allows me to...
>
> export data, structure or data and structure (fine
> so
> far, i want data only).
>
> format options are "copy" and "sql".
>
> i can also check "oid" and/or "drop", but i don't
> think either apply to my case since i don't use oids
> as primary keys.
>
> i can download the data or i can download a
> compressed
> copy of the data.
>
> i tried data only and downloaded with the sql
> options.
>
> i plugged this into pgadmin's query view and ran it.
>
> unfortunately, the sql doesn't list the column names
> in the insert statements... and my columns are not
> all in the same order! so close... yet still so
> far....
>
> is there anything i can do here? i don't think
> pgadmin allows me to reorder columns. therefore, i
> don't like that approach (deleting and recreating a
> lot of columns and handling all the contrainsts,
> etc...).
>
> i don't fully understand how to restore the output
> of
> the "copy" option. when i try and restore something
> in pgadmin3, it is looking for a file with extension
> *.backup. i don't think phppgadmin (as set up on
> cheesy webhost) allows me to create this type of
> file.
>
> any guidance would be appreciated - as always.
>

my solution, albeit not a nice one - but it works, is
to "export table "data only" with the SQL option in
7.3.x.

i then open it up in OOo writer, to a search and
replace and replace "VALUES" with "(list of columns in
column order) VALUES"

i then paste it into pgadmin's query view, deleate the
notes and extraneous text and run it.

of course, you have to know your relations b/c you
likely won't be allowed to break foreign key
constrainsts.

ugly, yes. effective, yes.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Swierczek 2005-09-13 20:27:54 question regarding contrib/tablefunc
Previous Message Tom Lane 2005-09-13 18:39:29 Re: Joining a series of dates