Wed Dec 10 15:39:56 PST 2008
- Previous message: [Slony1-commit] slony1-engine slony1.spec.in
- Next message: [Slony1-commit] slony1-engine/src/slon misc.c
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Update of /home/cvsd/slony1/slony1-engine/tools/altperl In directory main.slony.info:/tmp/cvs-serv25699 Added Files: Tag: REL_1_2_STABLE slonik_drop_sequence.pl Log Message: Added slonik_drop_sequence.pl as per note from Mark Stosberg --- NEW FILE: slonik_drop_sequence.pl --- #!@@PERL@@ # $Id: slonik_drop_sequence.pl,v 1.1.4.1 2008-12-10 23:39:54 cbbrowne Exp $ # Author: Mark Stosberg # Based on work by: Christopher Browne # Parts Copyright 2008 Summerault, LLC # Parts Copyright 2004 Afilias Canada use Getopt::Long; $CONFIG_FILE = '@@SYSCONFDIR@@/slon_tools.conf'; $SHOW_USAGE = 0; # Read command-line options GetOptions("config=s" => \$CONFIG_FILE, "help" => \$SHOW_USAGE); my $USAGE = "Usage: slonik_drop_sequence [--config file] sequence_id set sequence_id The ID of the sequence to be dropped from replication set The name or ID of the set to drop the sequence from You can get the sequence_id with a query like this: SELECT seq_id,seq_relname from _MY_CLUSTER.sl_sequence where seq_relname = 'MY_SEQUENCE'; No application-visible locking should take place. "; if ($SHOW_USAGE) { print $USAGE; exit 0; } require '@@PGLIBDIR@@/slon-tools.pm'; require $CONFIG_FILE; my ($SEQ_ID,$set) = @ARGV; $SET_ID = get_set($set); unless ($SEQ_ID && $SET_ID) { die $USAGE; } my $slonik = ''; $slonik .= genheader(); # DROP TABLE $slonik .= "\n"; $slonik .= "# DROP SEQUENCE \n"; $slonik .= " try {\n"; $slonik .= " SET DROP SEQUENCE (id = $SEQ_ID, origin = $SET_ORIGIN);\n"; $slonik .= " } on error {\n"; $slonik .= " echo 'Could not drop sequence $SEQ_ID for $CLUSTER_NAME!';\n"; $slonik .= " exit -1;\n"; $slonik .= " }\n"; run_slonik_script($slonik, 'DROP SEQUENCE');
- Previous message: [Slony1-commit] slony1-engine slony1.spec.in
- Next message: [Slony1-commit] slony1-engine/src/slon misc.c
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list