ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
3.5k stars 491 forks source link

[pg] ignore from pg_settings in set_config queries #4284

Open qrort opened 1 month ago

qrort commented 1 month ago

Rewrite queries such as SELECT set_config(\'bytea_output\',\'hex\',false) FROM pg_settings WHERE name = \'bytea_output\'; into SELECT set_config(\'bytea_output\',\'hex\',false) if FROM clause contains pg_settings table.

qrort commented 1 month ago

In the future we could force a query to execute as single stage. In such cases, we can execute SELECT set_config(\'bytea_output\',\'hex\',false) FROM pg_settings WHERE name = \'bytea_output\';