Thread: Is there is shutdown utility for postgresql?

Is there is shutdown utility for postgresql?

From
"Jeff Lu"
Date:
Is there another to shutdown the database other than "kill" or ctrl-C?

Is there a utility or script for shutdown?

Re: Is there is shutdown utility for postgresql?

From
"Jeffrey W. Baker"
Date:

On Tue, 15 Jan 2002, Jeff Lu wrote:

>
> Is there another to shutdown the database other than "kill" or ctrl-C?
>
> Is there a utility or script for shutdown?

pg_ctl stop

-jwb


Re: Is there is shutdown utility for postgresql?

From
Paul Tomblin
Date:
Quoting Jeff Lu (jklcom@mindspring.com):
>
> Is there another to shutdown the database other than "kill" or ctrl-C?

Probably a simple "pg_ctl stop" would do it most of the time, but this is
what it does on RedHat 7.2.

stop(){
    # Check for postmaster already running... exit if this happens
    pid=`pidof -s postmaster`
    if [ "$pid" == "" ]; then
        rm -f /var/run/postmaster.pid
        rm -f /var/lock/subsys/postgresql
        exit 0;
    fi
    echo -n $"Stopping postgresql service: "
    # Check for older PGDATA location.
    if [ -f /var/lib/pgsql/PG_VERSION ] && [ -d /var/lib/pgsql/base/template1 ]
    then
        export PGDATA=/var/lib/pgsql
    else
        export PGDATA=/var/lib/pgsql/data
    fi
    su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl stop -D $PGDATA -s -m fast" > /dev/null 2>&1
        ret=$? # This will always be 0, as the return code doesn't propagate... Fix that some day.
        if [ $ret -eq 0 ]; then
        echo_success
        else
            echo_failure
        fi
    echo
    rm -f /var/run/postmaster.pid
    rm -f /var/lock/subsys/postgresql
}

--
Paul Tomblin <ptomblin@xcski.com>, not speaking for anybody
Real Time, adj.:
    Here and now, as opposed to fake time, which only occurs there
and then.

Re: Is there is shutdown utility for postgresql?

From
"Artigas, Ricardo Y."
Date:
never 'kill -9' the postmaster. use postgresql command. check your
/etc/rc.d/init.d/ directory for postgresql script.

:~)
Ricky Y. Artigas
Database Administrator /
Analyst/Programmer
Information Technology Division
Easycall Communications Phils., Inc.
> -------------------------------
> IMPORTANT NOTICE:

> This message (and any attachment hereto) may contain privileged and/or
> confidential information specific to EasyCall. If you are not the intended
> addressee indicated in this message, you may not copy or disseminate this
> message (or any attachment hereto) to anyone. Instead, please destroy this
> message (and any attachment hereto), and kindly notify the sender by reply
> email. Any information in this message (and any attachment thereto) that
> do not relate to the official business of EasyCall shall be understood as
> neither given nor endorsed by the company.
>
>
> -----Original Message-----
> From:    Jeff Lu [SMTP:jklcom@mindspring.com]
> Sent:    Wednesday, January 16, 2002 9:45 AM
> To:    pgsql-general@postgresql.org
> Subject:    [GENERAL] Is there is shutdown utility for postgresql?
>
>
> Is there another to shutdown the database other than "kill" or ctrl-C?
>
> Is there a utility or script for shutdown?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly