pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation
2+ messages / 2 participants
[nested] [flat]
* BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation
@ 2011-03-23 19:09 Arthur Nascimento <tureba@gmail.com>
2011-03-23 22:47 ` Re: BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Arthur Nascimento @ 2011-03-23 19:09 UTC (permalink / raw)
To: pgsql-bugs
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
);
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation
2011-03-23 19:09 BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation Arthur Nascimento <tureba@gmail.com>
@ 2011-03-23 22:47 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2011-03-23 22:47 UTC (permalink / raw)
To: Arthur Nascimento <tureba@gmail.com>; +Cc: pgsql-bugs
"Arthur Nascimento" <tureba@gmail.com> writes:
> 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.
Crashes how? That script works fine for everybody else. You might get
some notices but not a crash.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-03-23 22:47 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-03-23 19:09 BUG #5942: pg_trgm.sql has cyclic dependency on type gtrgm creation Arthur Nascimento <tureba@gmail.com>
2011-03-23 22:47 ` Tom Lane <tgl@sss.pgh.pa.us>
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