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

   ##  Understanding
   
     - On 5.3.2 Proxy (PostgreSQL) with single tables enabled, SHOW SINGLE 
TABLES LIKE 't_app_mon%' lists partition child tables on ds_8, but queries 
without schema (parent or child) route to ds_0 and fail with “relation does not 
exist.” Only queries with the actual schema
       (e.g., xxx.t_app_mon_p202112) hit ds_8.
   
   ##  Root Cause
   
     - ShardingSphere-Proxy currently fixes the default schema to public and 
does not support PostgreSQL search_path. Without an explicit schema, parsing 
assumes public; if no single-table metadata matches, routing falls back to the 
default single-table storage unit (shown
       as RANDOM, effectively ds_0).
     - 5.3.2 does not support PostgreSQL partition parent tables (relkind='p'); 
parent tables are not registered into single-table metadata, so even with 
schema they fall back to the default route.
   
   ##  Analysis
   
     - SHOW SINGLE TABLES listing only child partitions (not the parent) shows 
metadata is built from physical child tables.
     - Logs sending schema-less SQL to ds_0 align with the default public 
assumption and fallback behavior.
     - Adding schema and querying the child partition routes to ds_8, 
confirming single-table config works; the issues are default schema handling 
plus unsupported partition parents.
   
   ##  Conclusion
   
     - Behavior matches current limitations rather than a confirmed defect. 
Recommendations:
         1. Always specify the schema in SQL; Proxy does not support 
search_path, so use public as the default schema.
         2. Avoid relying on PostgreSQL partition parent tables in Proxy; query 
child partitions directly or use ShardingSphere sharding rules instead of 
database partitions.


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