What's New in PSQL v13 R2
 
What's New in PSQL v13 R2
An Overview of New and Changed Features
The General Availability release of PSQL v13 R2, version 13.30, includes new features and changes covered in the following topics:
New File Format
Larger Data Buffers
BTRVEX
AES-192 Encryption
"UPSERT"
Reporting Engine Remote Clients
SQL BIGIDENTITY Support for 8-byte AUTOINCREMENT
ADO.NET Standard Driver
This document may be updated after the release. Download the latest version at the Actian website.
New File Format
The PSQL v13 R2 engine supports a new file format that increases the file size limit to 64 TB and record counts beyond 4 billion. The new file format version is called 13.0.
To fully access a large 13.0 format file – larger in size and record count than 9.5 format files allow – applications must be prepared to handle 8-byte record addresses by use of a new pair of Btrieve entry points: BTRVEX and BTRVEXID.
Applications that use existing BTRV or BTRCALL entry points can continue to use 4-byte record addresses and fully use either 9.5 and 13.0 format files up to the 9.5 format limits. Unmodified BTRV applications can also access 13.0 format files that are larger than the 9.5 format limits so long as the operation does not require explicit record addresses.
The default file format setting for the PSQL v13 R2 engine remains 9.5.
13.0 format files do not support 2GB segmentation.
Client-Server Compatibility
In environments that mix different versions of PSQL, the following things hold true:
A PSQL v13 SP2 or earlier client can access a 13.0 format file on a PSQL v13 R2 engine if the file is at or below the 9.5 format 256 GB size limit.
A PSQL v13 SP2 or earlier cache engine or client reporting engine cannot open a 13.0 format file of any size.
A PSQL v13 R2 cache engine or client reporting engine cannot open files on a PSQL v13 SP2 or earlier engine.
Larger Data Buffers
The new BTRVEX entry points can now support data buffers up to 252 KB. The older BTRV and BTRVCALL entry points are still limited to data buffers less than 64 KB. The larger buffer size is especially useful for Extended Get and Insert operations. Please note that these operations involve record addresses, so you must account for data buffer layout changes when you convert them to BTRVEX.
The descriptors for Get Direct Chunk are still limited to 64 KB, but you can request multiple 64KB chunks in one large data buffer.
BTRVEX
The potentially large size of 13.0 format files and the use of larger data buffers requires run-time values larger than what older Btrieve interfaces have provided. PSQL 13.30 introduces two new entry points: BTRVEX and BTRVEXID. These are very similar to BTRCALL and BTRCALLID, except that some of the function arguments use wider types, and some of the data buffers are laid out differently. The declarations are in btrvexid.h and the implementations are in the same files as BTRCALL. See the latest SDK and Btrieve API Guide for the details about using the new entry points.
For a Btrieve operation that uses a BTRVEX entry point, some values passed in data buffers are wider, such as 8-byte record addresses and record counts. Please note that the 8-byte behavior is due to the BTRVEX entry points and does not depend on the format version of the file being accessed. The following operations require changed data buffer layouts:
Create (14), Create Index (31)
Stat (15)
Get Position (22)
Get Direct (23)
Get Next Extended (36), Get Previous Extended (37)
Step Next Extended (38), Step Previous Extended (39)
Insert Extended (40)
Find Percentage (45)
Stat Extended (65) subfunctions 3 and 8
Unlock (27)
The choice of entry point does not affect record data.
As noted above, the data buffer size argument for BTRVEX is a pointer to a 32-bit integer, where BTRCALL uses a 16-bit integer. Thus, data buffers can be larger than 64 KB.
If you are migrating to the new file format, keep in mind that the position block and client ID values can be used with both BTRCALL and BTRVEX, so it is not necessary to convert all code to BTRVEX at once.
The key number argument for BTRVEX is a 32-bit integer, where BTRCALL uses an 8-bit signed integer. To make it easier to convert existing code to BTRVEX, the BTRVEX entry point remaps key values 128 through 255 to –128 through –1. This accommodates constants that were specified as unsigned bytes (e.g., 0xFE) instead of as signed bytes (e.g., –2).
Client-Server Compatibility
A PSQL v13 R2 client application using BTRVEX can access a PSQL v13 SP2 or earlier engine, except that operations involving explicit record addresses or widened data structures will fail with a status code 137 API mismatch error.
AES-192 Encryption
The 13.0 file format uses AES-192 for long owner name encryption.
"UPSERT"
The INSERT statement has been extended with an ON DUPLICATE KEY UPDATE clause, which implements the behavior popularly known as an “upsert.” If an inserted row matches a unique key already in the table, the ON DUPLICATE KEY clause is invoked for that row. The UPDATE clause has access to both old and new values.
For example, the following query inserts rows with new keys and merges values for rows with existing keys:
INSERT INTO inventory (id, amount) (SELECT id, amount FROM new_stock)
ON DUPLICATE KEY UPDATE inventory.amount = inventory.amount + VALUES(amount)
If an insert is changed to an update, any insert triggers are rolled back before doing the update.
Reporting Engine Remote Clients
The PSQL v13 R2 Reporting Engine now supports remote SQL clients and manages their licenses on the storage engine.
SQL BIGIDENTITY Support for 8-byte AUTOINCREMENT
The Btrieve type 8-byte AUTOINCREMENT, which was introduced in PSQL v13 SP2, is now also supported as the SQL column type BIGIDENTITY.
In addition, PSQL v13 R2 provides the new global variable @@BIGIDENTITY of type BIGINT.
ADO.NET Standard Driver
A new ADO.NET SDK contains an ADO.NET provider meant to work with .NET Standard 2.0 systems, such as .NET Core.
The current release does not offer an EF Core provider at this time.