PostgreSQL holds everything the CMS knows: content and its versions, the media library's records, CMS people and sessions, the jobs table, site builds and the encrypted Google secrets. One RDS instance per environment: production, and UAT if KIMS has one.
#Who does what
| Task | Usually done by | What our engineer needs |
|---|---|---|
| Create the instance | KIMS's cloud team (or DBA), or our engineer if asked | The endpoint |
| The master user's password | Whoever creates the instance, typed straight into the console or a prompt | The password, handed over in person or through KIMS's password manager, only to put in the two places below |
The security group (kims-db) |
KIMS's cloud team | Port 5432 open from the pods and the Jenkins agent (Networking) |
Creating the tables and citext |
Nobody by hand: the kims-migrate Job does it on the first deploy |
|
| Loading content | Our engineer, from a pod (Content load) |
The connection string goes in exactly two places: the kims-database Kubernetes Secret (Secrets) and the kims-database-url Jenkins credential (Jenkins credentials).
#The values to choose
From main's runbook (docs/ON-SITE-DEPLOYMENT.md, AWS set-up D), with the reasons:
| Setting | Production | UAT | Why |
|---|---|---|---|
| Engine | PostgreSQL | PostgreSQL | |
| Engine version | Newest 18.x the region offers |
Same as production | Every test ran on 18 |
| Template | Production | Dev/Test | |
| Availability | Multi-AZ DB instance (one standby) | Single DB instance | A failover takes one to two minutes instead of an outage |
| DB instance identifier | kims-prod |
kims-uat |
|
| Master username | kims |
kims |
The migrations run as this user and create citext |
| Credentials management | Self managed | Self managed | Not "Managed in AWS Secrets Manager": its automatic rotation would change the password behind the CMS, which reads it from a Kubernetes Secret |
| Password | Letters and digits only, 32 or more characters | Same | No @ : / ? # %, so it needs no URL encoding in the connection string |
| Instance class | db.m6g.large (2 vCPU, 8 GiB), or another 2 vCPU, 8 GiB class the region offers |
db.t4g.medium (2 vCPU, 4 GiB) |
About 13,000 rows on day one; the class is headroom for publishes and builds |
| Storage | gp3, 50 GiB, storage autoscaling on, maximum 200 GiB | gp3, 20 to 50 GiB, autoscaling on | Media files are in S3, not here |
| VPC | The EKS cluster's VPC | Same | |
| DB subnet group | The cluster VPC's private subnets, at least two Availability Zones | Same | |
| Public access | No | No | |
| VPC security group | kims-db (UAT kims-uat-db) |
Networking | |
| Port | 5432 | 5432 | |
| Initial database name | kims |
kims |
The database the app uses |
| DB parameter group | default.postgres18 |
Same | Defaults are fine; rds.force_ssl is already 1 |
| Backup retention | 14 days | 7 days | Turns on point-in-time recovery, which the rollback plan relies on |
| Encryption | On (AWS managed key, or KIMS's KMS key) | On | |
| Deletion protection | On | Off or on | |
| Performance Insights / Database Insights | Standard (free tier) | Optional | Finds slow queries |
| Auto minor version upgrade | On, in a maintenance window KIMS agrees | On |
Connections. Each process opens up to DATABASE_POOL_MAX connections (default 10). Two CMS pods, the worker, a CronJob, the migrate Job and the site build can reach about 70 at once. db.t4g.medium and db.m6g.large allow a few hundred by default (max_connections depends on memory), so the defaults fit. Check with SHOW max_connections; after creating it.
#Check PostgreSQL 18 is offered in the region
Do this first in Hyderabad. Any machine with the AWS CLI, or AWS CloudShell in the console:
aws rds describe-db-engine-versions --engine postgres --region ap-south-2 \
--query "DBEngineVersions[?starts_with(EngineVersion, '18')].EngineVersion" --output textaws rds describe-db-engine-versions --engine postgres --region ap-south-2 \
--query "DBEngineVersions[?starts_with(EngineVersion, '18')].EngineVersion" --output textaws rds describe-db-engine-versions --engine postgres --region ap-south-2 `
--query "DBEngineVersions[?starts_with(EngineVersion, '18')].EngineVersion" --output textA list such as 18.1 18.2 18.3 ... means yes: pick the highest. An empty answer means not yet: main's runbook says use PostgreSQL 17 there (the migrations use nothing newer than PostgreSQL 13: citext and gen_random_uuid()), and tell ClinicSpots, because every test ran on 18.
#Check the instance class is offered
aws rds describe-orderable-db-instance-options --engine postgres --engine-version <VERSION> \
--db-instance-class db.m6g.large --region ap-south-2 \
--query "OrderableDBInstanceOptions[].{class:DBInstanceClass,multiAz:MultiAZCapable,storage:StorageType}" --output tableaws rds describe-orderable-db-instance-options --engine postgres --engine-version <VERSION> \
--db-instance-class db.m6g.large --region ap-south-2 \
--query "OrderableDBInstanceOptions[].{class:DBInstanceClass,multiAz:MultiAZCapable,storage:StorageType}" --output tableaws rds describe-orderable-db-instance-options --engine postgres --engine-version <VERSION> `
--db-instance-class db.m6g.large --region ap-south-2 `
--query "OrderableDBInstanceOptions[].{class:DBInstanceClass,multiAz:MultiAZCapable,storage:StorageType}" --output tableRows with gp3 and multiAz True mean the class works. An empty table means pick another class (for example db.m7g.large or db.m5.large).
#DB subnet group
RDS needs a DB subnet group: the private subnets it may use, in at least two Availability Zones. KIMS may already have one for the cluster's VPC; reuse it if its subnets are private.
Console: Aurora and RDS console > left menu Subnet groups > Create DB subnet group > Name kims-db-subnets > VPC the cluster's VPC > Availability Zones: at least two > Subnets: the private ones in those zones > Create.
aws rds create-db-subnet-group --db-subnet-group-name kims-db-subnets \
--db-subnet-group-description "KIMS v2 PostgreSQL, private subnets" \
--subnet-ids <PRIVATE_SUBNET_ID_A> <PRIVATE_SUBNET_ID_B> <PRIVATE_SUBNET_ID_C>aws rds create-db-subnet-group --db-subnet-group-name kims-db-subnets \
--db-subnet-group-description "KIMS v2 PostgreSQL, private subnets" \
--subnet-ids <PRIVATE_SUBNET_ID_A> <PRIVATE_SUBNET_ID_B> <PRIVATE_SUBNET_ID_C>aws rds create-db-subnet-group --db-subnet-group-name kims-db-subnets `
--db-subnet-group-description "KIMS v2 PostgreSQL, private subnets" `
--subnet-ids <PRIVATE_SUBNET_ID_A> <PRIVATE_SUBNET_ID_B> <PRIVATE_SUBNET_ID_C>Both environments can share one subnet group.
#Create the instance: console steps
- Aurora and RDS console, in the cluster's region > left menu Databases > Create database.
- Choose a database creation method: Standard create.
- Engine options: PostgreSQL. Engine version: the highest
PostgreSQL 18.x. - Templates: Production (production) or Dev/Test (UAT).
- Availability and durability: Multi-AZ DB instance (production) or Single DB instance (UAT). Not "Multi-AZ DB cluster".
- Settings: DB instance identifier
kims-prod(UATkims-uat). Open Credentials Settings: Master usernamekims. Credentials management: Self managed. Clear Auto generate a password, type the password in Master password and Confirm master password. - Instance configuration: Standard classes (production) or Burstable classes (UAT), then the class from the table.
- Storage: Storage type
General Purpose SSD (gp3), Allocated storage50. Under Storage autoscaling, tick Enable storage autoscaling, Maximum storage threshold200. - Connectivity: Compute resource
Don't connect to an EC2 compute resource. Virtual private cloud (VPC): the cluster's VPC. DB subnet group:kims-db-subnets. Public access: No. VPC security group (firewall): Choose existing,kims-db, and removedefaultfrom the list. Certificate authority: leave the default (rds-ca-rsa2048-g1). - Database authentication: Password authentication.
- Monitoring: Database Insights - Standard (or Performance Insights on, 7 days, free).
- Open Additional configuration: Initial database name
kims. DB parameter groupdefault.postgres18. Backup retention period14 days(UAT7). Tick Copy tags to snapshots. Encryption: Enable encryption ticked, AWS KMS key(default) aws/rdsunless KIMS names theirs. Log exports: tick PostgreSQL log. Maintenance: Enable auto minor version upgrade, with a window KIMS agrees. Deletion protection: Enable deletion protection (production). - Check Estimated monthly costs, then Create database.
- Wait for Status
Available(about 15 to 20 minutes for Multi-AZ). Open the instance > Connectivity & security tab > copy the Endpoint (kims-prod.<ID>.ap-south-2.rds.amazonaws.com).
#Create the instance: CLI steps
The password is read at a prompt, so it is not saved in your shell history. It is still passed to the AWS CLI as an argument for the second the command runs.
export AWS_REGION=ap-south-2
read -rs -p "Master password for kims: " DB_PASSWORD; echo
aws rds create-db-instance \
--db-instance-identifier kims-prod \
--engine postgres --engine-version <VERSION> \
--db-instance-class db.m6g.large \
--storage-type gp3 --allocated-storage 50 --max-allocated-storage 200 \
--multi-az \
--db-subnet-group-name kims-db-subnets \
--vpc-security-group-ids <KIMS_DB_SG_ID> \
--no-publicly-accessible \
--db-name kims \
--master-username kims --master-user-password "$DB_PASSWORD" \
--backup-retention-period 14 \
--copy-tags-to-snapshot \
--storage-encrypted \
--deletion-protection \
--enable-performance-insights --performance-insights-retention-period 7 \
--enable-cloudwatch-logs-exports postgresql \
--auto-minor-version-upgrade \
--tags Key=project,Value=kims-v2 Key=environment,Value=production \
--query "DBInstance.DBInstanceStatus" --output text
unset DB_PASSWORD
aws rds wait db-instance-available --db-instance-identifier kims-prod
aws rds describe-db-instances --db-instance-identifier kims-prod \
--query "DBInstances[0].{endpoint:Endpoint.Address,port:Endpoint.Port,version:EngineVersion,multiAz:MultiAZ,status:DBInstanceStatus}"export AWS_REGION=ap-south-2
read -rs "DB_PASSWORD?Master password for kims: "; echo
aws rds create-db-instance \
--db-instance-identifier kims-prod \
--engine postgres --engine-version <VERSION> \
--db-instance-class db.m6g.large \
--storage-type gp3 --allocated-storage 50 --max-allocated-storage 200 \
--multi-az \
--db-subnet-group-name kims-db-subnets \
--vpc-security-group-ids <KIMS_DB_SG_ID> \
--no-publicly-accessible \
--db-name kims \
--master-username kims --master-user-password "$DB_PASSWORD" \
--backup-retention-period 14 \
--copy-tags-to-snapshot \
--storage-encrypted \
--deletion-protection \
--enable-performance-insights --performance-insights-retention-period 7 \
--enable-cloudwatch-logs-exports postgresql \
--auto-minor-version-upgrade \
--tags Key=project,Value=kims-v2 Key=environment,Value=production \
--query "DBInstance.DBInstanceStatus" --output text
unset DB_PASSWORD
aws rds wait db-instance-available --db-instance-identifier kims-prod
aws rds describe-db-instances --db-instance-identifier kims-prod \
--query "DBInstances[0].{endpoint:Endpoint.Address,port:Endpoint.Port,version:EngineVersion,multiAz:MultiAZ,status:DBInstanceStatus}"$env:AWS_REGION = "ap-south-2"
$Secure = Read-Host -AsSecureString "Master password for kims"
$DbPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($Secure))
aws rds create-db-instance `
--db-instance-identifier kims-prod `
--engine postgres --engine-version <VERSION> `
--db-instance-class db.m6g.large `
--storage-type gp3 --allocated-storage 50 --max-allocated-storage 200 `
--multi-az `
--db-subnet-group-name kims-db-subnets `
--vpc-security-group-ids <KIMS_DB_SG_ID> `
--no-publicly-accessible `
--db-name kims `
--master-username kims --master-user-password $DbPassword `
--backup-retention-period 14 `
--copy-tags-to-snapshot `
--storage-encrypted `
--deletion-protection `
--enable-performance-insights --performance-insights-retention-period 7 `
--enable-cloudwatch-logs-exports postgresql `
--auto-minor-version-upgrade `
--tags Key=project,Value=kims-v2 Key=environment,Value=production `
--query "DBInstance.DBInstanceStatus" --output text
Remove-Variable DbPassword, Secure
aws rds wait db-instance-available --db-instance-identifier kims-prod
aws rds describe-db-instances --db-instance-identifier kims-prod `
--query "DBInstances[0].{endpoint:Endpoint.Address,port:Endpoint.Port,version:EngineVersion,multiAz:MultiAZ,status:DBInstanceStatus}"The first command prints creating. The wait returns when it is available (it gives up after about 30 minutes; run it again if so). The last command shows the endpoint, 5432, the version, true for Multi-AZ, and available.
For UAT: kims-uat, db.t4g.medium, no --multi-az, --backup-retention-period 7, --vpc-security-group-ids <KIMS_UAT_DB_SG_ID>, no --deletion-protection if KIMS agrees, and Value=uat.
#The connection string
postgres://kims:<DB_PASSWORD>@<RDS_ENDPOINT>:5432/kims?sslmode=requireThat is the form main's runbook, deploy/jenkins/README.md and the values file comments give. It goes in the kims-database Secret (key url) and the kims-database-url Jenkins credential. Never in a file in Git, never in chat. How to create the Secret without leaving the password in shell history: Secrets.
sslmode=require may be refused by the Node.js driver on RDS. The lock file pins pg-connection-string 2.14.1. That version treats sslmode=require as verify-full (it prints "SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'"), so Node checks RDS's certificate against its built-in list of public authorities. The Amazon RDS certificate authorities are not on that list. Checked by parsing the string with the repository's driver; not yet tried against a real RDS instance.
If the migrate Job, the CMS readiness check or the site build fails with self-signed certificate in certificate chain (or SELF_SIGNED_CERT_IN_CHAIN), use this form instead, in both the Secret and the Jenkins credential:
postgres://kims:<DB_PASSWORD>@<RDS_ENDPOINT>:5432/kims?sslmode=require&uselibpqcompat=true
It keeps the connection encrypted with libpq's meaning of require (encrypt, do not verify the certificate), which the driver then applies. Tell ClinicSpots if you had to: a code change can bundle the RDS certificate authority so verify-full works. The engineer's deploy.mjs kims secrets create helper may insist on a string ending ?sslmode=require; create the Secret with kubectl in that case.
RDS for PostgreSQL 15 and later refuses unencrypted connections by default (rds.force_ssl is 1), so dropping sslmode is not an option: the error would be no pg_hba.conf entry for host ..., SSL off.
#Check it from inside the cluster
RDS is private, so your laptop usually cannot reach it, and that is expected. Use a throwaway psql pod in the namespace. psql asks for the password; it is not on the command line. (For other ways in, see Database tools.)
kubectl -n kims run psql --rm -it --restart=Never \
--image=public.ecr.aws/docker/library/postgres:18 -- \
psql "host=<RDS_ENDPOINT> port=5432 dbname=kims user=kims sslmode=require"kubectl -n kims run psql --rm -it --restart=Never \
--image=public.ecr.aws/docker/library/postgres:18 -- \
psql "host=<RDS_ENDPOINT> port=5432 dbname=kims user=kims sslmode=require"kubectl -n kims run psql --rm -it --restart=Never `
--image=public.ecr.aws/docker/library/postgres:18 -- `
psql "host=<RDS_ENDPOINT> port=5432 dbname=kims user=kims sslmode=require"At the kims=> prompt (the same on every system):
SELECT version();
SHOW rds.force_ssl;
SHOW max_connections;
SELECT ssl, version FROM pg_stat_ssl WHERE pid = pg_backend_pid();
\qYou should see PostgreSQL 18.x on aarch64-unknown-linux-gnu (or x86_64 for an Intel class), 1, a number in the hundreds, and t | TLSv1.3. Here psql (libpq) treats sslmode=require as "encrypt, do not verify", so it connects even where the Node driver would not.
After the first deploy, check the migrations ran:
\dx citext
SELECT count(*) FROM schema_migrations;You should see citext listed and a count equal to the number of files in db/migrations/ (8 today).
#citext and the migrate Job
db/migrations/0001_foundation.sql runs CREATE EXTENSION IF NOT EXISTS citext. citext is a trusted extension on PostgreSQL 13 and later, so the database's owner can create it, and the master user kims owns the database kims here. Nothing to do by hand.
If KIMS's DBA insists on a separate app user that does not own the database, they must either make it the owner (ALTER DATABASE kims OWNER TO <APP_USER>;, with the master user a member of that role) or run CREATE EXTENSION citext; in kims as the master user before the first deploy.
#Backups and point-in-time recovery
With a backup retention of 1 day or more, RDS takes a daily snapshot and keeps the transaction logs, so you can restore to any second in the retention period, up to about five minutes ago. The content's rollback plan relies on it. Backup and restore covers when to use it.
#Check backups are on
aws rds describe-db-instances --db-instance-identifier kims-prod \
--query "DBInstances[0].{retentionDays:BackupRetentionPeriod,window:PreferredBackupWindow,latestRestorableTime:LatestRestorableTime,deletionProtection:DeletionProtection,encrypted:StorageEncrypted}"aws rds describe-db-instances --db-instance-identifier kims-prod \
--query "DBInstances[0].{retentionDays:BackupRetentionPeriod,window:PreferredBackupWindow,latestRestorableTime:LatestRestorableTime,deletionProtection:DeletionProtection,encrypted:StorageEncrypted}"aws rds describe-db-instances --db-instance-identifier kims-prod `
--query "DBInstances[0].{retentionDays:BackupRetentionPeriod,window:PreferredBackupWindow,latestRestorableTime:LatestRestorableTime,deletionProtection:DeletionProtection,encrypted:StorageEncrypted}"You should see 14, a window, a latestRestorableTime a few minutes ago, true, true.
#Take a manual snapshot
Before a risky change (a big migration, a content reload). Manual snapshots stay until deleted.
Console: Databases > kims-prod > Actions > Take snapshot > name kims-prod-before-<WHAT>-<DATE> > Take snapshot.
aws rds create-db-snapshot --db-instance-identifier kims-prod \
--db-snapshot-identifier kims-prod-before-<WHAT>-$(date +%Y%m%d)
aws rds wait db-snapshot-available --db-snapshot-identifier kims-prod-before-<WHAT>-$(date +%Y%m%d)aws rds create-db-snapshot --db-instance-identifier kims-prod \
--db-snapshot-identifier kims-prod-before-<WHAT>-$(date +%Y%m%d)
aws rds wait db-snapshot-available --db-snapshot-identifier kims-prod-before-<WHAT>-$(date +%Y%m%d)$Snap = "kims-prod-before-<WHAT>-$(Get-Date -Format yyyyMMdd)"
aws rds create-db-snapshot --db-instance-identifier kims-prod --db-snapshot-identifier $Snap
aws rds wait db-snapshot-available --db-snapshot-identifier $Snap#Restore to a point in time
A restore always creates a new instance; the old one keeps running untouched. Then you point KIMS v2 at the new one.
- Pick the time, in UTC (IST minus 5 h 30 min), before the mistake.
- Restore. Console: Databases >
kims-prod> Actions > Restore to point in time > Custom date and time > the time > DB instance identifierkims-prod-restored-<DATE>> the same class, subnet group, security groupkims-db, Public access No > Restore to point in time.
aws rds restore-db-instance-to-point-in-time \
--source-db-instance-identifier kims-prod \
--target-db-instance-identifier kims-prod-restored-<DATE> \
--restore-time 2026-12-01T04:30:00Z \
--db-instance-class db.m6g.large --multi-az \
--db-subnet-group-name kims-db-subnets \
--vpc-security-group-ids <KIMS_DB_SG_ID> \
--no-publicly-accessible --deletion-protection --copy-tags-to-snapshot
aws rds wait db-instance-available --db-instance-identifier kims-prod-restored-<DATE>aws rds restore-db-instance-to-point-in-time \
--source-db-instance-identifier kims-prod \
--target-db-instance-identifier kims-prod-restored-<DATE> \
--restore-time 2026-12-01T04:30:00Z \
--db-instance-class db.m6g.large --multi-az \
--db-subnet-group-name kims-db-subnets \
--vpc-security-group-ids <KIMS_DB_SG_ID> \
--no-publicly-accessible --deletion-protection --copy-tags-to-snapshot
aws rds wait db-instance-available --db-instance-identifier kims-prod-restored-<DATE>aws rds restore-db-instance-to-point-in-time `
--source-db-instance-identifier kims-prod `
--target-db-instance-identifier kims-prod-restored-<DATE> `
--restore-time 2026-12-01T04:30:00Z `
--db-instance-class db.m6g.large --multi-az `
--db-subnet-group-name kims-db-subnets `
--vpc-security-group-ids <KIMS_DB_SG_ID> `
--no-publicly-accessible --deletion-protection --copy-tags-to-snapshot
aws rds wait db-instance-available --db-instance-identifier kims-prod-restored-<DATE>--use-latest-restorable-time instead of --restore-time restores to the newest moment possible.
- Point KIMS v2 at it: replace the endpoint in the
kims-databaseSecret and thekims-database-urlcredential (Secrets), thenkubectl -n kims rollout restart deploy/kims-cms deploy/kims-worker. The master password is the source's at that time. - Or keep the endpoint: rename the old instance (
Modify> DB instance identifierkims-prod-old, Apply immediately), then rename the restored one tokims-prod. The endpoint name follows the identifier, so the Secret does not change, but both renames briefly break connections. - When everyone is happy, take a final snapshot of the old instance and delete it (turn off its deletion protection first). Agree it with KIMS: deleting cannot be undone.
#If it goes wrong
| What you see | Likely cause | What to do |
|---|---|---|
kims-migrate fails with connect ETIMEDOUT or ECONNREFUSED |
Port 5432 not open from the pods | Networking, RDS security group |
self-signed certificate in certificate chain |
The Node driver verifies the RDS certificate (see the warning above) | Add &uselibpqcompat=true to both connection strings |
no pg_hba.conf entry for host ..., SSL off |
sslmode missing from the string |
Put ?sslmode=require back |
password authentication failed for user "kims" |
Wrong password, or characters that broke the URL | Reset it (Modify > Master password), letters and digits only |
database "kims" does not exist |
Initial database name was left empty | Connect to postgres as kims and run CREATE DATABASE kims; |
permission denied to create extension "citext" |
The connecting user does not own the database | citext and the migrate Job |
remaining connection slots are reserved |
Too many connections | Lower DATABASE_POOL_MAX in the Helm values, or a larger class |
InvalidParameterCombination: Cannot find version 18.x |
That minor version is not in this region | Check PostgreSQL 18 is offered in the region |
DBSubnetGroupDoesNotCoverEnoughAZs |
The subnet group has one Availability Zone | Add a private subnet in a second zone |
| The restored instance has no data you expected | The time was in local time, not UTC | Restore again with the UTC time |
#Sources
kims-v2/docs/ON-SITE-DEPLOYMENT.mdonmain(AWS set-up Region and D, steps 2 and 4)kims-v2/deploy/jenkins/README.mdonmain(sections 2 and 5)kims-v2/docs/CONFIG.md(Database:DATABASE_URL,DATABASE_POOL_MAX)kims-v2/db/migrations/0001_foundation.sql,kims-v2/db/migrations/README.mdkims-v2/packages/db/src/index.ts,kims-v2/package-lock.json(pg8.23.1,pg-connection-string2.14.1)- https://docs.aws.amazon.com/AmazonRDS/latest/PostgreSQLReleaseNotes/postgresql-versions.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.SSL.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIT.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html (max_connections)
- https://www.postgresql.org/docs/18/libpq-ssl.html
- https://github.com/brianc/node-postgres/tree/master/packages/pg-connection-string