Skip to content

Setting max: undefined results in only 1 connection being created #833

Closed

Description

@kieranm

In our code we had an issue where we passed max: undefined when creating a Postgres instance, expecting that it would fall back to the default 10.

However, the undefined value seems to overwrite the default max: 10 due to this line:
https://github.com/porsager/postgres/blob/master/src/index.js#L472

Then, due to this line, the array resolves to [undefined] and therefore only a single connection will be created.
https://github.com/porsager/postgres/blob/master/src/index.js#L65

If max: undefined is passed then perhaps the default 10 needs to take precedence.

Activity

  1. added a commit that references this issue on Oct 29, 2026
    06cf284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions