Thread: COPY and triggers

COPY and triggers

From
"Oliver Elphick"
Date:
I've been reading Great Bridge's document on Administration and Tuning
(PDF document under http://www.greatbridge.com/product/software.php)
and came across this statement on page 27:

"When using the COPY command to load data into a Great Bridge PostgreSQL
database, the triggers and constraints on tables are disabled."

This is contrary to what the man page on COPY says and to my experience.
Is this statement wrong? or is there some method of disabling
triggers and constraints that I have overlooked?

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "And I say unto you, Ask, and it shall be given you;
      seek, and ye shall find; knock, and it shall be opened
      unto you."            Luke 11:9



Re: COPY and triggers

From
Peter Eisentraut
Date:
Oliver Elphick writes:

> "When using the COPY command to load data into a Great Bridge PostgreSQL
> database, the triggers and constraints on tables are disabled."

Perhaps that's a feature of Great Bridge PostgreSQL, but it's not a
feature of Plain Old PostgreSQL. ;-)

(It would be correct to say that rules are disabled.)

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: COPY and triggers

From
Tom Lane
Date:
"Oliver Elphick" <olly@lfix.co.uk> writes:
> I've been reading Great Bridge's document on Administration and Tuning
> (PDF document under http://www.greatbridge.com/product/software.php)
> and came across this statement on page 27:

> "When using the COPY command to load data into a Great Bridge PostgreSQL
> database, the triggers and constraints on tables are disabled."

> This is contrary to what the man page on COPY says and to my experience.
> Is this statement wrong?

It's wrong.

COPY does not fire rules, but it does fire triggers and constraints.

            regards, tom lane