Re: COPY FROM and INSERT INTO rules

From: "Brent Wood" <b(dot)wood(at)niwa(dot)co(dot)nz>
To: <kmsram420(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY FROM and INSERT INTO rules
Date: 2010-12-07 03:38:51
Message-ID: 4CFE631B0200007B000341F6@gwia.niwa.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From the 8.3 docs...

"Be aware that COPY ignores rules. ... COPY does fire triggers, so you can use it normally if you use the trigger approach."

HTH,

Brent Wood


All,

I have a rule written on a temp table which will copy the valuesinserted into it to another table applying a function. The temp tablewill be discarded then. The rules I have written works when I use"Insert into" the temp table. But when I use bulk copy "COPY FROM", therule doesn't get triggered and data is inserted only into the temptable that I created.

Is there a way to call a rule when I use "COPY FROM" instead of "INSERTINTO"

TIA,
Sairam

Brent Wood
DBA/GIS consultant
NIWA, Wellington
New Zealand
Please consider the environment before printing this email.

NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-12-07 03:49:52 Type cast removal - proposed exceptions for xml,enum
Previous Message Tom Lane 2010-12-07 01:44:59 Re: Do we want SYNONYMS?