Debian Codegraph @

contrib/citext/citext--1.2--1.3.sql

raw
1 /* contrib/citext/citext--1.2--1.3.sql */
2
3 -- complain if script is sourced in psql, rather than via ALTER EXTENSION
4 \echo Use "ALTER EXTENSION citext UPDATE TO '1.3'" to load this file. \quit
5
6 -- We have to update aggregates the hard way for lack of ALTER support
7 DO LANGUAGE plpgsql
8 $$
9 DECLARE
10 my_schema pg_catalog.text := pg_catalog.quote_ident(pg_catalog.current_schema());
11 old_path pg_catalog.text := pg_catalog.current_setting('search_path');
12 BEGIN
13 -- for safety, transiently set search_path to just pg_catalog+pg_temp
14 PERFORM pg_catalog.set_config('search_path', 'pg_catalog, pg_temp', true);
15
16 UPDATE pg_aggregate SET aggcombinefn = (my_schema || '.citext_smaller')::regproc
17 WHERE aggfnoid = (my_schema || '.min(' || my_schema || '.citext)')::pg_catalog.regprocedure;
18
19 PERFORM pg_catalog.set_config('search_path', old_path, true);
20 END
21 $$;