GRANT privilege [, …] ON object [, …] TO { PUBLIC | GROUP group | username }
Grant insert privilege to all users on table films:
GRANT INSERT ON films TO PUBLIC;
Grant all privileges to user manuel on view kinds:
GRANT ALL ON kinds TO manuel;
授權admin角色給root用戶
GRANT "ADMIN" TO root
授權book數據庫給root用戶
GRANT Connect,Create,Temporary ON DATABASE "book" TO "root"
Make a user superuser
ALTER USER myuser WITH SUPERUSER;
ALTER USER username WITH NOSUPERUSER;
D:\DB\PostgreSQL\16\bin
–h is host name
-p is port number
-d is database name
-U is for user name
psql -h localhost -p 5432 -d postgres -U postgres
select version();
PostgreSQL 8.4.20 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11), 64-bit
pg_dump -h 192.168.1.1 -U uesername dbname > dbname.pgsql
./psql -U postgres dbname<d:/db.pgsql
SELECT * FROM information_schema.columns WHERE "column_name" ='al_fg'