3 ms·
The only thing is you need to be careful about where the contract is. There's a huge difference between an application executing a sql statement: SELECT *
by einhverfr 13y ago
The only thing is you need to be careful about where the contract is.
There's a huge difference between an application executing a sql statement:
SELECT * FROM accounts;
and a UDF like:
CREATE OR REPLACE FUNCTION accounts__list_all()
RETURNS SETOF accounts
LANGUAGE SQL AS
$$
SELECT * FROM accounts ORDER BY account_no;
$$;
In the latter case the select * reduces maintenance points in your db because you have already tied the return type to the table type, so either you get to use the * or list all columns manually and the latter, given the requirement to list all every time, makes any schema changes incompatible with your API.