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