Unix Technical Forum

Distributing PostGres database to various customers

This is a discussion on Distributing PostGres database to various customers within the Pgsql General forums, part of the PostgreSQL category; --> All, I am new to PostGres 8 (using 8.2.4 windows version). We have for several years been using iAnywhere's ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 05:49 PM
Mike Gould
 
Posts: n/a
Default Distributing PostGres database to various customers

All,

I am new to PostGres 8 (using 8.2.4 windows version). We have for several years been using iAnywhere's SQL Anywhere product with our commercialtransportation software. With ASA there are 2 files that must be distributed for the database, a filename.db and a filename.log. When we do anew installation we normally try and preload the database with data used for lookups, some registration data and if a customer is moving from another software where we've been contracted to convert their old data toour system we preload that. Once that is done we can distribute the database as part of the setup process.

How can we do this with PostGres? Other than backup and restore or creating SQL scripts I haven't been able to find another method. Some of these tables may have over a million rows in them initially if we convert old data.

Best Regards,

Michael Gould
All Coast Intermodal Services, Inc.
904-376-7030
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 05:49 PM
Alexander Staubo
 
Posts: n/a
Default Re: Distributing PostGres database to various customers

On 6/11/07, Mike Gould <mgould@allcoast.net> wrote:
> How can we do this with PostGres? Other than backup and restore or creating
> SQL scripts I haven't been able to find another method. Some of these
> tables may have over a million rows in them initially if we convert old
> data.


The most portable way is probably pg_dump as plaintext:

pg_dump -Fp mydatabase >mydatabase.dump

Then restore with:

cat mydatabase.dump | psql mydatabase

Alexander.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 05:49 PM
Sean Davis
 
Posts: n/a
Default Re: Distributing PostGres database to various customers

Mike Gould wrote:
> All,
>
> I am new to PostGres 8 (using 8.2.4 windows version). We have for
> several years been using iAnywhere's SQL Anywhere product with our
> commercial transportation software. With ASA there are 2 files that
> must be distributed for the database, a filename.db and a filename.log.
> When we do a new installation we normally try and preload the database
> with data used for lookups, some registration data and if a customer is
> moving from another software where we've been contracted to convert
> their old data to our system we preload that. Once that is done we can
> distribute the database as part of the setup process.
>
> How can we do this with PostGres? Other than backup and restore or
> creating SQL scripts I haven't been able to find another method. Some
> of these tables may have over a million rows in them initially if we
> convert old data.


I would give backup/restore a try. A million rows isn't very big in
postgres terms. On relatively low-end hardware, I am routinely able to
backup about 300Gb in about 35 databases in under 3 hours.

Sean

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 05:51 PM
David Fetter
 
Posts: n/a
Default Re: Distributing PostGres database to various customers

On Mon, Jun 11, 2007 at 03:08:07PM +0200, Alexander Staubo wrote:
> On 6/11/07, Mike Gould <mgould@allcoast.net> wrote:
> >How can we do this with PostGres? Other than backup and restore or
> >creating
> >SQL scripts I haven't been able to find another method. Some of these
> >tables may have over a million rows in them initially if we convert old
> >data.

>
> The most portable way is probably pg_dump as plaintext:
>
> pg_dump -Fp mydatabase >mydatabase.dump
>
> Then restore with:
>
> cat mydatabase.dump | psql mydatabase


This is better phrased:

psql -f mydadatabase.dump

If anything goes wrong, the error will contain the line number where
it went wrong.

Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:30 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com