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 details similarly as you would do it for other databases (e.g. MSSQL, Oracle, MySQL etc.)

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


Figure 1 - Modify the connection string variables according 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 2 - 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 | info@ozeki.hu
Home > Developers guide > SMS from SQL > PostgreSQL
Legal | Privacy | Terms of use | 5769
3.228.10.34 | 92.118.27.157 | Login