how to make an 'UNLOCK'?

From: "Grand Titus" <grand(dot)titus(at)free(dot)fr>
To: <pgsql-general(at)postgresql(dot)org>
Subject: how to make an 'UNLOCK'?
Date: 2002-11-30 13:51:33
Message-ID: 005a01c29877$97e89ed0$b18ae78a@titus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


In my DB there are 3 tables A, B and C
I try to make a function "INTEGER Insertion (TEXT,TEXT)" which insert the
parameters into the 3 tables in this way:
1- Verify if $1 exits in A
1.1- If yes then read the identificator (id_1) associate to $1
1.2- If not then insert $1 into A and read its new indentificator (id_1)
2- Verify if $2 exits in B
2.1- If yes then read the identificator (id_2) associate to $2
2.2- If not then insert $2 into B and read its new indentificator (id_2)
3- Verify if (id_1,id_2) exists in C
3.1 If yes then increase the field 'occurence'
3.2 If not then insert (id_1,id_2,1) into C (1 is for occurence=1)
My problem is the following:
Several processus can use this function simultaneously. So for all these
steps (1, 2 and 3) I need to lock respectively the table A, B and C. In
order to improve the efficiency of this DB, I would like to unlock the table
A, for ex, when I go from the step 1 to the step 2 (in order to enable
another processus to work on the table A).
And I don't know how to unlock a table, I can't find the command 'UNLOCK'.
Do you know another command or solution to do this, for ex by usuing a C
function (I know that those kind of function exit but I nerver programmed
one of them)?

Thanks for your help

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Horacio Miranda 2002-11-30 14:54:11 about ODBC
Previous Message Nick Gazaloff 2002-11-30 13:50:45