Re: [BUGS] Double sequence increase on single insert with RULE on targeted table

2005-11-16 Thread Michael Fuhr
On Wed, Nov 16, 2005 at 10:31:10AM +0200, Sarunas Krisciukaitis wrote: > I understand that RULES are like macros. > Strangest thing here is that INSERT to test1 will touch only one > sequence: test1_id_seq. > And it increments test1_id_seq twice during insert with RULE. Yes, that's a well-known e

Re: [BUGS] Assigning null to an array element in plpgsql

2005-11-16 Thread Tom Lane
Eugene Chow <[EMAIL PROTECTED]> writes: > I believe this is a bug. The following function returns 'foo' instead > of null: NULLs in arrays aren't supported; the system interprets an attempt to store a NULL into an array element as a no-op. Perhaps it should have raised an error instead, but it'

Re: [BUGS] Double sequence increase on single insert with RULE on

2005-11-16 Thread Sarunas Krisciukaitis
I understand that RULES are like macros. Strangest thing here is that INSERT to test1 will touch only one sequence: test1_id_seq. And it increments test1_id_seq twice during insert with RULE. Then all sequence procedures like lastval() and currval() will return number (as stated in report), wh

[BUGS] Assigning null to an array element in plpgsql

2005-11-16 Thread Eugene Chow
Hi all, I believe this is a bug. The following function returns 'foo' instead of null: --- create or replace function test() returns varchar as ' declare s varchar[] := ''{}''; begin s[1] := ''foo''; s[1] := null; return s[1]; end; ' l