ossc-db / pg_hint_plan

Extension adding support for optimizer hints in PostgreSQL
Other
696 stars 103 forks source link

How to use GUC hint for a string #118

Closed mrdrivingduck closed 1 year ago

mrdrivingduck commented 1 year ago

Hi~

If I want to use hint for GUC like search_path:

postgres=# show search_path;
   search_path   
-----------------
 "$user", public
(1 row)

How should I write hint in front of my SQL? I have tried:

Set(search_path "\"$user\", public")
Set(search_path ""$user", public")

But none of them is correct.

michaelpq commented 1 year ago

search_path may be a different beast, but why would you want to enforce it at query level anyway? This looks quite dangerous to me.

mrdrivingduck commented 12 months ago

search_path may be a different beast, but why would you want to enforce it at query level anyway? This looks quite dangerous to me.

Hi Michael @michaelpq. Maybe I have come up with a bad example. The question is not about whether setting search_path is dangerous or not, but how to set a string GUC which may contain character like ".