Re: Strange behavior with missing column in SQL function

2018-07-31 Thread Marcelo Lacerda
> CREATE OR REPLACE FUNCTION myfunction(myrow mytable) > RETURNS INTEGER AS $$ > SELECT myrow.c + myrow.b FROM myrow; > $$ LANGUAGE sql; > where "myrow" is a table with a different set of column names from > "mytable". The existing behavior for that is to seek the column name > in "myrow" (th

Re: Strange behavior with missing column in SQL function

2018-07-31 Thread Tom Lane
Marcelo Lacerda writes: > Here's the code that reproduces the behavior: > http://paste.debian.net/1035412/ For the archives' sake, the issue of concern here is what error message to throw for CREATE OR REPLACE FUNCTION myfunction(myrow mytable) RETURNS INTEGER AS $$ SELECT myrow.c + myrow.b;

Strange behavior with missing column in SQL function

2018-07-30 Thread Marcelo Lacerda
Here's the code that reproduces the behavior: http://paste.debian.net/1035412/ I have already discussed this in the IRC channel but there doesn't seem to be a consensus on whether this is a bug here's a brief transcript of RhodiumToad's opinion: > this isn't new, goes back to 9.1 at least > basic