Skip to content

Commit

Permalink
Fix issue ASKBOT#845
Browse files Browse the repository at this point in the history
* ASKBOT#845
* setup_aggregates() used to conditionally
        DROP AGGREGATE concat_tsvectors(tsvector);
  - the condition SELECTs a field from an internal table that
    was removed in Postgresql 11, consequently the function
    definition, therefore the script, therefore the django
    migration fails
  - the problematic code section is a custom implementation of
    DROP AGGREGATE IF EXISTS
  - DROP AGGREGATE IF EXSITS has been supported (at least) since
    Postgres 8.2.23, released 2006
  => replaced custom implementation with DROP AGGREGATE IF EXISTS
* this patch removes the reference to the changed internal Postgresql
  table and therefore the issue which makes the script fail using
  Postgresql 11
  • Loading branch information
martin-bts committed Nov 16, 2019
1 parent 5535ec9 commit 8c3739e
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,8 @@ $$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION setup_aggregates() RETURNS boolean AS
$$
DECLARE
onerow record;
BEGIN
FOR onerow IN SELECT * FROM pg_proc WHERE proname = 'concat_tsvectors' AND proisagg LOOP
DROP AGGREGATE concat_tsvectors(tsvector);
END LOOP;
DROP AGGREGATE IF EXISTS concat_tsvectors(tsvector);
CREATE AGGREGATE concat_tsvectors (
BASETYPE = tsvector,
SFUNC = tsv_add,
Expand Down

0 comments on commit 8c3739e

Please sign in to comment.