While reading around in pg_upgrade code I came across the slightly
bizarre function

void exit_nicely(bool need_cleanup)

The parameter doesn't actually determine whether any cleanup is done.
The "cleanup" is done anyway and the parameter only controls the exit
code in a backwards way.

Also most of the cleanup appears to be useless, because you don't need
to close files or free memory before the program exits.

I figured this could be written more cleanly with an exit hook, so here
is a patch. I don't care much whether this patch is for now or later,
just wanted to throw it out there.

Search Discussions

  • Bruce Momjian at Mar 31, 2011 at 8:54 pm
    Feel free to apply this to HEAD.

    ---------------------------------------------------------------------------

    Peter Eisentraut wrote:
    While reading around in pg_upgrade code I came across the slightly
    bizarre function

    void exit_nicely(bool need_cleanup)

    The parameter doesn't actually determine whether any cleanup is done.
    The "cleanup" is done anyway and the parameter only controls the exit
    code in a backwards way.

    Also most of the cleanup appears to be useless, because you don't need
    to close files or free memory before the program exits.

    I figured this could be written more cleanly with an exit hook, so here
    is a patch. I don't care much whether this patch is for now or later,
    just wanted to throw it out there.
    [ Attachment, skipping... ]
    --
    Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
    To make changes to your subscription:
    http://www.postgresql.org/mailpref/pgsql-hackers
    --
    Bruce Momjian <bruce@momjian.us> http://momjian.us
    EnterpriseDB http://enterprisedb.com

    + It's impossible for everything to be true. +

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedMar 31, '11 at 8:31p
activeMar 31, '11 at 8:54p
posts2
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Bruce Momjian: 1 post Peter Eisentraut: 1 post

People

Translate

site design / logo © 2022 Grokbase