In the development period of April to September 2024, PolarDB for PostgreSQL (Compatible with Oracle) 2.0 (hereinafter referred to as PolarDB) has achieved significant improvements in terms of compatibility, security, migration capabilities, and drivers. This topic describes the improvements of PolarDB in these aspects in the past six months.
Release notes
Engine compatibility improvements
Only engine compatibility improvements are listed here. For more information, see PolarDB for PostgreSQL (Compatible with Oracle) 2.0 release notes.
Built-in objects
The
number()function is supported. The function call method with quotation marks (such as"TO_CHAR") is introduced as an extension of the case insensitivity feature for better compatibility with function calls in native SQL.Row types of
IS NULLandIS NOT NULLare supported to ensure compatibility with Oracle behaviors.Supports for synonyms, partitions, packages and their bodies, types and their bodies, contexts, directories, languages, operators, tasks, and queues in
DBA_OBJECTSviews are enhanced. The index types andnls_parametersviews inDBA_INDEXESviews are enhanced. These serve the purpose of improving view compatibility.The following issue is fixed:
CHARtypes fail to flow back to Oracle due to semantic differences.The following issue is fixed: Errors are returned for
has_schema_privilegefunctions due to built-in objects.The following issue is fixed: schemas are also included when object names are included in querying views and therefore filtering objects by using view names fails.
The following issue is fixed: The decimal part is not truncated when a
timestamptztype is converted to adatetype.The following issue is fixed: Default values of stored procedure parameters are displayed in the
information_schema.parametersview.The following issue is fixed: The
datetype is not displayed in multiple views of theINFORMATION_SCHEMAdatabase.The following issue is fixed: The stored procedure definition is incompletely displayed in the
DBA_SOURCEview.
SQL syntax
EDITIONTABLE-related keywords are supported to extend compatibility scenarios during structure migration.Multiple special scenarios for using the
DISTINCTandORDER BYkeywords are supported to meet the requirements for using non-standard SQL statements in Oracle.You can enter date strings that slightly mismatch the required formats in the
TO_DATEfunction. This improves compatibility of returned data types of theNVLandCONVERTfunctions.The returned data types of the
'+'operator are compatible with Oracle.Case insensitivity is supported for synonyms to improve compatibility with Oracle.
The keywords in the
SELECTstatement can be used as table aliases to further enhance compatibility with Oracle.Case insensitivity is supported if both uppercase and lowercase letters are included to improve compatibility with non-standard SQL statements.
You can define the session transaction isolation level by executing the
ALTER SESSIONstatement.The
LIKE2,LIKE4, andLIKECoperators are supported.IS NaNandIS INFINITEare supported.The
DISTINCToperation is supported in window functions.The following issue is fixed: If the
btable contains only a row, the semantics of thewhere a in bexpression are inconsistent with Oracle.The following issue is fixed: The range table entry (
RTE) cannot be found when you update synonyms.Multiple issues relate to binding parameters to functions are fixed to improve system stability.
DDL statements
The
CREATE PROFILEstatement is supported to provide new features such as password reuse time, time, and password verify functions and to improving database security.When you use the
ALTER TABLE ... RENAMEstatement to modify table column names, you can use theCOLUMNkeyword.The
CREATE CONTEXTstatement supports theINITIALIZEDclause to further improve compatibility.You can create
PUBLICsynonyms in thePUBLIC SCHEMA.Synonyms for
PACKAGEandTYPE BODYare supported.The
MODIFY COLUMNis supported for compatibility with Oracle.You can execute the
DROP AGGREGATEstatement to delete aggregate functions. This improves compatibility.The
FORCEkeyword is supported inDROPstatements.
Partitioned tables
Indexes can be automatically created for partitioned tables. You want to create global indexes without explicitly using the
GLOBALkeyword.The
REFERENCING OLDclause is supported in partitioned table triggers.The issues related to stability are fixed for creating partitioned tables.
Packages
Package variables can be used as default values for package function parameters.
The
CREATE OR REPLACE PACKAGE BODYstatement is supported.You can use forward declarations to declare private functions in the
package bodyto improve compatibility.The functions and package variables missing in the
DBMS_LOBpackage are supported.
PL/SQL
Transaction commit is supported in functions and function commit is supported in the
SECURE DEFINERstate.The stability issues related to statement-level transactions and autonomous transactions are fixed.
When packages are not instantiated, you can use
cursor % attributeto access cursor attributes in packages.The following issue is fixed: An error is returned when
:new/:oldis used in the declaration segment of a trigger function.The following issue is fixed: When a stored procedure contains
out refcursorand the parameter is NULL, an error is returned for using other internal cursors.The following issue is fixed: Incorrect
object addressesare transmitted from synonyms to a trigger.The following issue is fixed: An error is returned when a foreign table is created due to event triggers created in DDL logical replication.
Collection types
The column_value pseudo column can be used in
TABLEexpressions to access elements in collections.You can use the
record.field().fieldfunction to directly access fields of the collection type in arecord.The
collection_type % typefeature is supported.
Client and driver compatibility
PolarDB-Tools
Compatibility issues are fixed for the PolarDB-Tools feature to improve data compatibility. Specifically, the following issues are fixed:
The compatibility issue when the colon parameter is bound in PostgreSQL.
The compatibility issue of the OnCommitRollback feature.
JDBC
JDBC was updated to V45.4.0.10.4 on September 2, 2024. The following improvements are included in this update:
The issue of incorrect bindings in PL blocks is fixed. This feature is disabled by default to reduce the impact on performance.
Implicit data conversion within a major data type is supported. Character types (such as VARCHAR and CHAR) and numeric types (such as NUMERIC, INTEGER, and DOUBLE) can be converted to each other as INOUT parameters.
The return value of the
getDatabaseProductName()function in the JDBC metadata is updated to“POLARDB2 Database Compatible with Oracle”.The following issue is fixed: In MyBatis, the database cannot correctly infer the parameter type when the registered type of the object entity is TIMESTAMP.
.NET
. NET was updated to 8.0.4.1 on September 18, 2024. Then, PolarDB supports all .NET drivers: .NET 2.0, .NET 3.5, .NET 4.0, .NET 5.0, .NET 6.0, .NET 7.0, and .NET 8.0. Multiple versions such as netcoreapp3.1, netstandard2.0, and netstandard2.1 are supported. The following improvements are included in this update:
Support for 8.0.4.1 and compatibility with .NET 6.0, .NET 7.0, and .NET 8.0.
PL/SQL stored procedures can be executed without specifying the double dollar signs ($$).
PolarDB for PostgreSQL (Compatible with Oracle) 2.0 supports 64-bit date formats.
The following issue is fixed: The built-in objects of the database management system (DBMS) in metadata are not correctly identified.
The following issue is fixed: Data types are not correctly read due to ROWIDs.
pgAdmin4
The pgAdmin4-compatible PolarDB version was released on August 26, 2024. This version can be deployed on Windows systems and is designed for PL/SQL debugging in PolarDB.
Debugging PL/SQL stored procedures is supported.
DTS migration
ADAM evaluation
The latest version of ADAM evaluation is released to improve the accuracy of migration compatibility assessment and keep up with PolarDB syntax updates. The following improvements are included in this update:
The identification accuracy of built-in package and built-in object in ADAM evaluation is enhanced.
The identification of some keywords in the syntax tree is enhanced.
DTS structure migration
The collaboration between PolarDB and DTS has been significantly boosted. The following improvements are included:
The sequence synchronization feature is supported for incremental data.
Structure migration compatibility is enhanced, the case-insensitivity feature is supported, and the issues related to index migration and partitioned table adaptation are fixed.
The compatibility issue of the DATE type is fixed, and the handling of the character type NaN is improved.