[SQL] reliable lock inside stored procedure

2008-11-03 Thread Sebastian Böhm
Hi, I have a stored procedure and I need a SHARE ROW EXCLUSIVE lock in this procedure (otherwise data will get corrupted). According to the documentation the LOCK statement is useless and will silently fail if not executed inside a transaction. (btw: this sounds dangerous to me) Also

Re: [SQL] reliable lock inside stored procedure

2008-11-03 Thread Richard Huxton
Sebastian Böhm wrote: Hi, I have a stored procedure and I need a SHARE ROW EXCLUSIVE lock in this procedure (otherwise data will get corrupted). OK. PostgreSQL doesn't have stored procedures so I guess you're talking about a function. According to the documentation the LOCK statement is

Re: [SQL] reliable lock inside stored procedure (SOLVED)

2008-11-03 Thread Sebastian Böhm
Hi Richard, thank you for your answer! Am 03.11.2008 um 12:06 schrieb Richard Huxton: Sebastian Böhm wrote: Hi, I have a stored procedure and I need a SHARE ROW EXCLUSIVE lock in this procedure (otherwise data will get corrupted). OK. PostgreSQL doesn't have stored procedures so I

Re: [SQL] Date Index

2008-11-03 Thread Ryan Hansen
Incidentally, extract(date from ts) doesn't work on my install of 8.3 (standard Ubuntu Hardy apt install). I get a timestamp units date not recognized error when I try it. The field I'm trying to create it on is timestamp without time zone. -Original Message- From: [EMAIL PROTECTED]

Re: [SQL] Date Index

2008-11-03 Thread Tom Lane
Ryan Hansen [EMAIL PROTECTED] writes: Incidentally, extract(date from ts) doesn't work on my install of 8.3 The field names recognized by extract() are quite well documented http://www.postgresql.org/docs/8.3/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT and date isn't one of them.