From d66a8c7c4786c57d6bcff987e00aeb71238ea9a4 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 3 Jul 2000 16:03:27 +0000 Subject: [PATCH] Very small changes in the contrib's pg_dumplo in the attache. And: Note, Bruce I found in the contrib tree any files that we forget remove during contrib cleaning. Please remove these files: contrib/lo/test.sql contrib/pg_dumplo/Makefile.out contrib/pgbench/pgbench_jis.doc contrib/spi/new_example.example contrib/spi/README.MAX Thanks. Karel --- contrib/lo/test.sql | 0 contrib/pg_dumplo/INSTALL | 3 +- contrib/pg_dumplo/Makefile.out | 0 contrib/pg_dumplo/lo_export.c | 4 +- contrib/pg_dumplo/main.c | 3 +- contrib/pgbench/pgbench_jis.doc | 0 contrib/spi/README.MAX | 0 contrib/spi/new_example.example | 68 --------------------------------- 8 files changed, 5 insertions(+), 73 deletions(-) delete mode 100755 contrib/lo/test.sql delete mode 100644 contrib/pg_dumplo/Makefile.out delete mode 100644 contrib/pgbench/pgbench_jis.doc delete mode 100644 contrib/spi/README.MAX delete mode 100644 contrib/spi/new_example.example diff --git a/contrib/lo/test.sql b/contrib/lo/test.sql deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/contrib/pg_dumplo/INSTALL b/contrib/pg_dumplo/INSTALL index 8959a462b1..b199db54f4 100644 --- a/contrib/pg_dumplo/INSTALL +++ b/contrib/pg_dumplo/INSTALL @@ -9,11 +9,10 @@ this help or the cool HOWTO. Compilation: ~~~~~~~~~~~ - - In the PG contrib tree: * run master ./configure in the PG source top directory * run 'make' - * run 'make install' + THANKS: ~~~~~~ diff --git a/contrib/pg_dumplo/Makefile.out b/contrib/pg_dumplo/Makefile.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/pg_dumplo/lo_export.c b/contrib/pg_dumplo/lo_export.c index 80d401902c..e18c3ef651 100644 --- a/contrib/pg_dumplo/lo_export.c +++ b/contrib/pg_dumplo/lo_export.c @@ -104,7 +104,7 @@ pglo_export(LODumpMaster *pgLO) if ((tuples = PQntuples(pgLO->res)) == 0) { if (!pgLO->quiet && pgLO->action == ACTION_EXPORT_ATTR) - printf("%s: not large objets in '%s'\n", progname, ll->lo_table); + printf("%s: no large objets in '%s'\n", progname, ll->lo_table); continue; } else if (check_res(pgLO)) { @@ -137,7 +137,7 @@ pglo_export(LODumpMaster *pgLO) } if (!pgLO->quiet) - printf("dump %s.%s (%d lagre obj)\n", + printf("dump %s.%s (%d large obj)\n", ll->lo_table, ll->lo_attr, tuples); } diff --git a/contrib/pg_dumplo/main.c b/contrib/pg_dumplo/main.c index eafaed8c65..d9bdf9eb44 100644 --- a/contrib/pg_dumplo/main.c +++ b/contrib/pg_dumplo/main.c @@ -4,7 +4,7 @@ * * Portions Copyright (c) 1999-2000, PostgreSQL, Inc * - * $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.2 2000/06/19 13:54:01 momjian Exp $ + * $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.3 2000/07/03 16:03:22 momjian Exp $ * * Karel Zak 1999-2000 * ------------------------------------------------------------------------- @@ -85,6 +85,7 @@ main(int argc, char **argv) { "host", required_argument, 0, 'h' }, { "space", required_argument, 0, 's' }, { "import", no_argument, 0, 'i' }, + { "export", no_argument, 0, 'e' }, { "remove", no_argument, 0, 'r' }, { "quiet", no_argument, 0, 'q' }, { "all", no_argument, 0, 'a' }, diff --git a/contrib/pgbench/pgbench_jis.doc b/contrib/pgbench/pgbench_jis.doc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/spi/README.MAX b/contrib/spi/README.MAX deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/spi/new_example.example b/contrib/spi/new_example.example deleted file mode 100644 index 0204907894..0000000000 --- a/contrib/spi/new_example.example +++ /dev/null @@ -1,68 +0,0 @@ ---Column ID of table A is primary key: - -CREATE TABLE A ( - ID int4 not null, - id1 int4 not null, -primary key (ID,ID1) -); - ---Columns REFB of table B and REFC of C are foreign keys referenting ID of A: - -CREATE TABLE B ( - REFB int4, - REFB1 INT4 -); -CREATE INDEX BI ON B (REFB); - -CREATE TABLE C ( - REFC int4, - REFC1 int4 -); -CREATE INDEX CI ON C (REFC); - ---Trigger for table A: - -CREATE TRIGGER AT BEFORE DELETE ON A FOR EACH ROW -EXECUTE PROCEDURE -check_foreign_key (2, 'cascade', 'ID','id1', 'B', 'REFB','REFB1', 'C', 'REFC','REFC1'); - - -CREATE TRIGGER AT1 AFTER UPDATE ON A FOR EACH ROW -EXECUTE PROCEDURE -check_foreign_key (2, 'cascade', 'ID','id1', 'B', 'REFB','REFB1', 'C', 'REFC','REFC1'); - - -CREATE TRIGGER BT BEFORE INSERT OR UPDATE ON B FOR EACH ROW -EXECUTE PROCEDURE -check_primary_key ('REFB','REFB1', 'A', 'ID','ID1'); - -CREATE TRIGGER CT BEFORE INSERT OR UPDATE ON C FOR EACH ROW -EXECUTE PROCEDURE -check_primary_key ('REFC','REFC1', 'A', 'ID','ID1'); - - - --- Now try - -INSERT INTO A VALUES (10,10); -INSERT INTO A VALUES (20,20); -INSERT INTO A VALUES (30,30); -INSERT INTO A VALUES (40,41); -INSERT INTO A VALUES (50,50); - -INSERT INTO B VALUES (1); -- invalid reference -INSERT INTO B VALUES (10,10); -INSERT INTO B VALUES (30,30); -INSERT INTO B VALUES (30,30); - -INSERT INTO C VALUES (11); -- invalid reference -INSERT INTO C VALUES (20,20); -INSERT INTO C VALUES (20,21); -INSERT INTO C VALUES (30,30); - --- now update work well -update A set ID = 100 , ID1 = 199 where ID=30 ; - -SELECT * FROM A; -SELECT * FROM B; -SELECT * FROM C;