Load Definitions for PostgreSQL

The Load Definitions functionality is supported for PostgreSQL databases.

Functionality

The Load Definitions utility for PostgreSQL loads tables, views, columns, and indexes.

It does not load relationships and foreign keys.

Configuration

Before loading definitions from PostgreSQL:

  • Specify the PGS must connector in the [DRIVERS] section of the IDE assignment file.
  • Specify the $PGS path in the [PATHS] section of the IDE assignment file.

For more detailed instructions, see Import Data Definitions From a DBMS.

Data Type Mapping

The Load Definitions utility maps PostgreSQL data types to Uniface data types and packing codes. The following table lists these mappings.

For text data, when the database character set is Unicode UTF-8, strings are mapped to W packing codes (W, VW, SW). Otherwise, C packing codes are used (C, VC, SC).

Load Definitions Support for Microsoft SQL Server Data Types

PostgreSQL Data Type

Supported by Load Definitions

Uniface Data Type

Uniface Packing Code

Remarks

 

boolean

Yes

B

B4

Boolean. In PGS, values 1 = t, 0 = f, Null = unknown are allowed

character(n), char(n)

Yes

S

Cn or Wn

Fixed length data type. n is the string length, which must be a value from 1 through 65535.

Character varying(n), varchar(n)

Yes

S

VCn or VWn

Variable-length data type with limit character string. n is the string length, which must be a value from 1 through 65535.

text

Yes

S

SC* or SW*

Variable unlimited length character string

smallint, int2

Yes

N

I2

Range -32,768 to 32,767.

integer, int, int4

Yes

N

I4

Range -2,147,483,648 to 2,147,483,647

bigint, int8

Yes

N

I8

Range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Data range in DBMS is larger, so a warning is issued about the range difference.

decimal(p,s) and numeric(p,s)

Yes

N

N(p+1).s, N(p+1)

pis precision (total number of digits); for Uniface p must be 30 max, field is skipped with a warning if p is larger.

sis scale (number of decimal places); for Uniface s must be smaller than p, field is skipped with a warning if they are equal.

s=0 generates N(p+1), rather than N(p+1).0

A ValRep is generated to enforce the exact DBMS max/min values during data entry and store validation; the ValRep range depends on p and s.

real, float4

Yes

F

F4

DBMS allows range -1e+37 to 1e+37, while Uniface allows -1e+38 to 1e+38

Uniface will read the full range, but storing the extreme values results in an ODBC error. Generated with a warning.

double precision, float8

Yes

F

F8

DBMS allows range -1e+307 to 1e+308, while Uniface allows -1e+38 to 1e+38

Uniface will read the full range, but storing the extreme values results in an ODBC error. Generated with a warning.

date

Yes

D

D

DBMS allows range 4713 BC to 5874897 AD. Uniface does not allow BC dates.

Generated with a warning about the differences.

time without time zone

Yes

T

T

DBMS time resolution is 1 microsecond / 14 digits. Uniface accuracy is limited to ticks.

Generated with a warning about the differences.

timestamp with time zone

Yes

E

E

DBMS allows range 0001-01-01 through 294276 AD, and time resolution is 1 microsecond / 14 digits. Uniface accuracy is limited to ticks.

Generated with a warning about the differences.

bytea

Yes

R

SR*

Variable-length binary string. 1 or 4 bytes plus the actual binary string

uuid

Yes

S

C36

 
Other data types       Mapping not possible: field is skipped with a warning.

Related Topics