Editing
PostgreSQL Cookbook
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Starting and stopping the server == === Starting the server === <pre> $ pg_ctl -l $PGDATA/server.log start </pre> This assumes that `PGDATA` has been defined in the shell profile, e.g. <pre> export PGDATA=`/usr/local/var/postgres` </pre> === Stopping the server === <pre> $ pg_ctl stop -m fast </pre> === Restarting the server === * Run '''pgAdmin 4'''. * Connect to the local server. * '''Tools''' > '''Server Configuration''' > '''pg_hba.conf''' or '''postgresql.conf''' > '''File''' > '''Reload Server''' ==== Restarting manually ==== <pre> $ pg_ctl reload </pre> <div class="alert alert-warning">I am including the information below because it's the most commonly documented method. It did not work reliably on Windows, however. It seems like not every process would be killed, and that some of them would still be attached to port 5432. The service could not be restarted after the server was stopped.</div> The PostgreSQL service name includes the version number. With powershell run with Administrator privileges, navigate to the `bin\` directory in the PostgreSQL installation directory. <syntaxhighlight lang="powershell"> > .\wp_ctl.exe restart -w -D "c:\ProgramData\PostgreSQL\9.4\data\" </syntaxhighlight> * `-w` Wait for the server to stop and start. * `-D` Path to data directory. The version number may be different depending on the installation.<ref>[http://www.postgresql.org/docs/9.4/static/app-pg-ctl.html pg_ctl] (PostgreSQL documentation)</ref> This appears to stop the PostgreSQL service & requires the service to be manually restarted. * '''Start Menu''' > '''Services''' ''(command line: `services.msc`)'' * Check the status of the postgresql service. (Its name will end with the version number.)
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information