Reputation: 4694
What is the default locking mechanism in PostgresSQL when we create a table ? is it row, page, table level or something else?
Is it possible to specify row level locking when we create a table ? something like below in Sybase.
CREATE TABLE user
(...)
LOCK DATRAROWS
Or do we not need to specify any locking strategy and leave it to Postgres to choose the best while we dealing CRUD ?
Cheers!
Upvotes: 0
Views: 1064
Reputation: 6598
There is no locking when you create a table. Locking can be read here: http://www.postgresql.org/docs/9.0/static/explicit-locking.html
Upvotes: 1
Reputation: 95682
There isn't anything you can specify at CREATE TABLE time for PostgreSQL. At run time, you can select rows FOR UPDATE
or FOR SHARE
. If you're coming to PostgreSQL from another platform, you should skim the docs on concurrency control.
Upvotes: 1