error when defining a search configuration named "default"

Started by robert rottermannover 14 years ago3 messagesgeneral
Jump to latest
#1robert rottermann
robert@redcor.ch

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

#2Szymon Guz
mabewlun@gmail.com
In reply to: robert rottermann (#1)
Re: error when defining a search configuration named "default"

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: robert rottermann (#1)
Re: error when defining a search configuration named "default"

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