[BUGS] BUG #1715: dbmirror replaces nextval, setval functions
The following bug has been logged online: Bug reference: 1715 Logged by: James Doherty Email address: [EMAIL PROTECTED] PostgreSQL version: 8.0.3 Operating system: Solaris 8 Intel Description:dbmirror replaces nextval, setval functions Details: The dbmirror contrib program replaces some key functions when setting up the Mirroring table (MirrorSetup.sql). The nextval and setval functions are renamed as nextval_pg and setval_pg and replaced with new functions. This breaks any fields made with the SERIAL datatype, which have to be ALTER'ed to use the nextval_pg and setval_pg functions to work properly. Here's the offending code in MirrorSetup.sql: UPDATE pg_proc SET proname='nextval_pg' WHERE proname='nextval'; CREATE FUNCTION pg_catalog.nextval(text) RETURNS int8 AS '$libdir/pending.so', 'nextval' LANGUAGE 'C' STRICT; UPDATE pg_proc set proname='setval_pg' WHERE proname='setval'; CREATE FUNCTION pg_catalog.setval("unknown",integer,boolean) RETURNS int8 AS '$libdir/pending.so', 'setval' LANGUAGE 'C' STRICT; CREATE FUNCTION pg_catalog.setval("unknown",integer) RETURNS int8 AS '$libdir/pending.so', 'setval' LANGUAGE 'C' STRICT; ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[BUGS] BUG #1713: dbmirror replaces nextval, setval functions
The following bug has been logged online: Bug reference: 1713 Logged by: James Doherty Email address: [EMAIL PROTECTED] PostgreSQL version: 8.0.3 Operating system: Solaris 8 Intel Description:dbmirror replaces nextval, setval functions Details: The dbmirror contrib program replaces some key functions when setting up the Mirroring table (MirrorSetup.sql). The nextval and setval functions are renamed as nextval_pg and setval_pg and replaced with new functions. This breaks any fields made with the SERIAL datatype, which have to be ALTER'ed to use the nextval_pg and setval_pg functions to work properly. Here's the offending code in MirrorSetup.sql: UPDATE pg_proc SET proname='nextval_pg' WHERE proname='nextval'; CREATE FUNCTION pg_catalog.nextval(text) RETURNS int8 AS '$libdir/pending.so', 'nextval' LANGUAGE 'C' STRICT; UPDATE pg_proc set proname='setval_pg' WHERE proname='setval'; CREATE FUNCTION pg_catalog.setval("unknown",integer,boolean) RETURNS int8 AS '$libdir/pending.so', 'setval' LANGUAGE 'C' STRICT; CREATE FUNCTION pg_catalog.setval("unknown",integer) RETURNS int8 AS '$libdir/pending.so', 'setval' LANGUAGE 'C' STRICT; ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[BUGS] BUG #1714: dbmirror replaces nextval, setval functions
The following bug has been logged online: Bug reference: 1714 Logged by: James Doherty Email address: [EMAIL PROTECTED] PostgreSQL version: 8.0.3 Operating system: Solaris 8 Intel Description:dbmirror replaces nextval, setval functions Details: The dbmirror contrib program replaces some key functions when setting up the Mirroring table (MirrorSetup.sql). The nextval and setval functions are renamed as nextval_pg and setval_pg and replaced with new functions. This breaks any fields made with the SERIAL datatype, which have to be ALTER'ed to use the nextval_pg and setval_pg functions to work properly. Here's the offending code in MirrorSetup.sql: UPDATE pg_proc SET proname='nextval_pg' WHERE proname='nextval'; CREATE FUNCTION pg_catalog.nextval(text) RETURNS int8 AS '$libdir/pending.so', 'nextval' LANGUAGE 'C' STRICT; UPDATE pg_proc set proname='setval_pg' WHERE proname='setval'; CREATE FUNCTION pg_catalog.setval("unknown",integer,boolean) RETURNS int8 AS '$libdir/pending.so', 'setval' LANGUAGE 'C' STRICT; CREATE FUNCTION pg_catalog.setval("unknown",integer) RETURNS int8 AS '$libdir/pending.so', 'setval' LANGUAGE 'C' STRICT; ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Re: [BUGS] BUG #1715: dbmirror replaces nextval, setval functions
Title: Re: [BUGS] BUG #1715: dbmirror replaces nextval, setval functions I wouldn't say that requiring that dbmirror not break all serial fields in the entire database is a special requirement! The pending.so library that is compiled prior to running dbmirror would also have to be updated, since it refers to nextval and setval as well. As far as the actual mirroring of the database, it's working great. It's the way that it changes the database when it is intalled that I think it is a bug. And I could attempt to fix it with my meager knowledge of postgres and c, but I don't think I'd be confident to submit an official fix for it. James -Original Message- From: Achilleus Mantzios [mailto:[EMAIL PROTECTED] Sent: Mon 6/13/2005 2:59 AM To: James Doherty Cc: pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #1715: dbmirror replaces nextval, setval functions O James Doherty έγραψε στις Jun 10, 2005 :>> The following bug has been logged online:>> Bug reference: 1715> Logged by: James Doherty> Email address: [EMAIL PROTECTED]> PostgreSQL version: 8.0.3> Operating system: Solaris 8 Intel> Description: dbmirror replaces nextval, setval functions> Details:>> The dbmirror contrib program replaces some key functions when setting up the> Mirroring table (MirrorSetup.sql). The nextval and setval functions are> renamed as nextval_pg and setval_pg and replaced with new functions.>> This breaks any fields made with the SERIAL datatype, which have to be> ALTER'ed to use the nextval_pg and setval_pg functions to work properly.>>> Here's the offending code in MirrorSetup.sql:> UPDATE pg_proc SET proname='nextval_pg' WHERE proname='nextval';>> CREATE FUNCTION pg_catalog.nextval(text) RETURNS int8 AS> '$libdir/pending.so', 'nextval' LANGUAGE 'C' STRICT;>>> UPDATE pg_proc set proname='setval_pg' WHERE proname='setval';>> CREATE FUNCTION pg_catalog.setval("unknown",integer,boolean) RETURNS int8> AS> '$libdir/pending.so', 'setval' LANGUAGE 'C' STRICT;> CREATE FUNCTION pg_catalog.setval("unknown",integer) RETURNS int8 AS> '$libdir/pending.so', 'setval' LANGUAGE 'C' STRICT;You are right, since dbmirror mirrors tables based on whetherthe recordchange trigger is present, whereas it seemsto mirror sequences unconditionally.You could rename dbmirror's setval,nextval todbmirror_setval,dbmirror_nextval, and leavepostgresql's original functions as is.Just a note tho:Dbmirror is a great tool, but someone needs to hack a great dealof code to meet his/her special requirements.---Achilleus