Search Postgresql Archives

Re: pgpsql help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Mike G." <mike@xxxxxxxxxxxxxxxx> writes:
> Maybe it is because 'name' is a sql 92/99 non-reserved / key word?

No, it's because of careless choice of plpgsql variable names.

>> declare
>> uri alias for $3;
>> ...
>> insert into uri (articleid,uri,uritype) values (article_id,uri,urit_id);
               ^^^            ^^^                             ^^^

Not being exceedingly bright, plpgsql will attempt to substitute its
variable into all three matches in this command.  Two of those are
of course wrong and lead to syntax errors.

First rule of plpgsql programming: do not use plpgsql variable names
that duplicate any of the SQL-level names (tables, columns, functions,
etc) you intend to use in the function.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux