From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Teodor Sigaev <teodor(at)sigaev(dot)ru> |
Cc: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | A couple of tsearch loose ends |
Date: | 2007-08-21 16:52:24 |
Message-ID: | 4242.1187715144@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
There are a couple of naming issues that I left untouched while
reviewing the tsearch patch, but wanted to bring up for discussion.
One thing that had me confused for awhile is that the patch uses
the word "template" in two different ways. The main use is that a
"template" is an object encapsulating the superuser-only aspects of
defining a dictionary. When you do CREATE TEXT SEARCH DICTIONARY
you have to specify a template to base it on. So in this context
a dictionary and its template are different kinds of objects, and
there's a persistent connection between them.
On the other hand, CREATE TEXT SEARCH CONFIGURATION also uses the
word "template", but in this case it's an optional specification
of an existing configuration that gets copied. So here, the config
and the template are the same kind of object, and there's no
connection between them after the copy is made.
This seems a bit confusing, and I wonder whether we ought not
change the terminology for one thing or the other. I don't
particularly want to rename text search templates ... that would
be quite a bit of work at this point ... so what I'd suggest is
that the option to CREATE TEXT SEARCH CONFIGURATION be renamed
"COPY" instead of "TEMPLATE". Another thought here is that I'm
inclined to drop the "with map" option and just always copy the
source configuration exactly. If you don't want the map, the
only other information the source can provide is a parser name,
which you might as well just give directly.
The other thing that was bugging me was that a lot of the dictionary
types have init options that are named things like DictFile, AffFile,
etc. As I mentioned before, I dislike the fact that these things are
out in the filesystem rather than inside the database, and hope that
that will change eventually. So I think that these names are not
future-proof and should be altered to not use the word "file";
especially so in view of the fact that as committed, the patch doesn't
let you specify a path name for them. I already did that to StopFile,
which is now StopWords, but did not touch the other dictionary options.
I'm not sure what to do with DictFile, because that doesn't seem to have
any special meaning at all once you take out "file" ...
Comments?
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-08-21 17:03:06 | Re: tsearch2 patch status report |
Previous Message | Heikki Linnakangas | 2007-08-21 16:32:37 | Re: tsearch2 patch status report |