"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