From cd1d776307204cb77a731aa1b15c3c43a275c70e Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Sat, 28 Apr 2012 22:12:40 -0400 Subject: [PATCH] Better lookup for old bucardo_sequence tables. Per mailing list question from Ed Snajder --- bucardo.schema | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bucardo.schema b/bucardo.schema index cd2c8a895..de419f224 100644 --- a/bucardo.schema +++ b/bucardo.schema @@ -1883,7 +1883,9 @@ SELECT 'Fixme'::TEXT; if ($count < 1) { ## Check for older version of bucardo_sequences table $SQL = q{SELECT count(*) FROM pg_attribute WHERE attname = 'targetname' } - .q{ AND attrelid = 'bucardo.bucardo_sequences'::regclass}; + .q{ AND attrelid = (SELECT c.oid FROM pg_class c, pg_namespace n } + .q{ WHERE n.oid = c.relnamespace AND n.nspname = 'bucardo' } + .q{ AND c.relname = 'bucardo_sequences')}; $count = $dbh->selectall_arrayref($SQL)->[0][0]; if ($count < 1) { warn "Dropping older version of bucardo_sequences, then recreating empty\n"; -- 2.39.5