Thread: What DBMS_LOCK?

What DBMS_LOCK?

From
Saret Sout
Date:
Dear Community!

Do you know about DBMS_LOCK on oracle? What is the main purpose of it?
How about postgresql ?Does postgresql has DBMS_LOCK? If it doesn't have how can we implement like DBMS_LOCK in oracle? Please help me to explain this issue. Thank

Re: What DBMS_LOCK?

From
Sameer Kumar
Date:

On Thu, Feb 27, 2014 at 9:13 PM, Saret Sout <saretsout@gmail.com> wrote:
Dear Community!

Do you know about DBMS_LOCK on oracle? What is the main purpose of it?
AFAIK, DBMS_LOCK in Oracle are used for taking locks on devices e.g. printer, screen etc.
How about postgresql ?Does postgresql has DBMS_LOCK?
Where do you want to use it? It was apt for those days when people did not had very powerful programming language and whole application was written within database.

If it doesn't have how can we implement like DBMS_LOCK in oracle? Please help me to explain this issue. Thank
Again can you explain if you need above feature?

If you looking for simple "explicit lock on object" here is the place to look for:



Re: What DBMS_LOCK?

From
Simon Riggs
Date:
On 27 February 2014 13:13, Saret Sout <saretsout@gmail.com> wrote:
> Dear Community!
>
> Do you know about DBMS_LOCK on oracle? What is the main purpose of it?
> How about postgresql ?Does postgresql has DBMS_LOCK? If it doesn't have how
> can we implement like DBMS_LOCK in oracle? Please help me to explain this
> issue. Thank

You probably want to look at Advisory Locks
http://www.postgresql.org/docs/devel/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: What DBMS_LOCK?

From
Thomas Kellerer
Date:
Saret Sout, 27.02.2014 14:13:
> Do you know about DBMS_LOCK on oracle? What is the main purpose of it?
> How about postgresql ?Does postgresql has DBMS_LOCK?
> If it doesn't have how can we implement like DBMS_LOCK in oracle?

I think the closest thing to DBMS_LOCK in Postgres are advisory locks:

http://www.postgresql.org/docs/current/static/explicit-locking.html#ADVISORY-LOCKS


Thomas