terrymanu commented on issue #26203:
URL: 
https://github.com/apache/shardingsphere/issues/26203#issuecomment-3627909364

   ##  Issue Understanding
   
     When migrating from PostgreSQL 15, the pipeline fails during DDL 
preparation with column "datlastsysoid" does not exist, which stops the 
migration.
   
   ##  Root Cause
     The PostgreSQL metadata lookup in the migration module still queries the 
legacy pg_database.datlastsysoid column to obtain a database identifier; this 
column was removed in PostgreSQL 15, so the query fails.
   
   ##  Analysis
   
     - The stack trace shows PostgreSQLTablePropertiesLoader.fetchDataBaseId 
querying pg_database and relying on datlastsysoid.
     - PostgreSQL 15 dropped this column; we should switch to a compatible 
field (e.g., oid) or another officially supported way to fetch the database 
identifier.
     - No compatibility branch exists for PG 15 in the current code path, so 
migrations on PG 15/15+ will always hit this failure.
   
   ##  Conclusion
     This is a PostgreSQL 15 metadata compatibility gap; the pipeline must stop 
depending on datlastsysoid.
   
   ##  Fix Suggestion
   
     - In PostgreSQLTablePropertiesLoader.fetchDataBaseId (and related 
templates), remove the datlastsysoid dependency and use pg_database.oid or 
another supported column to obtain the database identifier, ensuring 
compatibility across PG 12–15+. Example (adjust to actual
       classes/templates):
   
       // Example: fetch current database oid without relying on datlastsysoid
       SELECT oid FROM pg_database WHERE datname = current_database();
     - Add/update PG 15 pipeline migration integration tests to confirm the 
preparation phase no longer fails due to the missing column.
   
     Community contributions are warmly welcomed—please feel free to submit a 
PR with the code change and tests to improve PG 15 migration compatibility!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to