Re: Raise Exception

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Mario Reis <m(dot)reis(at)bca(dot)pt>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Raise Exception
Date: 2005-04-04 16:37:09
Message-ID: 20050404163708.GA21928@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Mon, Apr 04, 2005 at 09:24:17AM -0000, Mario Reis wrote:

[Cc: to pgsql-hackers dropped]

> As far as i realise, every time the Server validates a wrong value
> for an input it Raises an Exception with the check failure for each
> input "for each record"
> For example, for each invalid foreing key, it automaticly raises an
> exception.If you have a large file 20fields to validate before insert
> the validates each on at a time and raises an exception for each
> falure.

Actually this depends on the client side. The server sends one error
message to the client, the first time an error is found. If the client
continues sending data, eventually another error will be found and
another error message will be sent. It is up to the client to either
stop sending data as soon as an error is found, or to collect all errors
and report later.

If you want to load large amounts of data in a table and have rejected
data end up in a separate file, you can do so using the "pgloader"
project from http://pgfoundry.org.

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"Nunca se desea ardientemente lo que solo se desea por razón" (F. Alexandre)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2005-04-04 16:39:33 Re: How to query pgsql from a BASH script ?
Previous Message Andrew Dunstan 2005-04-04 16:30:50 Re: [HACKERS] plPHP in core?

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-04-04 18:08:11 Re: Notes on lock table spilling
Previous Message Andrew Dunstan 2005-04-04 16:30:50 Re: [HACKERS] plPHP in core?