Thread: pg_restore woes..

pg_restore woes..

From
Chris Bowlby
Date:
Hi All,

 Ok, got one annoying issue with pg_restore, I'm trying to make use the
re-order/remove option using a TOC listing. The catch is that no matter
WHAT I do, it always imports the data for a particularily large table that
I can get rid of or wait till the end of the import to have it stored. I
current have the line that tells it to import it commented out and have
even gone so far as to delete the line all together. It's as it the TOC
internal to the tarred archive is overriding my override list... anyone
got any ideas? I'm using 7.2.x, on FreeBSD, here's my command line:

 pg_restore -U pgsql -S pgsql -h site.test.com -p 5433 -F t -v -d database
-x -O -L database.lst database.sql.tar

 Chris Bowlby,
 -----------------------------------------------------
 Manager of Information and Technology.
 excalibur@hub.org
 www.hub.org
 1-902-542-3657
 -----------------------------------------------------

Re: pg_restore woes..

From
Bruce Momjian
Date:
Upgrade to 7.3.  There were some bugs in the TOC handling in 7,2.X.

---------------------------------------------------------------------------

Chris Bowlby wrote:
>
> Hi All,
>
>  Ok, got one annoying issue with pg_restore, I'm trying to make use the
> re-order/remove option using a TOC listing. The catch is that no matter
> WHAT I do, it always imports the data for a particularily large table that
> I can get rid of or wait till the end of the import to have it stored. I
> current have the line that tells it to import it commented out and have
> even gone so far as to delete the line all together. It's as it the TOC
> internal to the tarred archive is overriding my override list... anyone
> got any ideas? I'm using 7.2.x, on FreeBSD, here's my command line:
>
>  pg_restore -U pgsql -S pgsql -h site.test.com -p 5433 -F t -v -d database
> -x -O -L database.lst database.sql.tar
>
>  Chris Bowlby,
>  -----------------------------------------------------
>  Manager of Information and Technology.
>  excalibur@hub.org
>  www.hub.org
>  1-902-542-3657
>  -----------------------------------------------------
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pg_restore woes..

From
Lamar Owen
Date:
> Chris Bowlby wrote:
> > Hi All,
> >
> >  Ok, got one annoying issue with pg_restore, I'm trying to make use the
> > re-order/remove option using a TOC listing. The catch is that no matter
> > WHAT I do, it always imports the data for a particularily large table
> > that I can get rid of or wait till the end of the import to have it

On Thursday 02 January 2003 17:47, Bruce Momjian wrote:
> Upgrade to 7.3.  There were some bugs in the TOC handling in 7,2.X.

I can't believe that's the best advice, given that the migration from 7.2 to
7.3 isn't the easiest one on the world.  What happened to back porting some
bugfixes to 7.2 from 7.3 because of that?  Would this particular pg_restore
fix be eligible for that treatment?  If so, are there other fixes that might
prompt a 7.2.4?

Quoting from Tom Lane:
=========
> 2.)   Maintaining security fixes for 7.2 for a good period of time to come,
> since migration from 7.2 to >7.2 isn't easy.

True, but I think we'll have to deal with that anyway.  Even if the
physical database upgrade were trivial, people are going to find
application compatibility problems due to schemas and other 7.3 changes.
So we're going to have to expend at least some work on fixing critical
7.2.* problems.  (I just want to keep a tight rein on how much.)

                        regards, tom lane
==========

This is just an annoyance (probably not critical): the 7.2-7.3 migration may
be a royal pain instead of an annoyance.  And, as Tom reminds us above, it
_isn't_ just a data migration issue, but an application compatibility issue
as well.

Chris, I'd do the upgrade on a scratch machine loaded with a duplicate of you
7.2.x data and see, first, just how big of a pain you have.  It might be that
you don't hit the corner cases that cause the most pain.  I certainly hope it
goes easy for you.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11


Re: pg_restore woes..

From
Bruce Momjian
Date:
Lamar Owen wrote:
> > Chris Bowlby wrote:
> > > Hi All,
> > >
> > >  Ok, got one annoying issue with pg_restore, I'm trying to make use the
> > > re-order/remove option using a TOC listing. The catch is that no matter
> > > WHAT I do, it always imports the data for a particularily large table
> > > that I can get rid of or wait till the end of the import to have it
>
> On Thursday 02 January 2003 17:47, Bruce Momjian wrote:
> > Upgrade to 7.3.  There were some bugs in the TOC handling in 7,2.X.
>
> I can't believe that's the best advice, given that the migration from 7.2 to
> 7.3 isn't the easiest one on the world.  What happened to back porting some
> bugfixes to 7.2 from 7.3 because of that?  Would this particular pg_restore
> fix be eligible for that treatment?  If so, are there other fixes that might
> prompt a 7.2.4?

