Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d3e36da7
Commit
d3e36da7
authored
Oct 17, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the standard stopword files be sought relative to share_dir, so
that a tsearch2 installation can be relocatable.
parent
4347cc23
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
contrib/tsearch2/Makefile
contrib/tsearch2/Makefile
+2
-3
contrib/tsearch2/stopword.c
contrib/tsearch2/stopword.c
+18
-5
contrib/tsearch2/tsearch.sql.in
contrib/tsearch2/tsearch.sql.in
+2
-2
No files found.
contrib/tsearch2/Makefile
View file @
d3e36da7
# $PostgreSQL: pgsql/contrib/tsearch2/Makefile,v 1.
7 2004/08/20 20:13:09 momjian
Exp $
# $PostgreSQL: pgsql/contrib/tsearch2/Makefile,v 1.
8 2004/10/17 23:09:31 tgl
Exp $
MODULE_big
=
tsearch2
MODULE_big
=
tsearch2
OBJS
=
dict_ex.o dict.o snmap.o stopword.o common.o prs_dcfg.o
\
OBJS
=
dict_ex.o dict.o snmap.o stopword.o common.o prs_dcfg.o
\
...
@@ -39,8 +39,7 @@ $(SUBDIRS:%=%-recursive):
...
@@ -39,8 +39,7 @@ $(SUBDIRS:%=%-recursive):
$(MAKE)
-C
$(
subst
-recursive
,,
$@
)
SUBSYS.o
$(MAKE)
-C
$(
subst
-recursive
,,
$@
)
SUBSYS.o
tsearch2.sql
:
tsearch.sql.in
tsearch2.sql
:
tsearch.sql.in
sed
-e
's,MODULE_PATHNAME,$$libdir/
$(MODULE_big)
,g'
\
sed
-e
's,MODULE_PATHNAME,$$libdir/
$(MODULE_big)
,g'
$<
>
$@
-e
's,DATA_PATH,
$(datadir)
/contrib,g'
$<
>
$@
untsearch2.sql
:
untsearch.sql.in
untsearch2.sql
:
untsearch.sql.in
cp
$<
$@
cp
$<
$@
...
...
contrib/tsearch2/stopword.c
View file @
d3e36da7
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
* stopword library
* stopword library
* Teodor Sigaev <teodor@sigaev.ru>
* Teodor Sigaev <teodor@sigaev.ru>
*/
*/
#include <errno.h>
#include "postgres.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ctype.h>
#include "postgres.h"
#include "miscadmin.h"
#include "common.h"
#include "common.h"
#include "dict.h"
#include "dict.h"
...
@@ -51,10 +51,23 @@ readstoplist(text *in, StopList * s)
...
@@ -51,10 +51,23 @@ readstoplist(text *in, StopList * s)
if
(
in
&&
VARSIZE
(
in
)
-
VARHDRSZ
>
0
)
if
(
in
&&
VARSIZE
(
in
)
-
VARHDRSZ
>
0
)
{
{
char
*
filename
=
text2char
(
in
);
char
*
filename
=
text2char
(
in
);
FILE
*
hin
=
NULL
;
FILE
*
hin
;
char
buf
[
STOPBUFLEN
];
char
buf
[
STOPBUFLEN
];
int
reallen
=
0
;
int
reallen
=
0
;
/* if path is relative, take it as relative to share dir */
if
(
!
is_absolute_path
(
filename
))
{
char
sharepath
[
MAXPGPATH
];
char
*
absfn
;
get_share_path
(
my_exec_path
,
sharepath
);
absfn
=
palloc
(
strlen
(
sharepath
)
+
strlen
(
filename
)
+
2
);
sprintf
(
absfn
,
"%s/%s"
,
sharepath
,
filename
);
pfree
(
filename
);
filename
=
absfn
;
}
if
((
hin
=
fopen
(
filename
,
"r"
))
==
NULL
)
if
((
hin
=
fopen
(
filename
,
"r"
))
==
NULL
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
...
...
contrib/tsearch2/tsearch.sql.in
View file @
d3e36da7
...
@@ -77,7 +77,7 @@ CREATE FUNCTION snb_lexize(internal,internal,int4)
...
@@ -77,7 +77,7 @@ CREATE FUNCTION snb_lexize(internal,internal,int4)
insert into pg_ts_dict select
insert into pg_ts_dict select
'en_stem',
'en_stem',
'snb_en_init(text)',
'snb_en_init(text)',
'
DATA_PATH
/english.stop',
'
contrib
/english.stop',
'snb_lexize(internal,internal,int4)',
'snb_lexize(internal,internal,int4)',
'English Stemmer. Snowball.'
'English Stemmer. Snowball.'
;
;
...
@@ -90,7 +90,7 @@ CREATE FUNCTION snb_ru_init(text)
...
@@ -90,7 +90,7 @@ CREATE FUNCTION snb_ru_init(text)
insert into pg_ts_dict select
insert into pg_ts_dict select
'ru_stem',
'ru_stem',
'snb_ru_init(text)',
'snb_ru_init(text)',
'
DATA_PATH
/russian.stop',
'
contrib
/russian.stop',
'snb_lexize(internal,internal,int4)',
'snb_lexize(internal,internal,int4)',
'Russian Stemmer. Snowball.'
'Russian Stemmer. Snowball.'
;
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment