The root of postgresql is called 'postgres'. See details below:
Change forgotten PostgreSQL password
Some common postgresql commands:
- psql -l -- list all databases
- psql -U [user] -W -d testdb -- login using password
In psql shell:
- \l -- list all databases
- \du -- list users
- \c [database] -- switch to a database
- \dt -- list tables in a database
- \d [table] -- describe a table (\d+ does the same thing)
- \dv -- list views in a database
Check syntax: use "EXPLAIN". E.g.: EXPLAIN Select * from Table1
PostgreSQL ODBC driver (psqlODBC): Download here.
By default postgresql allows only local connection. To enable remote connection you need to change 2 configuration files [1]:
1) vi /var/lib/pgsql/data/pg_hba.conf
add this line: host all account_name 100.100.100.100/32 md5
2) vi /var/lib/pgsql/data/postgresql.conf
add this line: listen_addresses = '*'
Then you need to restart the postgresql server, similar to this:
sudo /sbin/service postgresql restart
[1] How Do I Enable remote access to PostgreSQL database server?
[2] PostgreSQL SQL Syntax and Use
Showing posts with label Postgresql. Show all posts
Showing posts with label Postgresql. Show all posts
Friday, February 17, 2012
Subscribe to:
Posts (Atom)
Blog Archive
-
▼
2026
(36)
-
▼
June
(19)
- C10K to C10M: from thread-per-connection model to ...
- Benchmark server performance
- Application server for php, python, java, node.js,...
- Application server for C++, Go and Rust
- Nginx as reverse proxy and load balancer
- Infrastructure running: nginx, apache, php, python...
- Flow chart of nginx+apache+uvcorn infrastructure
- Flow chart of apache+uvcorn infrastructure
- Uvicorn and Gunicorn
- What's deadsnakes PPA
- What's the optional lsb-core package
- Codex known logging bug
- Daemonsize a service
- Train text to image model, to generate images of c...
- Train a model based on OpenAI API
- Open port 8080 for WebSocket
- Add websocket support on Bluehost Ubuntu VPS for D...
- Install Claude Code on ubuntu VPS of Bluehost
- Install PostgreSQL on Mac
-
▼
June
(19)