Re: drop view and recreate - for sync

From: Vick Khera <vivek(at)khera(dot)org>
To: Sydney Puente <sydneypuente(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: drop view and recreate - for sync
Date: 2009-10-26 14:20:43
Message-ID: 2968dfd60910260720t13156e9ch6d8a875b68e7086a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 23, 2009 at 6:44 PM, Sydney Puente <sydneypuente(at)yahoo(dot)com> wrote:
> Ah I see what you mean - thanks very much that is v helpful!
> Yes the copy will be read-only.
> Will have 3 tables of data, being read (readonly) and in the background
> Will have 3 shadow tables populated from an unreliable db over an unreliable
> network.
> not quite sure how I can "insert all the rows" in sql.
> have postgres 8.03 BTW.
>

If your network is unreliable, then perhaps the thing to do is have
your program first fetch all the new data over that network into tab
delimited files, one per table. Then to insert all your data, just
use the "COPY" command in postgres to read it all as one hunk of data.
This will be your fastest, most reliable way of loading the data in
minimal time. Your only other option is to issue 100,000 "INSERT"
statements, which will take much longer.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2009-10-26 14:28:02 Re: cursor MOVE vs OFFSET in SELECT
Previous Message Raymond O'Donnell 2009-10-26 14:12:10 Re: [ANNOUNCE] PGDay.EU 2009 - approaching fast!