Viewing posts tagged database

How to `CREATE DATABASE dbName IF NOT EXISTS` in postgres in golang

If you're here, it's probably because you're having trouble using SQL for postgres in Golang to create a database if it doesn't exist. Part of the problem is, postgres doesn't support the CREATE DATABASE dbName IF NOT EXISTS; idiom for databases. Here's how I'm doing it: