Pr 562 work - #568
Merged
Merged
Pr 562 work#568
Conversation
…to create it The two-phase PostgreSQL connect always opened the maintenance database "postgres" first. With "do not create database" set it connected there, did nothing, disconnected and reconnected - so the option avoided the CREATE DATABASE, but not the connection that needs privileges nobody grants on a managed PostgreSQL. A role without CONNECT on "postgres" therefore never reached its own database at all: the first phase was refused with 42501 and the adapter looped on the 30 s reconnect forever (#404). That is also what makes the Supabase request in #481 fail on the normal postgresql dbtype. With the option set, connect() now skips the maintenance phase entirely. The default path is unchanged. Table creation is unaffected either way: init() only ever returns CREATE TABLE statements and runs against the configured database, tolerating tables that already exist. The admin "Test connection" button had the same hardcoded database, which is the actual defect behind #285 - it reported a failure for a perfectly good configuration. It now tests the configured database when the option is set. Adds test/testPostgreSQLNoCreateDb.js, which builds the situation it guards: a role with no CONNECT on "postgres" and a pre-existing database of its own. It asserts the adapter connects, creates its six tables in the configured database and round-trips a value. On the unfixed code it fails with "permission denied for database postgres" and the adapter never connects. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Postgres job named one exact file, so testPostgreSQLNoCreateDb.js added by this PR would never have been executed - the same gap that kept test/testSqlClient.js out of CI until #565. A glob picks up new files instead; alphabetical order puts testPostgreSQL.js first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.