You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2id="_preparing_for_postgresql"><aclass="anchor" href="#_preparing_for_postgresql"></a>Preparing for PostgreSQL</h2>
515
515
<divclass="sectionbody">
516
+
<divclass="sect2">
517
+
<h3id="_writer_and_reader_instances"><aclass="anchor" href="#_writer_and_reader_instances"></a>Writer and reader instances</h3>
516
518
<divclass="paragraph">
517
519
<p>When running PostgreSQL reader and writer instances, Keycloak needs to always connect to the writer instance to do its work.
518
520
When using the original PostgreSQL driver, Keycloak sets the <code>targetServerType</code> property of the PostgreSQL JDBC driver to <code>primary</code> to ensure that it always connects to a writable primary instance and never connects to a secondary reader instance in failover or switchover scenarios.</p>
<divclass="title">Secure Your PostgreSQL Connection</div>
539
+
</div>
540
+
<divclass="sect2">
541
+
<h3id="_permissions_of_the_database_user"><aclass="anchor" href="#_permissions_of_the_database_user"></a>Permissions of the database user</h3>
542
+
<divclass="paragraph">
543
+
<p>Ensure that the database user has <code>SELECT</code> permissions to the following tables to ensure an efficient upgrade: <code>pg_class</code>, <code>pg_namespace</code>.</p>
544
+
</div>
545
+
<divclass="paragraph">
546
+
<p>This is used during upgrades of Keycloak to determine an estimated number of rows in a table.
547
+
If Keycloak does not have permissions to access these tables, it will log a warning and proceed with the less efficient <code>SELECT COUNT(*) ...</code> operation during the upgrade to determine the number of rows in tables affected by schema changes.</p>
548
+
</div>
549
+
</div>
550
+
<divclass="sect2">
551
+
<h3id="_secure_your_connection"><aclass="anchor" href="#_secure_your_connection"></a>Secure your connection</h3>
545
552
<divclass="paragraph">
546
553
<p>To secure your database connection, configure your PostgreSQL server to use TLS and perform full server certificate verification on the client side.</p>
0 commit comments