February 2020
Intermediate to advanced
734 pages
38h 13m
English
Assume for a moment that we need the definition of the primary_db foreign server to change. For instance, what if we integrated PgBouncer to reduce user contention and we need to use the non-default port of 6432? Here's how we would add the port option:
ALTER SERVER primary_db OPTIONS (ADD port '5433');
If we need to change this again later, we would use the following syntax instead:
ALTER SERVER primary_db OPTIONS (SET port '5444');
We must admit that this difference in syntax is something of an oddity. To PostgreSQL, SET only modifies attributes that were specified when we called CREATE SERVER. We must use ADD to override a default, even though SET could have been overloaded to perform both actions. This merely ...
Read now
Unlock full access