Project

General

Profile

« Previous | Next » 

Revision 12567

bugfix: schemas/util.sql: mk_keys_func(regtype, util.col_cast[]): use util.create_if_not_exists() to avoid trying to overwrite a custom keys() function the user has written

View differences:

trunk/schemas/util.sql
2088 2088
CREATE FUNCTION mk_keys_func(type regtype, cols col_cast[]) RETURNS void
2089 2089
    LANGUAGE sql IMMUTABLE
2090 2090
    AS $_$
2091
SELECT util.eval($$
2091
SELECT util.create_if_not_exists($$
2092 2092
CREATE OR REPLACE FUNCTION $$||util.schema($1)||$$.keys(value $$
2093 2093
||util.qual_name($1)||util.mk_out_params($2)||$$)
2094 2094
  RETURNS $$||util._if(util.array_length($2) = 1, $2[1].type::text, $$record$$)

Also available in: Unified diff