Обсуждение: create operator class problem

Поиск
Список
Период
Сортировка

create operator class problem

От
Ron Peterson
Дата:
I wanted to play with ltree, but I'm having trouble running ltree.sql.
Everything in ltree.sql seems to work, except for the CREATE OPERATOR
CLASS statements, which error out like:

ERROR:  syntax error at or near "OPERATOR10"
LINE 3: OPERATOR10<@ (_ltree, ltree)RECHECK ,

...which is generated from:

CREATE OPERATOR CLASS gist__ltree_ops
    DEFAULT FOR TYPE _ltree USING gist AS
    OPERATOR    10  <@ (_ltree, ltree)  RECHECK ,
    OPERATOR    11  @> (ltree, _ltree)  RECHECK ,
    OPERATOR    12  ~ (_ltree, lquery)  RECHECK ,
    OPERATOR    13  ~ (lquery, _ltree)  RECHECK ,
    OPERATOR    14  @ (_ltree, ltxtquery)   RECHECK ,
    OPERATOR    15  @ (ltxtquery, _ltree)   RECHECK ,
    OPERATOR    16  ? (_ltree, _lquery) RECHECK ,
    OPERATOR    17  ? (_lquery, _ltree) RECHECK ,
    FUNCTION    1   _ltree_consistent (internal, internal, int2),
    FUNCTION    2   _ltree_union (internal, internal),
    FUNCTION    3   _ltree_compress (internal),
    FUNCTION    4   ltree_decompress (internal),
    FUNCTION    5   _ltree_penalty (internal, internal, internal),
    FUNCTION    6   _ltree_picksplit (internal, internal),
    FUNCTION    7   _ltree_same (internal, internal, internal),
    STORAGE     ltree_gist;

I'm running PostgreSQL 8.2.1.

I also gave the 'seg' contrib module a whirl, and it also errors out on
the CREATE OPERATOR CLASS statement.

--
Ron Peterson
https://www.yellowbank.com/

Re: create operator class problem

От
Tom Lane
Дата:
Ron Peterson <ron.peterson@yellowbank.com> writes:
> I wanted to play with ltree, but I'm having trouble running ltree.sql.
> Everything in ltree.sql seems to work, except for the CREATE OPERATOR
> CLASS statements, which error out like:

> ERROR:  syntax error at or near "OPERATOR10"
> LINE 3: OPERATOR10<@ (_ltree, ltree)RECHECK ,

Looks like something removed the tabs in that line?

            regards, tom lane

Re: create operator class problem

От
Ron Peterson
Дата:
On Tue, Feb 06, 2007 at 10:45:23AM -0500, Tom Lane wrote:
> Ron Peterson <ron.peterson@yellowbank.com> writes:
> > I wanted to play with ltree, but I'm having trouble running ltree.sql.
> > Everything in ltree.sql seems to work, except for the CREATE OPERATOR
> > CLASS statements, which error out like:
>
> > ERROR:  syntax error at or near "OPERATOR10"
> > LINE 3: OPERATOR10<@ (_ltree, ltree)RECHECK ,
>
> Looks like something removed the tabs in that line?

Ah, yep.  For some reason the emacs 'sql-send-region' command in
sql-postgres mode is munging that line.  If I just read the file
directly everything is fine.  Thanks.

--
Ron Peterson
https://www.yellowbank.com/