| 1 |
/* |
| 2 |
* Create underlying C functions for Snowball stemmers |
| 3 |
* |
| 4 |
* Copyright (c) 2007-2025, PostgreSQL Global Development Group |
| 5 |
* |
| 6 |
* src/backend/snowball/snowball_func.sql.in |
| 7 |
* |
| 8 |
* This file is combined with multiple instances of snowball.sql.in to |
| 9 |
* build snowball_create.sql, which is executed during initdb. |
| 10 |
* |
| 11 |
* Note: this file is read in single-user -j mode, which means that the |
| 12 |
* command terminator is semicolon-newline-newline; whenever the backend |
| 13 |
* sees that, it stops and executes what it's got. If you write a lot of |
| 14 |
* statements without empty lines between, they'll all get quoted to you |
| 15 |
* in any error message about one of them, so don't do that. Also, you |
| 16 |
* cannot write a semicolon immediately followed by an empty line in a |
| 17 |
* string literal (including a function body!) or a multiline comment. |
| 18 |
*/ |
| 19 |
|
| 20 |
SET search_path = pg_catalog; |
| 21 |
|
| 22 |
CREATE FUNCTION dsnowball_init(INTERNAL) |
| 23 |
RETURNS INTERNAL AS '$libdir/dict_snowball', 'dsnowball_init' |
| 24 |
LANGUAGE C STRICT; |
| 25 |
|
| 26 |
CREATE FUNCTION dsnowball_lexize(INTERNAL, INTERNAL, INTERNAL, INTERNAL) |
| 27 |
RETURNS INTERNAL AS '$libdir/dict_snowball', 'dsnowball_lexize' |
| 28 |
LANGUAGE C STRICT; |
| 29 |
|
| 30 |
CREATE TEXT SEARCH TEMPLATE snowball |
| 31 |
(INIT = dsnowball_init, |
| 32 |
LEXIZE = dsnowball_lexize); |
| 33 |
|
| 34 |
COMMENT ON TEXT SEARCH TEMPLATE snowball IS 'snowball stemmer'; |