Re: How to check for successfull inserts - Mailing list pgsql-general

From Francisco Reyes
Subject Re: How to check for successfull inserts
Date
Msg-id 20020310133300.N42776-100000@zoraida.natserv.net
Whole thread Raw
In response to Re: How to check for successfull inserts  ("Arguile" <arguile@lucentstudios.com>)
List 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.


pgsql-general by date:

Previous
From: Francisco Reyes
Date:
Subject: Re: Advice for optimizing queries using Large Tables
Next
From: Francisco Reyes
Date:
Subject: Re: Postgres not starting at boot(FreeBSD) - startup script