Re: How to release locks

From: "Andrus" <eetasoft(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to release locks
Date: 2006-03-22 16:11:41
Message-ID: dvrtjv$upl$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> A cancel signal was sent to the selected server process(es).
>> However, process continues running.
>
> What's it doing exactly?

Client was killed when it waits a 2 MB bytea string insert statement to be
completed inside transaction:

INSERT INTO localfil (filename,filedirect,BlockNumber,lastchange,contents)
values( 'alguss.exe', 'algus', 1,CURRENT_TIMESTAMP, decode(
'1mbbinarystring', 'hex') );

odbc driver was in progress of sending data using libpq when client was
terminated.

> We recently fixed some places in btree index creation where the thing
> could run for a long time before noticing a cancel interrupt. Maybe
> you've found another one.

localfil table is empty before insert (it has large bytea fields but all
rows are deleted before repro). So index (primary key) is single row.

Can it happen that process running 2 mb bytea insert command will take
extremely long time to interrupt ?
Or will decode() function take long time to interrupt ?
There is also before insert or update trigger, maybe this influences ?
I'm currently uploading files using 1 mb binary data which are converted to
a 2 MB hex strings before uploading through odbc.

File is uploaded, stored and downloaded using localfil table in a number of
records each containing 1 MB of data.

Is it more reasonable to use smaller blocks to load and store files ?

Andrus.

My table strucure is

CREATE TABLE public.localfil (
Filename CHAR(50),
FileDirect CHAR(8),
BlockNumber INTEGER,
lastchange timestamp NOT NULL,
Contents BYTEA NOT NULL,
PRIMARY KEY ( Filename, FileDirect, BlockNumber )
);

CREATE TRIGGER localfil_trig BEFORE INSERT OR UPDATE
ON localfil EXECUTE PROCEDURE setlastchange();

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Jones 2006-03-22 16:35:35 index for inet and >> (contains) function
Previous Message William ZHANG 2006-03-22 15:53:54 Re: Modular Type Libraries: was A real currency type