Re: [GENERAL] a query on stored procedures/functions in pgsql

2010-10-21 Thread Adrian Klaver
On Wednesday 20 October 2010 9:48:39 pm Neil D'Souza wrote: > > You have same plpgsql identifiers as sql identifiers, and because > > plpgsql identifiers has higher priority, your query is broken. For > > simple functions like this don't use a plpgsql language - use sql > > language instead. > > Th

Re: [GENERAL] a query on stored procedures/functions in pgsql

2010-10-20 Thread Tom Lane
"Neil D'Souza" writes: > Thank you for the quick reply. The example I constructed was > specifically for this post. I modified the function as below and it > works fine now. It would be great if the point you mentioned was a > note in the PGSQL Documentation (or did I miss it). As of 9.0, plpgsql

Re: [GENERAL] a query on stored procedures/functions in pgsql

2010-10-20 Thread Pavel Stehule
Hello 2010/10/21 Neil D'Souza : >> >> You have same plpgsql identifiers as sql identifiers, and because >> plpgsql identifiers has higher priority, your query is broken. For >> simple functions like this don't use a plpgsql language - use sql >> language instead. >> > > Thank you for the quick rep

Re: [GENERAL] a query on stored procedures/functions in pgsql

2010-10-20 Thread Neil D'Souza
> > You have same plpgsql identifiers as sql identifiers, and because > plpgsql identifiers has higher priority, your query is broken. For > simple functions like this don't use a plpgsql language - use sql > language instead. > Thank you for the quick reply. The example I constructed was specific

Re: [GENERAL] a query on stored procedures/functions in pgsql

2010-10-20 Thread Pavel Stehule
Hello 2010/10/21 Neil D'Souza : > consider the following sql statements: > > create table food( >     food_code serial unique, >     food_category varchar(20), >     food_name varchar(20) >     ); > > insert into food (food_category, food_name) values ('fruit', 'tomato'); > insert into food (foo

[GENERAL] a query on stored procedures/functions in pgsql

2010-10-20 Thread Neil D'Souza
consider the following sql statements: create table food(     food_code serial unique,     food_category varchar(20),     food_name varchar(20)     ); insert into food (food_category, food_name) values ('fruit', 'tomato'); insert into food (food_category, food_name) values ('fruit', 'banana'); in