Re: psql vs perl prepared inserts - Mailing list pgsql-general

From Mike Rylander
Subject Re: psql vs perl prepared inserts
Date
Msg-id b918cf3d0504140415574151a8@mail.gmail.com
Whole thread Raw
In response to Re: psql vs perl prepared inserts  (Dawid Kuroczko <qnex42@gmail.com>)
List pgsql-general
Just to add some clarity to the Dawid's fine comments:

On 4/14/05, Dawid Kuroczko <qnex42@gmail.com> wrote:
> On 4/13/05, Matt Van Mater <matt.vanmater@gmail.com> wrote:
> I believe that COPY handles things like unique constraints and
> referer integerity just fine (of the latter I am not sure) -- well,
> its hard to imagine PostgreSQL allowing itself to loose integrity
> of the data, don't you agree?
>

I do, and so does PG. :)  Everything that would normally happen with
an INSERT, including firing TRIGGERs, checking FKEYs, setting
DEFAULTs, running CHECK constraints -- everything -- happens with a
COPY import.

The *one and only* exception to the above statement is that RULEs to
not get used on COPY.  The reason for this is that RULEs rewrite
queries and after the COPY FROM header there isn't a query to rewrite,
it's just a pile of data.

This is in the docs, but it's not easy to find.  It's actually just
one line in the "Notes" section of
http://www.postgresql.org/docs/8.0/static/sql-copy.html .  Perhaps we
should add some more verbiage (he says, non-voluntarily...)?

--
Mike Rylander
mrylander@gmail.com
GPLS -- PINES Development
Database Developer
http://open-ils.org

pgsql-general by date:

Previous
From: Sibtay Abbas
Date:
Subject: Re: Checking cursor's state in plpgsql
Next
From: Hugo
Date:
Subject: Re: grant all privileges to all tables in a database