Re: [GENERAL] Other queries locked out during long insert

2008-12-18 Thread Peter Eisentraut
Joshua J. Kugler wrote: OK, that makes sense. There was nothing on the TRUNCATE page to suggest that TRUNCATE would lock the tables. Maybe an addition to the documentation is in order? Where do I go to suggest that? I have added something to document this. -- Sent via pgsql-general mailing

Re: [GENERAL] Other queries locked out during long insert

2008-12-17 Thread Joshua J. Kugler
On Wednesday 17 December 2008, Peter Eisentraut said something like: > Because the TRUNCATE commands are taking out an exclusive lock on the > tables. > > > My understanding of MVCC is that I should be able to query against > > those tables while these insert loops are in their transaction. > > You

Re: [GENERAL] Other queries locked out during long insert

2008-12-17 Thread Peter Eisentraut
On Wednesday 17 December 2008 12:18:04 Joshua J. Kugler wrote: > Begin > Truncate table1, table2 > > for row in file1: > insert into table1 > sleep(0.001) # see note below > > for row in file2: > insert into table2 > sleep(0.001) # see note below > > Commit > During the time where

Re: [GENERAL] Other queries locked out during long insert

2008-12-17 Thread Martijn van Oosterhout
On Wed, Dec 17, 2008 at 01:18:04AM -0900, Joshua J. Kugler wrote: > I've read the Pg docs about MVCC and possible locks that indexes can > create. Even so, I can't figure out why my code is causing all other > queries to block while it is running. I'm reading data in from a file > (line by lin

[GENERAL] Other queries locked out during long insert

2008-12-17 Thread Joshua J. Kugler
I've read the Pg docs about MVCC and possible locks that indexes can create. Even so, I can't figure out why my code is causing all other queries to block while it is running. I'm reading data in from a file (line by line, its CSV), doing a little pre-processing, and inserting it into a table