Ozeki 10
Ozeki NG SMS Gateway
SMS Gateway
Quick Start Guide
SMS with Client Software
SMS from/to Database
MSSQL Express
Oracle SMS
PostgreSQL Installation
Create Database
Configure Database User
Test Message
SAP SQL Anywhere
Microsoft Access
SQL Logging
System Database
Message Server 6
Ozeki 10 SMS Gateway
SMS Wall
IP SMS Gateway
Android SMS
Excel SMS
Bulk Messenger
Developer tools

Ozeki 10 SMS Gateway
MySQL SMS MySQL SMS | PostgreSQL Installation PostgreSQL Installation

SMS from/to PostgreSQL

This chapter gives you great opportunity to see how to send and receive SMS messages through pre-created PostgreSQL database tables. You just need to connect to them with a Database User of Ozeki SMS Gateway. Do not forget to provide the ODBC driver connection string for the user.

How to send SMS from PostgreSQL
PostgreSQL Installation (Video guide)
Create Database Tables (Video guide)
Configure Database User (Video guide)
Send Test Message (Video guide)

Please install two important programs. A simple PostgreSQL database server and an Ozeki SMS Gateway, which is capable to create a Database User and connect to the PostgreSQL database using the connection string. Check this page how to install a Database User. Do not forget to create a separate table for the outgoing and incoming messages. These tables are called 'ozekimessagein' and 'ozekimessageout' in the current example. Send and receive SMS messages by using simple SELECT and INSERT SQL statements on the tables.

Use Ozeki SMS Gateway's browser GUI to install a Database User and provide a connection string similarly as you would do it for other databases (e.g. MSSQL, Oracle, MySQL etc.) PostgreSQL uses an ODBC connection string. Please select 'Odbc' connection string on the Database User's configuration panel as seen on Figure 2 and use this string:

Connection Type:ODBC
Connection String:DRIVER={PostgreSQL ODBC Driver(Unicode)}; SERVER=YourServerIP;port=5432; DATABASE=YourDatabaseName;UID=YourUsername;PWD=YourPassword;
Figure 1 - Example ODBC connection string, which needs to be modified

It works if you modify the variables by using the information of your PostgreSQL database server (Figure 2).

Figure 2 - Modify the connection string variables according to your PostgreSQL database

Install psqlODBC driver

The ODBC driver can be downloaded from:

Install psqlODBC driver by using the downloaded exe file and clicking through the dialog boxes of the installation process.

The psqlODBC driver is needed to create a database connection. It is required to open database connectivity on your ODBC driver, so Ozeki SMS Gateway can connect to your PostgreSQL database.

CREATE tables in PostgreSQL

PostgreSQL accepts simple SQL statements. You can see how to CREATE two separate tables for incoming and outgoing messages in Figure 3.

The CREATE TABLE script in PostgreSQL:

CREATE TABLE ozekimessagein
id serial,
sender varchar(30),
receiver varchar(30),
msg varchar(160),
senttime varchar(100),
receivedtime varchar(100),
operator varchar(100),
msgtype varchar(160),
reference varchar(100)

CREATE TABLE ozekimessageout
id serial,
sender varchar(30),
receiver varchar(30),
msg varchar(160),
senttime varchar(100),
receivedtime varchar(100),
reference varchar(100),
status varchar(20),
operator varchar(100),
errormsg varchar(250),
msgtype varchar(160)
Figure 3 - These statements CREATE two tables in your PostgreSQL database

You can always increase the size of the 'msg' field above 160 characters. You can also change it's data type as well.

It is strongly suggested to maintain the 'id' attribute in all tables. 'id' is basicly the index of each record.

Copyright © 2000- - Ozeki Ltd |
Home > Products > SMS > SMS Gateway > SMS from/to Database > PostgreSQL
Legal | Privacy policy | Terms of use
Page: 5769 | Login |