Re: pg_restore COPY error handling

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(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-03 02:50:42
Message-ID: 20060203025041.GW4474@ns.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> I agree. I wonder if it wouldn't be cleaner to pass the information in
> the other direction, ie, send a boolean down to PrintTocData saying "you
> are sending SQL commands" or "you are sending COPY data". Then, instead
> of depending only on the libpq state to decide what to do in
> ExecuteSqlCommandBuf, we could cross-check: if we're sending SQL data
> and the libpq state is wrong, just discard the line.

I believe the attached patch does this now. Under my test case it
correctly handled things. I'm certainly happier with it this way and
apologize for not realizing this better approach sooner. Please
comment.

Thanks!

Stephen

Attachment Content-Type Size
pg_restore2.ctx.diff text/plain 3.5 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Woodward 2006-02-03 03:14:11 Re: Multiple logical databases
Previous Message Stephen Frost 2006-02-03 02:21:27 Re: Krb5 & multiple DB connections