Re: How to check for successfull inserts

From: Francisco Reyes <lists(at)natserv(dot)com>
To: Arguile <arguile(at)lucentstudios(dot)com>
Cc: pgsql General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to check for successfull inserts
Date: 2002-03-10 18:42:26
Message-ID: 20020310133300.N42776-100000@zoraida.natserv.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 9 Mar 2002, Arguile wrote:

> Francisco Reyes writes:
> http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/plpgsql-statemen
> ts.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

Thanks for the link. Will take a look.

> but I just checked and COPY FROM doesn't return that count (unlike INSERT).
> It would be nice if it did but that doesn't help you much.

Inserts would be too slow.

> The only other thing I can think of off the top of my head is to count(*)
> the table in question before and after and return the difference. As you're
> within a transaction it will be accurate, if rather unwieldy.

count(*) would probably be too slow. I am doing millions of records, plus
there are also million of deletions, so it would become progresivelly
worse (until the weekend when I do a vacuum full).

I am leaning towards an "External" solution, possibly with PHP.
Check if the file is 0 bytes. If it is then do nothing, otherwise process
the load.

This way I would be able to do what I need without having to Learn PL/SQL
which I probably will find time for it in a month or two.

Can PL/SQL even check the size of a file?
I haven't seen on the docs a list of functions available on PL/SQL.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Schroepfer 2002-03-10 18:42:27 Primary Key Column Size?
Previous Message Francisco Reyes 2002-03-10 18:30:45 Re: Advice for optimizing queries using Large Tables