PostgreSql Scripts |
---|
|
[2015-05-20] |
|
PostgreSQL 9.4.1 Documentation
PostGIS 2.1.8 Manual
-- login
# su - postgres
# in windows, current user doesn't matter
c:path opsql.exe -U postgres
-- Creating a Database Cluster
$ initdb -D /usr/local/pgsql/data (or)
$ pg_ctl -D /usr/local/pgsql/data initdb
As an alternative to the -D option, you can set the environment variable PGDATA
-- Starting the Database Server
$ postgres -D /usr/local/pgsql/data
$ postgres -D /usr/local/pgsql/data >logfile 2>&1 & (start in the background)
pg_ctl start -l logfile (use pg_ctl tool to start server in the background)
su postgres -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' (if not use postgres account)
-- Shutting Down the Server
(SIGTERM, SIGINT, SIGQUIT, SIG=Signaling)
pg_ctl - starts/stops/restarts the PostgreSQL server
$ kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid` (do not use)
-- kill a query or session
pg_cancel_backend(pid int)
pg_terminate_backend(pid int)
-- pid and configuration files
under C:/Program Files/PostgreSQL/9.4/data
postgresql.conf to change configurations (case sensitive)
postmaster.pid to find pid sessions
|
[说明] PostgreSql documentations and scripts |
|
声明: 海外华人网所有刊载文章仅供参考,不构成投资或行动建议。欢迎免费引用,引用时需注明文章来源:海外华人网(haiwaihuaren.com) |