Skip site navigation (1) Skip section navigation (2)

BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation

From: "Arthur Nascimento" <tureba(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation
Date: 2011-03-23 19:09:19
Message-ID: 201103231909.p2NJ9JEc052156@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5942
Logged by:          Arthur Nascimento
Email address:      tureba(at)gmail(dot)com
PostgreSQL version: 9.0.3
Operating system:   Linux
Description:        pg_trgm.sql has cyclic dependency on type gtrgm creation
Details: 

When creating the gtrgm type, it depends on gtrgm_{in,out}. These functions
also depend on the type, so there is a cyclic dependency on creation of the
type.

The command psql -f sharedir/contrib/pg_trgm.sql crashes for me accusing
this error.

According to the CREATE TYPE documentation, this can be solved by adding a
"CREATE TYPE gtrgm;" line before the functions are defined. This solution
worked locally for me by including that command between lines 40 and 41 of
the file.

A snippet of the offending code of contrib/pg_trgm.sql, lines 40 to 55:
-- gist key
CREATE OR REPLACE FUNCTION gtrgm_in(cstring)
RETURNS gtrgm
AS '$libdir/pg_trgm'
LANGUAGE C STRICT;

CREATE OR REPLACE FUNCTION gtrgm_out(gtrgm)
RETURNS cstring
AS '$libdir/pg_trgm'
LANGUAGE C STRICT;

CREATE TYPE gtrgm (
        INTERNALLENGTH = -1,
        INPUT = gtrgm_in,
        OUTPUT = gtrgm_out
);

Responses

pgsql-bugs by date

Next:From: Susanne EbrechtDate: 2011-03-23 19:33:44
Subject: Re: TO_CHAR(timestamptz,datetimeformat) wrong after DST change
Previous:From: Merlin MoncureDate: 2011-03-23 13:54:09
Subject: Re: Index Ignored Due To Use Of View

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group