pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arthur Nascimento <tureba@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation
Date: Wed, 23 Mar 2011 19:09:19 GMT
Message-ID: <201103231909.p2NJ9JEc052156@wwwmaster.postgresql.org> (raw)


The following bug has been logged online:

Bug reference:      5942
Logged by:          Arthur Nascimento
Email address:      tureba@gmail.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
);



view thread (2+ messages)  latest in thread

Message-ID: <201103231909.p2NJ9JEc052156@wwwmaster.postgresql.org>
Permalink:  ../201103231909.p2NJ9JEc052156@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201103231909.p2NJ9JEc052156@wwwmaster.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tureba@gmail.com
  Subject: Re: BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation
  In-Reply-To: <201103231909.p2NJ9JEc052156@wwwmaster.postgresql.org>
  References: <201103231909.p2NJ9JEc052156@wwwmaster.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox