What is Oracle to Azure PostgreSQL schema conversion?

The Oracle to Azure PostgreSQL schema conversion feature in the Visual Studio Code PostgreSQL extension helps you convert your existing Oracle database schema objects into Azure PostgreSQL-compatible definitions. You can use Azure Database for PostgreSQL flexible server or Azure HorizonDB for both schema validation and deployment of the converted schema.

The tool reads Oracle metadata, generates Azure PostgreSQL data definition language (DDL), and checks syntax and structure in a schema validation database. It doesn't migrate table rows or validate equivalent application behavior. Review the output with conversion reports and Conversion Object Explorer, then use GitHub Copilot for explanations and corrections.

To run your first conversion, follow the schema conversion tutorial.

The following diagram shows Oracle schema discovery, AI-assisted conversion, and compilation checks, followed by review and deployment to Azure Database for PostgreSQL flexible server or Azure HorizonDB.

Diagram of Oracle schema conversion with Microsoft Foundry, using Azure HorizonDB or Azure Database for PostgreSQL for compilation checks and a deployment destination.

Architecture

The workflow uses the following components:

Component Role
Oracle source Supplies schema definitions and metadata.
Visual Studio Code PostgreSQL extension Manages the schema conversion project, conversion workflow, and local artifacts.
Microsoft Foundry Hosts the model deployment used for automated conversion.
Schema validation database Provides compilation and available static checks on either supported Azure service.
GitHub Copilot Assists with explanations and object corrections through Ask and Fix.
  • Deployment and testing: Choose your deployment destination on Azure Database for PostgreSQL flexible server or Azure HorizonDB. You decide where to test the converted schema.
  • AI setup: Configure the Microsoft Foundry model deployment and authentication for automated conversion. Sign in to GitHub Copilot separately to use Ask and Fix.

For information about how these services handle schema definitions and code, see the data-handling FAQ.

Install the extension

Schema conversion is built into the PostgreSQL extension published by Microsoft (ms-ossdata.vscode-pgsql). Follow the tutorial prerequisites and installation steps, including Copilot sign-in for the assisted review workflow.

Schema conversion workflow

The workflow starts with discovery, followed by extraction and conversion. The tool validates generated Azure PostgreSQL definitions in a schema validation database, and you review the results in Conversion Object Explorer before preparing deployment files.

Discovery

Discovery follows the Oracle connection and schema selection, before you configure the schema validation database. It checks source permissions and inventories schema objects without extracting DDL. The counts describe the source inventory and planned extraction, not conversion outcomes.

Result What it tells you
Discovered Objects found during discovery.
To be extracted Objects planned for DDL extraction.
Excluded Objects omitted from the planned extraction scope.
Invalid objects Objects flagged as invalid by discovery.

Review object-type support and exclusions, together with schema dependencies, before confirming the scope. Dependent schemas lists referenced schemas that you didn't select. A schema appearing in this list isn't confirmation that it's included in the conversion scope.

For detailed steps, see Review Discovery results in the tutorial.

Extraction

Extraction reads the Oracle DDL and metadata for the reviewed source scope. The extracted definitions provide the input to conversion; successful extraction doesn't mean that an object has been converted.

Conversion

Schema conversion agents use models in Microsoft Foundry to translate the extracted Oracle definitions into PostgreSQL DDL and attempt compilation in the schema validation database. Review both converted and not-converted objects in Conversion Object Explorer, and independently validate behavior before deployment.

Schema validation database

Select an empty database or a dedicated, unused database on Azure Database for PostgreSQL flexible server or Azure HorizonDB for conversion validation. Align the schema validation database's PostgreSQL major version and required extensions with the deployment destination. The tool uses schemas corresponding to the Oracle schemas you select; it doesn't use a separate prefix for validation schemas.

Warning

The tool drops matching schemas with DROP SCHEMA ... CASCADE and recreates them. This action deletes their existing objects and data and can remove dependent objects in other schemas. Don't select a database that contains anything you need to preserve.

The connection user needs permission to connect, create schemas and validation objects, and drop the matching schemas. Database-level CREATE alone doesn't grant permission to drop a schema owned by another role. See Required PostgreSQL privileges.

Compilation and static checks can identify syntax, dependency, and type errors in this environment. They don't test production data, application behavior, or every runtime path.

Conversion Object Explorer

Use Conversion Object Explorer to inspect source-to-target mappings, compare Oracle and PostgreSQL definitions, and read conversion notes. Select Ask for an explanation or Fix for Copilot-assisted corrections to the object and its dependent objects. After successful compilation, the corrected dependent objects are resolved automatically.

Select Resolve to change an object's recorded status to Converted, and then select Refresh to update the conversion reports. A status change doesn't replace compilation or independent application testing. For manual edits, compile the corrected definitions in your selected database and review the execution results.

For detailed steps, see Review converted objects in Conversion Object Explorer.

GitHub Copilot agent mode

Ask and Fix provide object context to GitHub Copilot. Review proposed edits and compilation results before accepting a correction. Copilot assistance doesn't change which objects the converter automatically supports or recover unavailable source code. See Address conversion issues with GitHub Copilot.

Deployment

The Setup Experience generates instructions and scripts that use the object files in postgres_ddl. Review the deployment scope and corrections, and then run setup against your chosen destination. Generating files doesn't deploy them. Review deployment results and independently test data and application behavior.

Oracle connectivity modes

Thin mode doesn't need Oracle Client libraries; thick mode uses them. The extension selects the mode based on the client it detects. Prepare the machine that runs Visual Studio Code for your Oracle connection's requirements, including native network encryption or checksumming. See Oracle client configuration in the tutorial.

Authentication for Microsoft Foundry

Use either a resource API key or Microsoft Entra ID with permission to invoke the model. An API key belongs to the Foundry resource, not an individual deployment. The deployment name identifies the model deployment within that resource. Follow the Foundry authentication prerequisites and the wizard configuration steps.

Security and networking

When you use the schema conversion feature, ensure your Visual Studio Code environment can securely connect to both your source Oracle database and the Azure Database for PostgreSQL flexible server or Azure HorizonDB cluster that hosts the schema validation database.

Microsoft recommends connecting to your Microsoft Foundry resource by using a private endpoint. For more information, see Configure a private link for Microsoft Foundry.

For model data handling, see Data, privacy, and security for Foundry Models.

Diagram of how Visual Studio Code connects to a private endpoint.

Important

Foundry conversion output and Copilot suggestions both require independent review. Compilation and AI-assisted review don't establish equivalent business logic or production readiness. Test data handling, dependencies, security controls, and application behavior before production use.

Supported schema objects

The tool converts common Oracle schema and code objects. Support for an object type doesn't mean that every source definition converts completely. Check the limitations and the results for your own source objects.

A Converted status records an outcome; it doesn't certify compilation, complete implementation, or deployment inclusion. Inspect definitions and notes, including placeholders and dependencies.

Database schema objects

Supported object types include tables, constraints, B-tree and unique indexes, sequences, row-level and statement-level triggers, views, materialized views, schemas, and public and private synonyms. Oracle-specific storage, refresh, and synonym behavior can require manual work.

Oracle code objects

Supported code constructs include packages, functions, procedures, trigger logic, object types and type bodies, and collections such as VARRAY, nested tables, and SUBTYPE declarations. Review member implementations and callers, not just the parent object's status.

Package conversion

Package members can map to multiple PostgreSQL definitions. Review generated state helpers, constants, collections, cursors, and exception handling. Specification-only packages can produce placeholders. See complex-object validation guidance and package review in Conversion Object Explorer.

Hierarchical queries

Review generated WITH RECURSIVE queries against the Oracle results, including roots, ordering, paths, and cycles. Compilation alone doesn't validate those results.

Transaction control

Routines that use PRAGMA AUTONOMOUS_TRANSACTION can depend on dblink and changes to their callers. Independently validate connections, transaction boundaries, and error handling; see complex-object validation guidance.

Validate converted PL/pgSQL with plpgsql_check

Creating a PL/pgSQL routine doesn't validate every executable path. Where supported and configured, plpgsql_check adds static checks of routine bodies in the schema validation database. Without it, those additional checks aren't available. Neither compilation nor a Converted status proves they ran or that behavior matches Oracle. For availability, preload, and installation steps, see Allow and install required extensions.

Supported Oracle versions

Schema conversion supports the following Oracle database versions. For the conversion environment and PostgreSQL requirements, see the tutorial prerequisites.

  • Oracle 21c
  • Oracle 19c
  • Oracle 18c
  • Oracle 12.2
  • Oracle 12.1

PostgreSQL extension support

To report a bug or request a feature, file an issue on the vscode-pgsql GitHub repository. Prefix the issue title with Schema Conversion:. For bugs, include the extension version, failed stage, and relevant redacted error messages. Remove credentials, secrets, and sensitive schema details before sharing.