Can we Lock Table??

Moderator: NorbertKrupa

Post Reply
rajasekhart
Intermediate
Intermediate
Posts: 87
Joined: Wed Apr 25, 2012 8:10 am

Can we Lock Table??

Post by rajasekhart » Fri May 17, 2013 2:29 pm

HI,

Can a user lock a table in vertica?

As Oracle having the syntax as follows
Lock table <Table_Name> Exclusive Mode ;

Do Vertica have this kind of facility??

Thanks,
Raj!!
Rajasekhar.T|HP ATP Vertica Big Data Solutions V1

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Can we Lock Table??

Post by JimKnicely » Fri May 17, 2013 3:57 pm

Hi,

You can use the LOCK TABLE <<table_name>>; command to lock a table in Vertica.

This will issue a "X" exclusive lock on table. You can check this in the LOCKS system table.
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: Can we Lock Table??

Post by scutter » Sun May 19, 2013 2:55 pm

The LOCK TABLE statement isn't in the documentation. Personally I wouldn't rely on anything that isn't documented.

You can get an X lock in a supported way using SELECT … FOR UPDATE.
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Can we Lock Table??

Post by JimKnicely » Mon May 20, 2013 2:09 pm

C'mon! Live a little. Using an undocumented feature is certainly more exciting than boring documented features :lol: Just kidding. I think Vertica included the LOCK TABLE command to be compatible with Oracle.
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “Vertica Database Development”