Обсуждение: error when defining a search configuration named "default"

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

error when defining a search configuration named "default"

От
robert rottermann
Дата:
Hi there,
I inherited the support of a database with the ancient tsearch2.

I uses a search configuration named "default"

Now when I try to create such a configuration using:
CREATE TEXT SEARCH CONFIGURATION default (
   PARSER = "default"
);

I get an error:
postgres=# CREATE TEXT SEARCH CONFIGURATION default (
postgres(#   PARSER = "default"
postgres(# );
ERROR:  syntax error at or near "default"
LINE 1: CREATE TEXT SEARCH CONFIGURATION default (
                                                                             ^

how can I create such an configuration?

thanks
robert


Re: error when defining a search configuration named "default"

От
Szymon Guz
Дата:


On 25 November 2011 14:34, robert rottermann <robert@redcor.ch> wrote:
Hi there,
I inherited the support of a database with the ancient tsearch2.

I uses a search configuration named "default"

Now when I try to create such a configuration using:
CREATE TEXT SEARCH CONFIGURATION default (
 PARSER = "default"
);

I get an error:
postgres=# CREATE TEXT SEARCH CONFIGURATION default (
postgres(#   PARSER = "default"
postgres(# );
ERROR:  syntax error at or near "default"
LINE 1: CREATE TEXT SEARCH CONFIGURATION default (
                                                                           ^

how can I create such an configuration?

thanks
robert



Hi,
maybe try using ' instead of " ? Something like this:: 

CREATE TEXT SEARCH CONFIGURATION default (
 PARSER = 'default'
);


regards
Szymon

Re: error when defining a search configuration named "default"

От
Tom Lane
Дата:
robert rottermann <robert@redcor.ch> writes:
> Now when I try to create such a configuration using:
> CREATE TEXT SEARCH CONFIGURATION default (

DEFAULT is a fully reserved word.  If you insist on naming your
configuration (or any other kind of SQL object) that, you'll need
to double-quote the name ... not only here in the creation command,
but in every subsequent use of the name.  Personally I'd choose
a different name.

            regards, tom lane