Information regarding Table-Locks - Mailing list pgsql-general

From sri harsha
Subject Information regarding Table-Locks
Date
Msg-id CAP6OGLF859fRjCfaO_Z6pKR2McMfsT_3U00+8bsie50pVjSEWg@mail.gmail.com
Whole thread Raw
Responses Re: Information regarding Table-Locks
List 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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Casting hstore to json
Next
From: John R Pierce
Date:
Subject: Re: Information regarding Table-Locks