Today I read The Surprising Impact of Medium-Size Texts on PostgreSQL Performance which popped up on reddit.
Tag Archives: postgresql
Administering PostgreSQL
Reply
So I found this article which said:
$ sudo -u postgres psql
postgres=> alter user postgres password 'apassword'; postgres=> create user your-user createdb createuser password 'passwd'; postgres=> create database your-db-name owner your-user; postgres=> \q
Note: to enable password logins for the ‘postgres’ admin account, edit: /etc/postgresql/9.4/main/pg_hba.conf and after this line:
local all postgres peer
Add this line:
local all postgres md5
How do I list all databases and tables using psql?
So I found this which said:
- \list or \l
- list all databases
- \dt
- list all tables in the current database
C++ PostgreSQL example
Just followed this tutorial on how to create a basic C++ app that talks to a PostgreSQL database…
Add Column BEFORE/AFTER another column in PostgreSQL
I wanted to add a new column to my table after the first column, like you can in MySQL. Turns out you can’t do that…
PostgreSQL date/time support
Reading about date/time support in PostgreSQL…
Creating a user and database in PostgreSQL
To create a database and user account for use on PostgreSQL:
root@devotion:~# su - postgres postgres@devotion:~$ psql psql (8.4.21) Type "help" for help. postgres=# create user "www-data" superuser; CREATE ROLE postgres=# create database mydb with owner "www-data"; CREATE DATABASE postgres=# \c mydb psql (8.4.21) You are now connected to database "mydb". ^ mydb=# alter user "www-data" with password 'secret'; ALTER ROLE
Installing PostgreSQL on Debian
Postgres is only an apt-get away!
# apt-get install postgresql postgresql-client
To integrate with PHP PDO:
# apt-get install php5-pgsql
psql fatal role does not exist
I was setting up a postgres server and I got the message “psql fatal role ‘user’ does not exist”. Found a solution over here, basically:
CREATE USER jj5 SUPERUSER; CREATE DATABASE dbname WITH OWNER jj5;