Erwin Harahap

do Now or Never

Accessing PostgreSQL from C++

Posted by Erwin on March 21, 2009

Book :
Practical PostgreSQL

Installing PostgreSQL
Choose Applications then add and remove software

Login as the root user and enter the command:
# yum install postgresql postgresql-server

rpm -qa | grep -i postgres/d

Adding the postgres User
$ su – -c “useradd postgres”

Start PostgreSQL
/etc/init.d/ ./postgresql start

Creating a database
$ createdb testdb
$ psql testdb

Create and Input table

=> CREATE TABLE address(name varchar(50), tel int, email varchar(50));

=>INSERT INTO address(name, tel, email) values(‘suzuki’,11,’’);

List of Relation

View table
=>select * from address

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: