Re: Hungry postmaster

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: ilejn(at)yandex(dot)ru, iharding(at)destinydata(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Hungry postmaster
Date: 2005-06-17 12:41:43
Message-ID: 20050617124139.GA21734@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 16, 2005 at 10:32:46AM -0400, Tom Lane wrote:
> "Ilja Golshtein" <ilejn(at)yandex(dot)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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2005-06-17 12:43:21 Re: Backing up multiple databases
Previous Message Jose Gonzalez Gomez 2005-06-17 12:35:01 Foreign key to a view (UNION of two or more tables), any alternative?