The permission error caused when trying to dump/copy ">" to a directory where you as user "postgres" have no permission.
In root make a new directory and change the permission for the postgres. Dump the database(s) in the new directory.
and this is what I get:
db_str_and_data.out: Permission denied
db_structure_and_data.out: Permission denied
pg_dumpall -a > db_data_only.out: Permission denied
pg_dumpall -s > db_structure_only.out: Permission denied
psql mydb < db_structure_and_data.out: Permission denied
Start postgreSQL:
# /etc/rc.d/postgresql start
Login username "postgres":
# su - postgres
# psql -l (view all databases)
Create an username (first login postgres):
# createuser mysamplename -P
Create a database:
# createdb mydb -O mysamplename
Is what comes just for showing how to remove the database & username, or is it part of the tutorial that I have to follow?
Remove database:
# dropdb mydp <---(do you mean mydb?)
Remove username:
#dropuser mysamplename
Also, the following part:
Dump:
# pg_dump mydb > db_str_and_data.out (single database)
# pg_dumpall > db_structure_and_data.out (all databases)
# pg_dumpall -a > db_data_only.out
# pg_dumpall -s > db_structure_only.out
Load:
# psql mydb < db_structure_and_data.out
Do I have to choose single database, all databases or both? Thanks again.
]]>Start postgreSQL:
# /etc/rc.d/postgresql start
Login username "postgres":
# su - postgres
# psql -l (view all databases)
Create an username (first login postgres):
# createuser mysamplename -P
Create a database:
# createdb mydb -O mysamplename
Remove database:
# dropdb mydp
Remove username:
#dropuser mysamplename
Dump:
# pg_dump mydb > db_str_and_data.out (single database)
# pg_dumpall > db_structure_and_data.out (all databases)
# pg_dumpall -a > db_data_only.out
# pg_dumpall -s > db_structure_only.out
Load:
# psql mydb < db_structure_and_data.out
Download phpPgAdmin to admin and maintain databases.
To login phpPgAdmin, don't use username postgres but your newly created username.
I am not sure if there is an Arch package. If not, then check here:
http://phppgadmin.sourceforge.net/
PostgreSQL Tutorial:
http://www.eskimo.com/support/PostgreSQL/tutorial/
To use PHP web interface running postgreSQL, untag this line in /etc/php.ini
;extension=pgsql.so (remove ";")