Re: [SQL] Transaction in plpgslq

2005-05-24 Thread Jan B.
Rafa Couto wrote: 2005/5/20, Andrew Hammond <[EMAIL PROTECTED]>: The solution to your problem is locking (or concurrency control if you prefer). While we're at it, we might as well optimize your statement a little too using ORDER BY with LIMIT instead of min(). SELECT id INTO _contacto_id FRO

Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

2005-05-23 Thread Jan B.
Markus Bertheau wrote: Hi, why does SELECT ARRAY(SELECT 1 WHERE FALSE) return NULL instead of ARRAY[] resp. '{}'? Markus Perhaps Arrays always have to contain at least one element? (I don't know for sure.) SELECT array[]; ERROR: syntax error at or near "]" at character 14 LINE 1: SELECT

[SQL] Calling Functions in RULEs

2005-05-22 Thread Jan B.
Hello, I would like to call multiple PL/pgSQL procedures (i.e. functions returning void) from INSERT, UPDATE and DELETE RULEs. Using "SELECT some_procedure();" is a possible way to do that, but it causes a dummy result table to be delivered to the application invoking the INSERT/UPDATE/DELET