Tech-Today
How to setup postgresql in ubuntu 11.10 and perform dump/restore
This write up will try to explain how to install postgresql and attempt to perform database dump and restore. Which should be a basic functionality but is not present in pgadmin.
1.) Install postgresql (execute in terminal):
sudo apt-get install postgresql postgresql-contrib
2.) Setup postgres user:
sudo -u postgres psql
alter user postgres password 'postgres'
//close the terminal after.
3.) To check install pgadmin via "Ubuntu Update Center", and try to login using postgres/postgres account.
4.) Perform dump/restore. But before performing the ff commands, you should login as postgres first:
sudo su postgres
+Create the dumps:
//dump the roles
pg_dumpall -g -U postgres > roles.sql
+Dump the schema
pg_dump -Fp -s -v -f schema.sql -U postgres databaseName
+Dump the data
pg_dump -Fc -v -f data.dump -U postgres databaseName
+How to restore
psql -f roles.sql
psql -f schema.sql databaseName
pg_restore -a -d databaseName -Fc data.dump
Note: Got this somewhere else, just added some more statements.
-
Run Wildfly And Postgresql In Docker
Docker is a great tool to simulate a development environment. Not only that but it also makes that environment portable by having a docker/docker-compose configuration file. And that is what this blog is all about. We will launch a pre-configured docker...
-
How To Import And Export A Database Dump In Oracle
The following instruction will help us in importing and exporting our oracle database. Create and restore dump file (http://www.database.fi/2011/05/using-expdp-and-impdp-export-and-import-in-10g-11g/)Create dump filesqlplus system/oracleSQL> create...
-
Database
MSSQLMSSQL equivalent of DESC in MYSQLPostgresqlChange postgresql's postgres passwordHow to install hstore in postgresql 9.1JDBC provider setting in java for postgresql, mysql and oracleHow to alter the sequence value in postgresqlOracleHow to change...
-
How To Install Hstore In Postgresql 9.1
Recently, we've use hstore data type in our database because of its key, value pair functionality and here's how I install hstore in my ubuntu 12.04: 1.) execute in terminal >sudo apt-get update >sudo apt-get install postgresql-contrib-9.1...
-
Change Postgresql's Postgres Password
This is how you would change your postgresql's user postgres password, in case you forgot it. This is done in ubuntu 12.04. 1.) Logon to your postgres account in behalf of root: >sudo -u postgres psql template1 //enter your password Now you're...
Tech-Today