Help talk:Talk pages
From PostgreSQL wiki
== Need information regarding DB Upgrade from one version to other version ==
I have developed a web application( say APP1.0), which used PostgreSQL as database. APP1.0 is having some schema (tales and stored procedures).i have installed APP1.0 in one machine and used( i have some data in my DB). Now i have APP2.0 which has some DB Schema changes to the APP1.0 DB schema. My application is providing a link to upgrade from APP1.0 to APP2.0, which usually i will run DBUpgradeScript.sql which will make my APP1.0 DBSchema to APP2.0 DBSchema with all the previous data. Manually, i will create the upgrade script by comparing the two DBscripts(version 1.0 schema and 2.0 schema). For ex, if a stored procedure say proc1.sql has been changed in 2.0 version, i will write CREATE OR REPLACE proc in my upgrade script. If col5 is added to a table emp, i will write ALTER TABLE EMP ADD COLUMN col5. if a new proc is added in 2.0 schema, i will copy this new procedure in my DBUpgradeScript.sql file To upgrade DB schema from one version of application to another version (by retaining all the previous data ), is there any other way? or tool available?
--bsaritahyd 09:24, 19 September 2008 (UTC)Sarita
How can I export data in an specific time range using pg_dumb?
I have a huge database and I need to restore data in a 2 month period. I need all the tables but only for last 2 months. any idea? I'm using below command: /opt/PostgreSQL/9.2/bin/pg_dump -Upostgres mydb > /data/mydb.backup