Re: pg_restore COPY error handling

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: pg_restore COPY error handling
Date: 2006-02-02 02:54:51
Message-ID: 200602020254.k122sp126461@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Stephen Frost wrote:
-- Start of PGP signed section.
> * Stephen Frost (sfrost(at)snowman(dot)net) wrote:
> > * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> > > ISTM you should be depending on the archive structure: at some level,
> > > at least, pg_restore knows darn well whether it is dealing with table
> > > data or SQL commands.
> >
> [...]
> > I'd be happy to work this up, and I think it would work, but it seems
> > kind of ugly since then we'd have ahwrite and ahprintf returning error
> > codes which in 99% of the cases wouldn't be checked which doesn't seem
> > terribly clean. :/
>
> Looking at this again, I'm not 100% sure it'd work quite that cleanly.
> I'm not sure you can just skip that PrintTocDataPtr call, depending on
> the how the input is coming in... There might be a way to modify
> _PrintData (in pg_backup_custom.c, and the others, which is what is
> the function behind PrintTocDataPtr) to somehow check an AH variable
> which essentially says "the data command failed, just ignore the input",
> and we'd need to set the AH variable somewhere else, perhaps using the
> return value setup I described before...

Whatever we do is going to be cleaner than looking for "<space>*COPY".

> All of this is sounding rather invasive though. I have to admit that
> I'm not exactly a big fan of the pg_dump/pg_restore modular system. :/

Hence TODO has:

o Remove unnecessary function pointer abstractions in pg_dump source
code

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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-02-02 03:08:18 Re: pg_restore COPY error handling
Previous Message Stephen Frost 2006-02-02 02:53:54 Re: pg_restore COPY error handling