pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>
To: pgsql-sql@postgresql.org
Subject: Re: data import via COPY, Rules + Triggers
Date: Sat, 7 May 2011 10:39:44 +0100
Message-ID: <20110507103944.53c2dca5@dick.coachhouse> (raw)
In-Reply-To: <20110504234804.0d0a1fff@dick.coachhouse>
References: <20110504234804.0d0a1fff@dick.coachhouse>

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



view thread (4+ messages)

Message-ID: <20110507103944.53c2dca5@dick.coachhouse>
Permalink:  ../20110507103944.53c2dca5@dick.coachhouse/
Also on:    postgresql.org/message-id/20110507103944.53c2dca5@dick.coachhouse

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: postgresql3@numerixtechnology.de
  Subject: Re: data import via COPY, Rules + Triggers
  In-Reply-To: <20110507103944.53c2dca5@dick.coachhouse>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox