Re: [HACKERS] Continue transactions after errors in psql

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Michael Paesold <mpaesold(at)gmx(dot)at>, Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Continue transactions after errors in psql
Date: 2005-04-26 15:46:45
Message-ID: 426E6265.3090508@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>
>>Tom Lane wrote:
>>
>>
>>>I would far rather see people code explicit markers around statements
>>>whose failure can be ignored. That is, a script that needs this
>>>behavior ought to look like
>>>
>>>BEGIN;
>>>\begin_ignore_error
>>>DROP TABLE foo;
>>>\end_ignore_error
>>>CREATE ...
>>>...
>>>COMMIT;
>>>
>>>
>
>
>
>>That's a lot of work.
>>
>>
>
>How so? It's a minuscule extension to the psql patch already coded:
>just provide backslash commands to invoke the bits of code already
>written.
>
>

I meant it's a lot to type ;-)

>
>
>>In this particular case I would actually like to
>>see us provide "DROP IF EXISTS ..." or some such.
>>
>>
>
>That's substantially more work, with substantially less scope of
>applicability: it would only solve the issue for DROP.
>
>
>
>

True. I wasn't suggesting it as an alternative in the general case. I
still think it's worth doing, though - I have often seen it requested
and can't think of a compelling reason not to provide it. But maybe
that's off topic ;-)

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Wheeler 2005-04-26 15:49:26 Re: DO INSTEAD and conditional rules
Previous Message Tom Lane 2005-04-26 15:19:51 Re: [HACKERS] Continue transactions after errors in psql

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-04-26 15:51:38 Re: [HACKERS] Continue transactions after errors in psql
Previous Message Heikki Linnakangas 2005-04-26 15:40:36 Re: Cleaning up unreferenced table files