Re: Suggestions for blocking user inserts during admin bulk loading.

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Woody Woodring <george(dot)woodring(at)iglass(dot)net>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Suggestions for blocking user inserts during admin bulk loading.
Date: 2009-03-11 14:10:57
Message-ID: dcc563d10903110710r7cf52a40le4d0b25cb4cde243@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Mar 11, 2009 at 8:01 AM, Woody Woodring
<george(dot)woodring(at)iglass(dot)net> wrote:
> I have a table that users can update if the data is old.  Once a day I
> update every entry in the table.  However I get primary key violations
> occasionally which it seems a user inserted into the table while the bulk
> insert is going on.

Yeah, you need to first deny access rights to all users that aren't
the one doing the loading, then kick off all the users that are
already connected. To remove the rights of anyone else to connect,
the easiest way is to edit pg_hba.conf / have a special pg_hba.conf to
copy into place, then reload the db. After that, from a shell script
or something, you need to kill the backends that are still connected.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2009-03-11 15:03:25 Re: I don't want to back up index files
Previous Message Woody Woodring 2009-03-11 14:01:43 Suggestions for blocking user inserts during admin bulk loading.