2011-02-14 09:06:41 +08:00
|
|
|
/* contrib/test_parser/test_parser--1.0.sql */
|
2007-10-16 05:36:50 +08:00
|
|
|
|
2011-10-13 03:45:03 +08:00
|
|
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
|
|
|
\echo Use "CREATE EXTENSION test_parser" to load this file. \quit
|
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION testprs_start(internal, int4)
|
2007-11-11 11:25:35 +08:00
|
|
|
RETURNS internal
|
|
|
|
AS 'MODULE_PATHNAME'
|
|
|
|
LANGUAGE C STRICT;
|
2007-10-16 05:36:50 +08:00
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION testprs_getlexeme(internal, internal, internal)
|
2007-11-11 11:25:35 +08:00
|
|
|
RETURNS internal
|
|
|
|
AS 'MODULE_PATHNAME'
|
|
|
|
LANGUAGE C STRICT;
|
2007-10-16 05:36:50 +08:00
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION testprs_end(internal)
|
2007-11-11 11:25:35 +08:00
|
|
|
RETURNS void
|
|
|
|
AS 'MODULE_PATHNAME'
|
|
|
|
LANGUAGE C STRICT;
|
2007-10-16 05:36:50 +08:00
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION testprs_lextype(internal)
|
2007-11-11 11:25:35 +08:00
|
|
|
RETURNS internal
|
|
|
|
AS 'MODULE_PATHNAME'
|
|
|
|
LANGUAGE C STRICT;
|
2007-10-16 05:36:50 +08:00
|
|
|
|
|
|
|
CREATE TEXT SEARCH PARSER testparser (
|
|
|
|
START = testprs_start,
|
|
|
|
GETTOKEN = testprs_getlexeme,
|
|
|
|
END = testprs_end,
|
|
|
|
HEADLINE = pg_catalog.prsd_headline,
|
|
|
|
LEXTYPES = testprs_lextype
|
|
|
|
);
|