Quoting Glyn Astill <[email protected]>:
--- On Mon, 19/10/09, Glyn Astill <[email protected]> wrote:
Hi chaps,

Is anyone else seeing this when doing UPGRADE
FUNCTIONS?  I'm guessing it's the recent int / bigint
changes?

And I'm getting:

g...@way5d:/pgsql/slony$ slonik upgrade_functions.scr
upgrade_functions.scr:9: Possible unsupported PostgreSQL
version 8.3, defaulting to 8.1 support
upgrade_functions.scr:9: loading of file
/usr/local/pgsql/share//slony1_funcs.sql: PGRES_FATAL_ERROR
ERROR:  cannot change return type of existing function
HINT:  Use DROP FUNCTION first.
ERROR:  cannot change return type of existing
function
HINT:  Use DROP FUNCTION first.


I bumbled around it with the following on each node:

psql -U slony -d SEE -c 'drop function _main_replication_test.ddlscript_complete(integer, text, integer)' psql -U slony -d SEE -c 'drop function _main_replication_test.updatereloid(integer, integer)' sed -e 's/@NAMESPACE@/_main_replication_test/g;s/@MODULEVERSION@/1.2.17/g' slony1_funcs.sql | psql -U slony -d SEE

The following patch should rectify this...

Index: slony1_funcs.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.145.2.19
diff -c -u -r1.145.2.19 slony1_funcs.sql
cvs diff: conflicting specifications of output style
--- slony1_funcs.sql    23 Sep 2009 16:14:32 -0000      1.145.2.19
+++ slony1_funcs.sql    21 Oct 2009 12:32:57 -0000
@@ -3643,6 +3643,8 @@
 --
 --     Generate the DDL_SCRIPT event
 -- ----------------------------------------------------------------------
+drop function if exists @[email protected]_complete (int4, text, int4); -- Needed because function signature has changed!
+
 create or replace function @[email protected]_complete (int4, text, int4)
 returns bigint
 as $$
@@ -5063,6 +5065,7 @@
 --
 --      Reset the relnames
 -- ----------------------------------------------------------------------
+drop function if exists @[email protected] (int4, int4);
 create or replace function @[email protected] (int4, int4)
 returns bigint
 as $$

That's working and committed to 2.0 + HEAD.

_______________________________________________
Slony1-general mailing list
[email protected]
http://lists.slony.info/mailman/listinfo/slony1-general

Reply via email to