PostgreSQL

This section contains information on the configuration and the data type mapping of PostgreSQL databases with ODBC.

Declaration in the TwinCAT Database Server Configurator

ODBC PostgreSQL database

Database Type

"Odbc_Database"

ODBC Type

Select "PostgreSQL" from the drop-down menu.

Driver

Select here the actually installed driver.

Server

Enter the name or IP address of your server.

Database

Enter the name of the database.

Port

Enter the port for communicating with the PostgreSQL database. Default: 5432.

Uid

Enter the user name here.

Pwd

Enter here the corresponding password.

Data type mapping between DB and PLC

E_ColumnTypes

PostgreSQL

TwinCAT PLC

BigInt

BIGINT

T_ULARGE_INTEGER (TcUtilities.lib)

Integer

integer

DINT

SmallInt

smallint

INT

TinyInt

smallint

INT

Bit_

bit

BYTE

Money

money

LREAL

Float

Double precision

LREAL

Real_

real

REAL

DateTime

timestamp

DT

NText

text

STRING

NChar

character

STRING

Image

byte

ARRAY OF BYTE

NVarChar

Character varying

STRING

Binary

byte

ARRAY OF BYTE

VarBinary

byte

ARRAY OF BYTE

PostgreSQL 1:

Data type support

This database supports the data type WSTRING. The character set must be set up when the database is created.

PostgreSQL 2:

Functioning

All functions of the TwinCAT Database Server can be applied to the ODBC templates. This does not apply to the "Free Connection String".

Notice

Data security

In flash memory devices the number of write access operations is limited. The flash memory devices can fail, with a risk of data loss.

  • Make regular backups of your system. Use the IPC diagnostics in order to determine the status of the flash memory devices.