Created
October 23, 2012 20:15
-
-
Save samv/3941248 to your computer and use it in GitHub Desktop.
functions and columns are equivalent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svilain=# create table f (foo int); | |
CREATE TABLE | |
svilain=# create or replace function bar(f) returns int language sql as $$ select $1.foo + 10 $$; | |
CREATE FUNCTION | |
svilain=# insert into f values (1), (2); | |
INSERT 0 2 | |
svilain=# select f.foo, f.bar from f; | |
foo | bar | |
-----+----- | |
1 | 11 | |
2 | 12 | |
(2 rows) | |
svilain=# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment