Showing posts with label PostgreSQL. Show all posts
Showing posts with label PostgreSQL. Show all posts

Tuesday, July 31, 2012

Install PostgreSQL 9.1.4 on Ubuntu 12.04

To install PostgreSQL 9.1.4

Add already compiled ppa key
$ sudo add-apt-repository ppa:pitti/postgresql

Update you're repo & install postgres
$ sudo apt-get update
$ sudo apt-get install postgresql

Logged as postgres user and create database , user and grant all permission to users for database.

postgres$ psql template1
psql (9.1.4)
Type "help" for help.
template1=#

For creating user and database, refer this guide

Saturday, June 23, 2012

Rails 3 tips - Create project with different database(MySQL,PostGresSQL,JDBC,SQL SERVER, etc)

Here are commands to create Rails 3 application with different database

MySQL
rails new app --database=mysql

ORACLE
rails new app --database=oracle

PostgreSQL
rails new app --database=postgresql

SQLite3
rails new app --database=sqlite3

FrontBase
rails new app --database=frontbase

IBM DB
rails new app --database=ibm_db

SQL SERVER
rails new app --database=sqlserver

JDBC
rails new app --database=jdbc

JDBC MySQL
rails new app --database=jdbcmysql

JDBC PostgreSQL
rails new app --database=jdbcpostgresql

JDBC SQLite3
rails new app --database=jdbcsqlite3

Saturday, April 21, 2012

An error occured while installing pg (0.13.2), and Bundler cannot continue - Rails 3 & PostgreSQL issues


"An error occured while installing pg (0.13.2), and Bundler cannot continue.
Make sure that `gem install pg -v '0.13.2'` succeeds before bundling"

Reason for this error could be "failed to build gem native extension", so make sure you have installed PostgreSQL headers properly.

For Ubuntu/Linux flavor, Use following command to install PostgreSQL client and development package

sudo apt-get install libpq-dev

Hope it may helpful to rectify you're problem with rails 3 application with PostgreSQL.

Friday, March 2, 2012

PostgresSQL - Release 9.1.3, 9.0.7, 8.4.11 and 8.3.18!

PostgresSQL has been announced security and maintenance release of versions 9.1.3, 9.0.7, 8.4.11 and 8.3.18 last week.

Bug and performance fixes in this minor release include


* Fix btree index corruption from insertions concurrent with vacuuming
* Avoid crashing when we have problems deleting table files post-commit
* Fix recently-introduced memory leak in processing of inet/cidr
* Fix postmaster to attempt restart after a hot-standby crash

Download and release announcement available here.

Saturday, September 17, 2011

Install PostgreSQL 9.0 on Ubuntu 11.04

To install PostgreSQL 9.0

Add already compiled ppa key
$ sudo add-apt-repository ppa:pitti/postgresql

Update you're repo & install postgres
$ sudo apt-get update
$ sudo apt-get install postgresql

Logged as postgres user and create database , user and grant all permission to users for database.

postgres$ psql template1
postgres$ create database testdb;
postgres$ CREATE USER testuser with password 'testuser';
postgres$ GRANT ALL PRIVILEGES ON DATABASE testdb to testuser;

Hope it may help you to install and configure postgres.

Monday, April 18, 2011

PostgreSQL - Create a user, a database and grant accesses

These steps will let you create a user, a database (DB) and grant full access to the user to this DB.

All the commands are executed as the "postgres" privileged user.

For this, you use the command createuser which is provides with the postgreSQL package.
postgres@hostname:~$ createuser
Enter name of role to add: user
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
CREATE ROLE
postgres@hostname:~$

Create the DB

postgres@hostname:~$ createdb testdb
CREATE DATABASE
postgres@hostname:~$

Grand access for the user to the DB

postgres@hostname:~$ psql
postgres=# alter user user with encrypted password 'password';
ALTER ROLE
postgres=# grant all privileges on database testdb to user;
GRANT
postgres@hostname:~$ 
Hope it may work for you. If you have any issues please let me know.