At the time I did the fix, I could have backpatched, but the number of
fixes was extensive.  There were several places where the TOC tag didn't
match the object name, and once I was done it wasn't safe enough to
backpatch.

Also, most of the bugs were in the dump file, not the restore program,
so it would only have prevented problems if someone had used the newer
dump.  I assume folks doing 7.2->7.3 mirgrations are not using TOC to
extract specific objects.

FYI, there is a fix for dumping DEFERRABLE/DEFERRED which will be
backpatched into 7.3.2 so folks upgrading to 7.4 will be OK.  It is a
very small patch.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pg_restore woes..

From
Lamar Owen
Date:
On Thursday 02 January 2003 18:41, Bruce Momjian wrote:
> Lamar Owen wrote:
> > On Thursday 02 January 2003 17:47, Bruce Momjian wrote:
> > > Upgrade to 7.3.  There were some bugs in the TOC handling in 7,2.X.

> > I can't believe that's the best advice, given that the migration from 7.2
> > to 7.3 isn't the easiest one on the world.

> At the time I did the fix, I could have backpatched, but the number of
> fixes was extensive.  There were several places where the TOC tag didn't
> match the object name, and once I was done it wasn't safe enough to
> backpatch.

Ok, fair enough.  As it is more annoyance than anything, and since your expert
opinion is that it wasn't 'safe' to backpatch, then that probably was a good
call.  I just wanted to add that the fix could be a worse thing than the
problem.

I just found it flippant to make a blanket 'upgrade to 7.3' statement....

> FYI, there is a fix for dumping DEFERRABLE/DEFERRED which will be
> backpatched into 7.3.2 so folks upgrading to 7.4 will be OK.  It is a
> very small patch.

Good.  Hopefully the migration to 7.4 won't be as traumatic as migrating to
7.3 can be.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11


Re: pg_restore woes..

From
Bruce Momjian
Date:
Lamar Owen wrote:
> On Thursday 02 January 2003 18:41, Bruce Momjian wrote:
> > Lamar Owen wrote:
> > > On Thursday 02 January 2003 17:47, Bruce Momjian wrote:
> > > > Upgrade to 7.3.  There were some bugs in the TOC handling in 7,2.X.
>
> > > I can't believe that's the best advice, given that the migration from 7.2
> > > to 7.3 isn't the easiest one on the world.
>
> > At the time I did the fix, I could have backpatched, but the number of
> > fixes was extensive.  There were several places where the TOC tag didn't
> > match the object name, and once I was done it wasn't safe enough to
> > backpatch.
>
> Ok, fair enough.  As it is more annoyance than anything, and since your expert
> opinion is that it wasn't 'safe' to backpatch, then that probably was a good
> call.  I just wanted to add that the fix could be a worse thing than the
> problem.

It was one of those, "X doesn't work" and when you go to fix X, you find
A-F doesn't work either.  :-(  Then you start ripping things apart to
fix it.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pg_restore woes..

From
Alvaro Herrera
Date:
On Thu, Jan 02, 2003 at 06:41:18PM -0500, Bruce Momjian wrote:
> Lamar Owen wrote:

> > On Thursday 02 January 2003 17:47, Bruce Momjian wrote:
> > > Upgrade to 7.3.  There were some bugs in the TOC handling in 7,2.X.
> >
> > I can't believe that's the best advice, given that the migration from 7.2 to
> > 7.3 isn't the easiest one on the world.

> Also, most of the bugs were in the dump file, not the restore program,

But you can use the 7.3 pg_dump against older servers, so you can
probably upgrade only pg_dump and keep 7.2 for the rest. (Being careful
to pick 7.3.1 to upgrade the libpq with different version number, I
believe.)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
FOO MANE PADME HUM

Re: pg_restore woes..

From
Tom Lane
Date:
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
>> Lamar Owen wrote:
>>> I can't believe that's the best advice, given that the migration from 7.2 to
>>> 7.3 isn't the easiest one on the world.

> But you can use the 7.3 pg_dump against older servers, so you can
> probably upgrade only pg_dump and keep 7.2 for the rest.

No, because 7.3 pg_dump's output probably won't load into an older
server.  (For example, it'll likely try to use ALTER TABLE ADD PRIMARY
KEY which didn't work before 7.3.  Similar issues occur in every prior
release AFAIR.)  The input-version flexibility in pg_dump is really only
useful in an I'm-upgrading-now scenario.

            regards, tom lane