Erwin Harahap

do Now or Never

Accessing PostgreSQL from C++

Posted by Erwin on March 21, 2009

Book :
Practical PostgreSQL
http://www.faqs.org/docs/ppbook/book1.htm

Installing PostgreSQL
Choose Applications then add and remove software

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

Verify
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
CREATE DATABASE
$ 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,’suzuki@yahoo.com’);

List of Relation
=>\d

View table
=>select * from address

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
%d bloggers like this: