João Ramiro
João Ramiro

Reputation: 312

How can I install pg_hint_plan on amazon RDS Postgres 13

I am trying to install pg_hint_plan in order to manipulate my query plans. on my amazon RDS with postgres 13.

I successfully added the extension with CREATE EXTENSION pg_hint_plan which makes the extension appear in the list of installed exceptions select * from pg_catalog.pg_extension

However when I try to use hints on my queries, nothing happens. For example when i try to force an error as displayed on the documentation:

enter image description here

I get no error from the pg_hint_plan on my output, and its like the hint is ignored enter image description here

Is there any mistake on the configuration? From what I understood I dont need to do LOAD 'pg_hint_plan' as specified on the documentation because I am using Amazon RDS

Upvotes: 6

Views: 3327

Answers (2)

Feodor Hilitski
Feodor Hilitski

Reputation: 19

pg_hint_plan 1.8 requires PostgreSQL 18 - are you on that version? "Loading it with a LOAD command will activate it and of course you can load it globally by setting shared_preload_libraries in postgresql.conf." - did you load the extension with: LOAD 'pg_hint_plan'; ?

Upvotes: -1

Richard Wheeldon
Richard Wheeldon

Reputation: 1118

Before this will work you need to alter the database parameters for shared_preload_libraries to contain pg_hint_plan. Then'll you'll need to bounce the cluster. After that it should work.

Upvotes: 3

Related Questions