On Thu, Jun 16, 2005 at 10:32:46AM -0400, Tom Lane wrote:
> "Ilja Golshtein" <ilejn@yandex.ru> writes:
> > To be honest, I don't quite understand why PG does 'send' again and again, while
> > EPIPE seems to be unrecoverable.
> > Isn't it better to terminate server process?
>
> No. See previous discussions in the archives.
>
> (One point is that a long-running query isn't necessarily generating any
> output, anyway, so this wouldn't be a magic cure for anything.)
Ok, so I did look through the archives [1] and came up with your
following example:
> As an example: whether an UPDATE command completes might depend on
> whether any invoked triggers try to issue NOTICEs.
So you are saying if I start a really long update on a remote server
and my computer crashes, the UPDATE should complete even though it
cannot communicate that result. (-EPIPE is non recoverable_
Not quite what I expected, but that means that you should *always*
explicitly use BEGIN and COMMIT if you want to know whether or not a
query has actually successfully completed. Otherwise it can complete
without you being aware of it.
Actually, this explains a crash we had recently. Somoeone had typed in
a more-tuples-than-atoms-in-the-universe query and then closed the
terminal without realising it. A few days later the machine ran out of
memory and died. Normally the client runs out of memory first but
without a client it just keeps on going.
[1] http://archives.postgresql.org/pgsql-hackers/2005-05/msg01386.php
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.