Information regarding Table-Locks

From: sri harsha <sriharsha9992(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Information regarding Table-Locks
Date: 2015-01-16 05:14:24
Message-ID: CAP6OGLF859fRjCfaO_Z6pKR2McMfsT_3U00+8bsie50pVjSEWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a few doubts regarding table locks. Assume I am executing the
following query

Query 1 -- INSERT INTO FOREIGN_TABLE SELECT * FROM POSTGRES_TABLE

Query 2 -- INSERT INTO FOREIGN_TABLE SELECT * FROM FOREIGN_TABLE

If i get a table lock for the foreign table , will the second table from
which i am getting the data will also come under this lock ?? Or is it a
separate lock ?? Does postgres handle that lock ??

What kind of lock will the second table will be in ?? Can i rename the
second table while executing the INSERT QUERY ??

Thanks,
Harsha

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2015-01-16 05:20:21 Re: Information regarding Table-Locks
Previous Message Adrian Klaver 2015-01-16 05:09:35 Re: Casting hstore to json