/usr/pgsql-9.3/bin/initdb -D /usr/pgsql-9.3/data/
(data資料夾不要手動去建,它自己會建)
幫Postgresql設定密碼(剛裝好是沒有密碼的)
su postgres -c psql postgres
ALTER USER postgres WITH PASSWORD 'your password'
/usr/pgsql-9.3/bin/initdb -D /usr/pgsql-9.3/data/
su postgres -c psql postgres
ALTER USER postgres WITH PASSWORD 'your password'
create role abc123 with nosuperuser inherit nocreaterole createdb login;
select pg_terminate_backend(procpid) from pg_stat_activity a join pg_roles r on a.usename=r.rolname and not rolcanlogin
select id ,time,replace(time::text,to_char(time, 'YYYY'),(to_char(time, 'YYYY')::integer-1911)::text) TW from "Demo" ;
cd "\Program Files (x86)\PostgreSQL\9.1\bin"
C:\Program Files (x86)\PostgreSQL\9.1\bin>pg_ctl -D "C:\Program Files (x86)\Pos
tgreSQL\9.1\data" start