Re: regclass without error?

From: David Fetter <david(at)fetter(dot)org>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, Tatsuo Ishii <ishii(at)postgresql(dot)org>, robertmhaas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: regclass without error?
Date: 2010-09-03 17:31:00
Message-ID: 20100903173100.GD1526@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 03, 2010 at 01:28:15PM -0400, Alvaro Herrera wrote:
> Excerpts from David Fetter's message of vie sep 03 10:21:00 -0400 2010:
>
> > > How about using a SAVEPOINT before the cast? Wouldn't fail your
> > > transaction..
> >
> > For unattended operation, there are some issues:
> >
> > * Generating appropriate SAVEPOINT names
> > * Keeping track of same
> > * Detecting errors
> > * Issuing ROLLBACKs to the aforementioned SAVEPOINT
> >
> > None of this works super well for a bulk load.
>
> Why do you need any of this? The logic is pretty simple:
>
> SAVEPOINT my_savepoint;
> select ...::regclass;
>
> -- if it works
> RELEASE my_savepoint;
>
> -- if it fails
> ROLLBACK TO my_savepoint;
> RELEASE my_savepoint;
>
> Granted, it's not super-performant ...

We have no mechanism to do this, or any other check, during a bulk
load. It'd be a great feature to have :)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-09-03 17:43:56 Re: regclass without error?
Previous Message Alvaro Herrera 2010-09-03 17:28:15 Re: regclass without error?