Re: data import via COPY, Rules + Triggers - Mailing list pgsql-sql

From Tarlika Elisabeth Schmitz
Subject Re: data import via COPY, Rules + Triggers
Date
Msg-id 20110507103944.53c2dca5@dick.coachhouse
Whole thread Raw
In response to data import via COPY, Rules + Triggers  (Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>)
List pgsql-sql
On Wed, 4 May 2011 23:48:04 +0100
Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de> wrote:

>I have got a database that needs to be populated, first with historical
>data, then on a daily basis.[...]
>Once imported, data will neither be modified nor deleted.
>
>Data come in denormalized CSV formats. [...]
>I created interim tables matching the structure of the CSV formats
>I want to import via COPY and distribute the data to
>the "proper" tables via triggers.

[...]


I am the only user of the system and at the moment I have only one
database user.

I only want the insdert/update triggers to be executed when I am
importing data. There might be situations where I need to intervene
"manually" and fix some data without the triggers being actioned.

How about creating a second user through whom the imports are done?

I could query current_user in the trigger and simply skip the trigger
actions for any other user. 

QUESTION: 
Or could I do something more sophisticated with privileges?

-- 
Tarlika Elisabeth Schmitz


pgsql-sql by date:

Previous
From: Tarlika Elisabeth Schmitz
Date:
Subject: Re: data import via COPY, Rules + Triggers
Next
From: Thomas Kellerer
Date:
Subject: Specifying column level collations