cobed95 commented on code in PR #4945:
URL: https://github.com/apache/polaris/pull/4945#discussion_r3511388861


##########
persistence/relational-jdbc/src/main/resources/cockroachdb/schema-v4.sql:
##########
@@ -28,8 +28,8 @@
 --    policy_mapping_record, events, idempotency_records, scan_metrics_report, 
commit_metrics_report
 --  * Compatible with PostgreSQL wire protocol
 
-CREATE SCHEMA IF NOT EXISTS POLARIS_SCHEMA;
-SET search_path TO POLARIS_SCHEMA;
+CREATE SCHEMA IF NOT EXISTS ${schema};

Review Comment:
   I totally agree that schema creation and setting the session search path 
should be done programmatically.
   
   Here's what I think might be a valid concrete implementation.
   
   1. Schema creation is done programmatically at the beginning of 
`executeScript` instance method of `DataSourceOperations`
   2. Session search path is set on `borrowConnection` method of 
`DataSourceOperations`. If we are to avoid quoting schema names as per [this 
comment](https://github.com/apache/polaris/pull/4945#discussion_r3510874198), 
we avoid using JDBC's `Connection.setSchema()` since pgjdbc always quotes the 
schema identifier and this may result in a regression for existing deployments.
   3. Remove references to the schema name in the SQL scripts.
   
   I'd love to hear your thoughts. 



-- 
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