David Goodenough <david(dot)goodenough(at)btconnect(dot)com> writes:
> The statements issued to lock each table is:-
> LOCK TABLE table IN EXCLUSIVE MODE; SELECT 1 FROM table;
> (I am not quite sure why the SELECT 1 FROM table is there, it came with
> HA-JDBC as the code for the Postgresql dialect).
> I notice that this seems to take a time that is dependant on the size
> of the table, which seems odd - almost as though it is locking each row
> rather than the whole table at once.
No, but it's *reading* each row to execute the "SELECT 1 FROM table".
regards, tom lane