bugzilla-daemon at main.slony.info bugzilla-daemon at main.slony.info
Wed Dec 8 14:38:22 PST 2010
http://www.slony.info/bugzilla/show_bug.cgi?id=163

Christopher Browne <cbbrowne at ca.afilias.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://github.com/cbbrowne
                   |                            |/slony1-engine/commits/bug1
                   |                            |63

--- Comment #2 from Christopher Browne <cbbrowne at ca.afilias.info> 2010-12-08 14:38:23 PST ---
Set up a branch for this on GitHub...

https://github.com/cbbrowne/slony1-engine/commits/bug163

Took an initial swing at implementation:

https://github.com/cbbrowne/slony1-engine/commit/42a4d2ed275d4d2c1b08f49b5c079e8c6a790258

1.  Change TIMESTAMP to TIMESTAMPTZ in slony1_base.sql

2.  Add logic to upgradeSchema() that looks for tables with "timestamp without
time zone" and changes them to "timestamp with time zone"

This has a couple of complications...

The view sl_status depends on the underlying tables; if you try to alter them,
this errors out as follows:

Dec  8 17:01:23 cbbrowne postgres[32294]: [3-1] ERROR:  cannot alter type of a
column used by a view or rule
Dec  8 17:01:23 cbbrowne postgres[32294]: [3-2] DETAIL:  rule _RETURN on view
sl_status depends on column "ev_timestamp"
Dec  8 17:01:23 cbbrowne postgres[32294]: [3-3] STATEMENT:  alter table
sl_event  alter column ev_timestamp set data type timestamp with time zone;

Consequently, I added logic to pull the definition of sl_status, using
pg_get_viewdef().  So the logic is...

- Capture view definition for sl_status
- Drop view sl_status
- Do all necessary alterations
- Recreate sl_status

Note also that this requires changing the schema to the Slony cluster's schema,
so pg_get_viewdef() and the subsequent recreation are working against the same
namespaces.

Consequence: change the function to set search_path appropriately.  That seems
like something we might want to do to all the Slony functions.

-- 
Configure bugmail: http://www.slony.info/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Slony1-bugs mailing list