[HACKERS] Lock table in non-volatile functions

2007-03-16 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I'm observing that is not allowed to LOCK a table in a STABLE/IMMUTABLE function but at same time is allowed a SELECT FOR UPDATE. Is that normal? -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with

Re: [HACKERS] Lock table in non-volatile functions

2007-03-16 Thread Tom Lane
Gaetano Mendola [EMAIL PROTECTED] writes: I'm observing that is not allowed to LOCK a table in a STABLE/IMMUTABLE function but at same time is allowed a SELECT FOR UPDATE. Really? AFAICS, CommandIsReadOnly() will reject SELECT FOR UPDATE too. regards, tom lane

Re: [HACKERS] Lock table in non-volatile functions

2007-03-16 Thread Gaetano Mendola
Tom Lane wrote: Gaetano Mendola [EMAIL PROTECTED] writes: I'm observing that is not allowed to LOCK a table in a STABLE/IMMUTABLE function but at same time is allowed a SELECT FOR UPDATE. Really? AFAICS, CommandIsReadOnly() will reject SELECT FOR UPDATE too. kalman=# select version();

Re: [HACKERS] Lock table in non-volatile functions

2007-03-16 Thread Tom Lane
Gaetano Mendola [EMAIL PROTECTED] writes: Tom Lane wrote: Really? AFAICS, CommandIsReadOnly() will reject SELECT FOR UPDATE too. kalman$# FOR my_port_set IN kalman$# SELECT a kalman$# FROM test kalman$# FOR UPDATE kalman$# LOOP Hm, that's a bug --- SPI_cursor_open is