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 07:56:57
Message-ID: dvr00h$26to$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> It is not because of the locks. There is only running transaction (and it
> got every locks). Not sure why the backend stucks there, seems it doesn't
> aware of the broken client. In normal situations, if you killed a client,
> then the server will print something like "could not receive data from
> client" then exit the backend.
>
> If you can attach to the problematic postgres process, that would be more
> helpful to identify the problem.

My ODBC client uploads 9 MB binary file to server bytea field using 1 MB
binary hex encoded blocks using code something like:

START TRANSACTION;
DELETE FROM localfil WHERE LOWER(filename)='alguss.exe';
INSERT INTO localfil (filename,filedirect,BlockNumber,lastchange,contents)
values( 'alguss.exe', 'algus', 1,CURRENT_TIMESTAMP, decode(
'1mbbinarystring', 'hex') );
INSERT INTO localfil (filename,filedirect,BlockNumber,lastchange,contents)
values( 'alguss.exe', 'algus', 2,CURRENT_TIMESTAMP, decode(
'1mbbinarystring', 'hex') );
.... etc 8 insert statemens
COMMIT;

insert command takes a long time. I terminated the client application from
Windows XP client manager during insert command.
At next re-run application and pgadmin both hang in DELETE FROM line

I think I can reproduce this. Postgres server is in FreeBSD.
I can require server admin to do something after the problem occurs.

What should I do after reproducing the problem ?

Table structure 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();

and table is empty.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Qingqing Zhou 2006-03-22 08:01:56 Re: How to release locks
Previous Message Steven Brown 2006-03-22 07:41:11 Enforcing serial uniqueness?