By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
INSERT 0 3
CREATE FUNCTION
| res |
|---|
| 1 |
| 2 |
SELECT 2
CREATE FUNCTION
ERROR: column reference "data1" is ambiguous LINE 1: SELECT data1 AS res -- this column alias is just noise (or ... ^ DETAIL: It could refer to either a PL/pgSQL variable or a table column. QUERY: SELECT data1 AS res -- this column alias is just noise (or documentation) FROM table_with_data WHERE data1 < var CONTEXT: PL/pgSQL function test2(integer) line 3 at RETURN QUERY
CREATE FUNCTION
| data1 |
|---|
| 1 |
| 2 |
SELECT 2
CREATE FUNCTION
| res |
|---|
| 1 |
| 2 |
SELECT 2