Re: [BUGS] Bug in plpgsql, when using NEW with composite field value.

2008-12-10 Thread Tom Lane
"Oleg Serov" <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE FUNCTION "bug_with_triggers" () RETURNS trigger AS > $body$ > BEGIN > PERFORM COALESCE(NEW.some_composite_field.field, TRUE); > END; > $body$ > LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; > Error: > ERROR: N

Re: [BUGS] Bug in plpgsql, when using NEW with composite field value.

2008-12-10 Thread Pavel Stehule
Hello you have to use parenthesis, because parser don't distinguish between variants schema.table.column and variable.field.attrib example: postgres=# create or replace function trgbody() returns trigger as $$ begin raise notice '%', (new.a).a; return new; end $$ language plpgsql; CREATE FUN

[BUGS] Bug in plpgsql, when using NEW with composite field value.

2008-12-10 Thread Oleg Serov
SQL: CREATE OR REPLACE FUNCTION "bug_with_triggers" () RETURNS trigger AS $body$ BEGIN PERFORM COALESCE(NEW.some_composite_field.field, TRUE); END; $body$ LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; Error: ERROR: NEW used in query that is not in a rule QUERY: SEL

Re: [BUGS] bug in (plpgsql) parser?

2001-06-04 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > My question is whether you think "--" _inside_ quotes should be a > comment. I don't think it should be. It should be if plpgsql thinks it is. But that's not the problem here. Doubling the quote marks would help... regards, tom

[BUGS] bug in (plpgsql) parser?

2001-06-04 Thread Reinoud van Leeuwen
Hello world, I am using "PostgreSQL 7.1.2 on i386-unknown-freebsd4.2, compiled by GCC 2.95.2" (according to version()). I suspect that there is a parser bug in the handling of '--' comments: radius=# create function test() returns integer as ' radius'# begin radius'# -- comment without quote

RE: [BUGS] bug in plpgsql???

2001-05-24 Thread Alexander Zagrebin
Hi! > "Alexander Zagrebin" <[EMAIL PROTECTED]> writes: > > But if "rec" is declared as "hierarchy%ROWTYPE", then > > execution fails with such log messages: > > I can't duplicate this in current sources. Please try 7.1.2. > > regards, tom lane Thanks! At 7.1.2 that proc

Re: [BUGS] bug in plpgsql???

2001-05-23 Thread Tom Lane
"Alexander Zagrebin" <[EMAIL PROTECTED]> writes: > But if "rec" is declared as "hierarchy%ROWTYPE", then > execution fails with such log messages: I can't duplicate this in current sources. Please try 7.1.2. regards, tom lane ---(end of broadcast

[BUGS] bug in plpgsql???

2001-05-22 Thread Alexander Zagrebin
Hi! I try to work with trees in Postgres 7.1.1 My test script is CREATE TABLE hierarchy parent INTEGER, child INTEGER ); INSERT INTO hierarchy VALUES (1, 2); INSERT INTO hierarchy VALUES (2, 4); INSERT INTO

[BUGS] Bug in plpgsql with execute ...

2001-05-11 Thread Albert
Hi, i think i found a bug in the pgsql interpreter. Platform is Linux-2.4.0 on Intel, Postgres-Version is 7.1.1 . The Problem: I want to use a table name in a select statement within a function, where the table name comes in as argument. It only works, if at all, inside an execute statement. Wh

[BUGS] bug in PLPGSQL

2001-03-28 Thread Andriy I Pilipenko
Your name : Andriy I Pilipenko Your email address : [EMAIL PROTECTED] System Configuration - Architecture (example: Intel Pentium) : Intel Pentium Operating System (example: Linux 2.0.26 ELF) : FreeBSD-4.2-STABLE PostgreSQL ve