how to make an 'UNLOCK'? - Mailing list pgsql-general

From Grand Titus
Subject how to make an 'UNLOCK'?
Date
Msg-id 005a01c29877$97e89ed0$b18ae78a@titus
Whole thread Raw
Responses Re: how to make an 'UNLOCK'?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Nick Gazaloff
Date:
Subject: ...
Next
From: pginfo
Date:
Subject: vacuum full analyze problem