From: | "(dot)"(at)babolo(dot)ru |
---|---|
To: | Ulf Rehmann <rehmann(at)mathematik(dot)uni-bielefeld(dot)de> |
Cc: | pgsql-hackers(at)postgresql(dot)org, pgsql-interfaces(at)postgresql(dot)org |
Subject: | Re: postgresql 7.3 versus 7.2 |
Date: | 2003-02-13 06:43:23 |
Message-ID: | 1045118603.377594.739.nullmailer@cicuta.babolo.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-interfaces |
> Is there any way to adjust dumps from postgresql 7.3 for use by
> version 7.2 and vice versa ?
>
> Or is there a way to transport a full database via csv or in any other
> kind to 7.2 and vice versa ?
>
> We are running a couple of servers/mirrors at various locations in the
> world, handling data based on postgresql, and now we have trouble to
> transport data from and to sites with different versions.
>
> (E.g. http://genealogy.math.ndsu.nodak.edu/
> http://genealogy.mathematik.uni-bielefeld.de/ )
>
> Some have upgraded and others cannot immediately follow, since an
> upgrade from 7.2 to 7.3 seems to require an upgrade of php4 and maybe
> even of apache, which takes time etc.
>
> So it would be helpful to have an easy tool to convert between data
> for both versions.
>
> Any help or recommendation is very much appreciated!
I live with PostgreSQL from 6.5 and for
independance every my application write
in such a manner:
database description is written using m4 macros.
short example (<qb><qe> - quote open and quote close - they are unprintable):
CREATE_SECTION<qb><qe>dnl
CREATE_TABLE(istat_d, rs, normal)
( date date NOT NULL
, wclass int NOT NULL
, count int8 NOT NULL
)
INHERITS(ifaces)
;
TUNE_SECTION<qb><qe>dnl
CREATE UNIQUE INDEX istat_d_idx ON istat_d(router, iface, date, wclass);
ALTER TABLE istat_d ADD FOREIGN KEY(router) REFERENCES router;
ALTER TABLE istat_d ADD FOREIGN KEY(router, iface) REFERENCES iface;
COMMENT ON TABLE istat_d IS '????? ? ???????';
COMMENT ON COLUMN istat_d.date IS '????? ??????';
END_SECTION<qb><qe>dnl
m4 creates different files:
for shema creation:
CREATE TABLE istat_d
( date date NOT NULL
, wclass int NOT NULL
, count int8 NOT NULL
)
INHERITS(ifaces)
;
for content restore (:1 - directory):
\set istat_d '\\copy istat_d FROM \'' :1 '/istat_d\''
:istat_d
for last pass (I call it 'tune'):
GRANT SELECT ON istat_d TO ispdb;
GRANT INSERT ON istat_d TO ispdb;
GRANT SELECT ON istat_d TO GROUP ispdbuser;
CREATE UNIQUE INDEX istat_d_idx ON istat_d(router, iface, date, wclass);
ALTER TABLE istat_d ADD FOREIGN KEY(router) REFERENCES router;
ALTER TABLE istat_d ADD FOREIGN KEY(router, iface) REFERENCES iface;
COMMENT ON TABLE istat_d IS '????? ? ???????';
COMMENT ON COLUMN istat_d.date IS '????? ??????';
for content dump:
\set istat_d '\\copy istat_d TO \'' :1 '/istat_d\''
:istat_d
for shema deletion:
DROP TABLE istat_d;
for empty database initialisation - void in this example.
'?' in example are symbols of my language.
So every database replication is:
- content dump (not PostgreSQL dump)
- shema creation
- content restore
- tune pass
This unlock me from PostgreSQL version and ease me
to upgrade application version (with possible
'up' pass in addition)
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Kalchev | 2003-02-13 07:30:35 | Re: [HACKERS] Changing the default configuration |
Previous Message | mlw | 2003-02-13 06:31:47 | Re: location of the configuration files |
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Uman | 2003-02-13 08:57:12 | LIBPQXX on Windows |
Previous Message | David Wheeler | 2003-02-13 06:16:26 | Re: Prepare and prepare ? |