Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Connection form: `usePrivateKey=true` from URL no longer disables Test/Create buttons
- Transient connections from URL clean up keychain entries on connection failure
- Native Search Field focus regression when clearing text
- Using the template0 database to resolve database creation failures in PostgreSQL

## [0.36.0] - 2026-04-27

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
throw LibPQPluginError(message: "Invalid collation", sqlState: nil, detail: nil)
}
let escapedCollation = collation.replacingOccurrences(of: "'", with: "''")
query += " LC_COLLATE '\(escapedCollation)'"
query += " TEMPLATE 'template0' LC_COLLATE '\(escapedCollation)'"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use identifier syntax for TEMPLATE in CREATE DATABASE

The new SQL fragment sets the template as TEMPLATE 'template0', but PostgreSQL expects a template database name (identifier), e.g. TEMPLATE template0 (or TEMPLATE = template0), not a string literal. In createDatabase, this path is taken whenever a collation is provided, so PostgreSQL database creation can fail with a syntax error instead of fixing the collation issue this change targets.

Useful? React with 👍 / 👎.

}
_ = try await execute(query: query)
}
Expand Down
Loading