codekingpro/portable-devtools
114k
1/* contrib/hstore/hstore--1.3--1.4.sql */2 3-- complain if script is sourced in psql, rather than via ALTER EXTENSION4\echo Use "ALTER EXTENSION hstore UPDATE TO '1.4'" to load this file. \quit5 6-- Update procedure signatures the hard way.7-- We use to_regprocedure() so that query doesn't fail if run against 9.6beta1 definitions,8-- wherein the signatures have been updated already. In that case to_regprocedure() will9-- return NULL and no updates will happen.10DO LANGUAGE plpgsql11$$12DECLARE13 my_schema pg_catalog.text := pg_catalog.quote_ident(pg_catalog.current_schema());14 old_path pg_catalog.text := pg_catalog.current_setting('search_path');15BEGIN16-- for safety, transiently set search_path to just pg_catalog+pg_temp17PERFORM pg_catalog.set_config('search_path', 'pg_catalog, pg_temp', true);18 19UPDATE pg_catalog.pg_proc SET20 proargtypes = pg_catalog.array_to_string(newtypes::pg_catalog.oid[], ' ')::pg_catalog.oidvector,21 pronargs = pg_catalog.array_length(newtypes, 1)22FROM (VALUES23(NULL::pg_catalog.text, NULL::pg_catalog.text[]), -- establish column types24('ghstore_same(internal,internal,internal)', '{SCH.ghstore,SCH.ghstore,internal}'),25('ghstore_consistent(internal,internal,int4,oid,internal)', '{internal,SCH.hstore,int2,oid,internal}'),26('gin_extract_hstore(internal,internal)', '{SCH.hstore,internal}'),27('gin_extract_hstore_query(internal,internal,int2,internal,internal)', '{SCH.hstore,internal,int2,internal,internal}'),28('gin_consistent_hstore(internal,int2,internal,int4,internal,internal)', '{internal,int2,SCH.hstore,int4,internal,internal}')29) AS update_data (oldproc, newtypestext),30LATERAL (31 SELECT array_agg(replace(typ, 'SCH', my_schema)::regtype) as newtypes FROM unnest(newtypestext) typ32) ls33WHERE oid = to_regprocedure(my_schema || '.' || replace(oldproc, 'SCH', my_schema));34 35UPDATE pg_catalog.pg_proc SET36 prorettype = (my_schema || '.ghstore')::pg_catalog.regtype37WHERE oid = pg_catalog.to_regprocedure((my_schema || '.ghstore_union(internal,internal)'));38 39PERFORM pg_catalog.set_config('search_path', old_path, true);40END41$$;42 43ALTER FUNCTION hstore_in(cstring) PARALLEL SAFE;44ALTER FUNCTION hstore_out(hstore) PARALLEL SAFE;45ALTER FUNCTION hstore_recv(internal) PARALLEL SAFE;46ALTER FUNCTION hstore_send(hstore) PARALLEL SAFE;47ALTER FUNCTION hstore_version_diag(hstore) PARALLEL SAFE;48ALTER FUNCTION fetchval(hstore, text) PARALLEL SAFE;49ALTER FUNCTION slice_array(hstore, text[]) PARALLEL SAFE;50ALTER FUNCTION slice(hstore, text[]) PARALLEL SAFE;51ALTER FUNCTION isexists(hstore, text) PARALLEL SAFE;52ALTER FUNCTION exist(hstore, text) PARALLEL SAFE;53ALTER FUNCTION exists_any(hstore, text[]) PARALLEL SAFE;54ALTER FUNCTION exists_all(hstore, text[]) PARALLEL SAFE;55ALTER FUNCTION isdefined(hstore, text) PARALLEL SAFE;56ALTER FUNCTION defined(hstore, text) PARALLEL SAFE;57ALTER FUNCTION delete(hstore, text) PARALLEL SAFE;58ALTER FUNCTION delete(hstore, text[]) PARALLEL SAFE;59ALTER FUNCTION delete(hstore, hstore) PARALLEL SAFE;60ALTER FUNCTION hs_concat(hstore, hstore) PARALLEL SAFE;61ALTER FUNCTION hs_contains(hstore, hstore) PARALLEL SAFE;62ALTER FUNCTION hs_contained(hstore, hstore) PARALLEL SAFE;63ALTER FUNCTION tconvert(text, text) PARALLEL SAFE;64ALTER FUNCTION hstore(text, text) PARALLEL SAFE;65ALTER FUNCTION hstore(text[], text[]) PARALLEL SAFE;66ALTER FUNCTION hstore(text[]) PARALLEL SAFE;67ALTER FUNCTION hstore_to_json(hstore) PARALLEL SAFE;68ALTER FUNCTION hstore_to_json_loose(hstore) PARALLEL SAFE;69ALTER FUNCTION hstore_to_jsonb(hstore) PARALLEL SAFE;70ALTER FUNCTION hstore_to_jsonb_loose(hstore) PARALLEL SAFE;71ALTER FUNCTION hstore(record) PARALLEL SAFE;72ALTER FUNCTION hstore_to_array(hstore) PARALLEL SAFE;73ALTER FUNCTION hstore_to_matrix(hstore) PARALLEL SAFE;74ALTER FUNCTION akeys(hstore) PARALLEL SAFE;75ALTER FUNCTION avals(hstore) PARALLEL SAFE;76ALTER FUNCTION skeys(hstore) PARALLEL SAFE;77ALTER FUNCTION svals(hstore) PARALLEL SAFE;78ALTER FUNCTION each(hstore) PARALLEL SAFE;79ALTER FUNCTION populate_record(anyelement, hstore) PARALLEL SAFE;80ALTER FUNCTION hstore_eq(hstore, hstore) PARALLEL SAFE;81ALTER FUNCTION hstore_ne(hstore, hstore) PARALLEL SAFE;82ALTER FUNCTION hstore_gt(hstore, hstore) PARALLEL SAFE;83ALTER FUNCTION hstore_ge(hstore, hstore) PARALLEL SAFE;84ALTER FUNCTION hstore_lt(hstore, hstore) PARALLEL SAFE;85ALTER FUNCTION hstore_le(hstore, hstore) PARALLEL SAFE;86ALTER FUNCTION hstore_cmp(hstore, hstore) PARALLEL SAFE;87ALTER FUNCTION hstore_hash(hstore) PARALLEL SAFE;88ALTER FUNCTION ghstore_in(cstring) PARALLEL SAFE;89ALTER FUNCTION ghstore_out(ghstore) PARALLEL SAFE;90ALTER FUNCTION ghstore_compress(internal) PARALLEL SAFE;91ALTER FUNCTION ghstore_decompress(internal) PARALLEL SAFE;92ALTER FUNCTION ghstore_penalty(internal, internal, internal) PARALLEL SAFE;93ALTER FUNCTION ghstore_picksplit(internal, internal) PARALLEL SAFE;94ALTER FUNCTION ghstore_union(internal, internal) PARALLEL SAFE;95ALTER FUNCTION ghstore_same(ghstore, ghstore, internal) PARALLEL SAFE;96ALTER FUNCTION ghstore_consistent(internal, hstore, smallint, oid, internal) PARALLEL SAFE;97ALTER FUNCTION gin_extract_hstore(hstore, internal) PARALLEL SAFE;98ALTER FUNCTION gin_extract_hstore_query(hstore, internal, int2, internal, internal) PARALLEL SAFE;99ALTER FUNCTION gin_consistent_hstore(internal, int2, hstore, int4, internal, internal) PARALLEL SAFE;100 