Search Postgresql Archives

Re: LOCK TABLE HELP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> luca.ciciriello@xxxxxxxx wrote:

> My action are:
>
> void *Execute(void *pParam)
> {
>         ........................................
>         ........................................
>
>  & nbsp;      string tableLock = "BEGIN WORK;";
>         tableLock.append(" LOCK TABLE ");
>         tableLock.append(actorTable);
>         tableLock.append(" IN ACCESS EXCLUSIVE MODE;");
>         res = PQexec(connection, tableLock.c_str());


> Well, all this doesn't work (the connection is th e always the same in  
> all methods and functions). Have I to Lock the table, perform some  
> operation on this table, and unlock the table all in the same function  
> scope?

What do you mean it doesn't work?  How exactly it fails?

If anything, I'd suggest to send the LOCK TABLE in a separate PQexec()
call from BEGIN WORK.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux