sojin
sojin

Reputation: 4694

How to specify explicit locking while creating a table in PostgreSQL

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

Answers (2)

Ketema
Ketema

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

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

Related Questions