summaryrefslogtreecommitdiff
path: root/contrib/test_parser
diff options
context:
space:
mode:
authorBruce Momjian2007-11-11 03:25:35 +0000
committerBruce Momjian2007-11-11 03:25:35 +0000
commit926bbab44832ae2763392077ecefa029d14c8544 (patch)
treee70fd1806e8a04b019808e1c71428568eb900f8c /contrib/test_parser
parent541ff409cc341ce1e0212fc6a7d67eef6709b6b4 (diff)
Make /contrib install/uninstall script consistent:
remove transactions use create or replace function make formatting consistent set search patch on first line Add documentation on modifying *.sql to set the search patch, and mention that major upgrades should still run the installation scripts. Some of these issues were spotted by Tom today.
Diffstat (limited to 'contrib/test_parser')
-rw-r--r--contrib/test_parser/test_parser.sql.in38
-rw-r--r--contrib/test_parser/uninstall_test_parser.sql1
2 files changed, 17 insertions, 22 deletions
diff --git a/contrib/test_parser/test_parser.sql.in b/contrib/test_parser/test_parser.sql.in
index cb5c9a2b03..048f934078 100644
--- a/contrib/test_parser/test_parser.sql.in
+++ b/contrib/test_parser/test_parser.sql.in
@@ -1,29 +1,25 @@
--- $PostgreSQL: pgsql/contrib/test_parser/test_parser.sql.in,v 1.1 2007/10/15 21:36:50 tgl Exp $
-
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-BEGIN;
-
-CREATE FUNCTION testprs_start(internal, int4)
- RETURNS internal
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT;
+CREATE OR REPLACE FUNCTION testprs_start(internal, int4)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT;
-CREATE FUNCTION testprs_getlexeme(internal, internal, internal)
- RETURNS internal
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT;
+CREATE OR REPLACE FUNCTION testprs_getlexeme(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT;
-CREATE FUNCTION testprs_end(internal)
- RETURNS void
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT;
+CREATE OR REPLACE FUNCTION testprs_end(internal)
+RETURNS void
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT;
-CREATE FUNCTION testprs_lextype(internal)
- RETURNS internal
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT;
+CREATE OR REPLACE FUNCTION testprs_lextype(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT;
CREATE TEXT SEARCH PARSER testparser (
START = testprs_start,
@@ -32,5 +28,3 @@ CREATE TEXT SEARCH PARSER testparser (
HEADLINE = pg_catalog.prsd_headline,
LEXTYPES = testprs_lextype
);
-
-END;
diff --git a/contrib/test_parser/uninstall_test_parser.sql b/contrib/test_parser/uninstall_test_parser.sql
index d194677d6b..85f64146dd 100644
--- a/contrib/test_parser/uninstall_test_parser.sql
+++ b/contrib/test_parser/uninstall_test_parser.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP TEXT SEARCH PARSER testparser;