Revision 12563
Added by Aaron Marcuse-Kubitza almost 11 years ago
util.sql | ||
---|---|---|
2076 | 2076 |
SELECT util.eval($$ |
2077 | 2077 |
CREATE OR REPLACE FUNCTION $$||util.schema($1)||$$.keys(value $$ |
2078 | 2078 |
||util.qual_name($1)||util.mk_out_params($2)||$$) |
2079 |
RETURNS record AS |
|
2079 |
RETURNS $$||util._if(util.array_length($2) = 1, $2[1].type::text, $$record$$) |
|
2080 |
||$$ AS |
|
2080 | 2081 |
$BODY1$ |
2081 |
SELECT ROW($$||
|
|
2082 |
SELECT $$|| util._if(util.array_length($2) = 1, ''::text, $$ROW$$) ||$$($$||
|
|
2082 | 2083 |
(SELECT COALESCE(string_agg($$$1.$$||(unnest).col_name, ', '), '') |
2083 | 2084 |
FROM unnest($2)) ||$$) |
2084 | 2085 |
$BODY1$ |
Also available in: Unified diff
bugfix: schemas/util.sql: mk_keys_func(regtype, util.col_cast[]): need to handle 1-column records specially, because Postgres does not allow returning a 1-column record when there are OUT params