Skip to content
Discussion options

You must be logged in to vote

Yeah it does. If you leave the port off, the Postgres driver just falls back to its default, which is 5432. So these two end up being the same thing:

postgresql://user:pass@localhost/mydb
postgresql://user:pass@localhost:5432/mydb

localhost with no port becomes localhost:5432.

Couple of things worth keeping in mind:

  • It only fills in the default. If your Postgres is on a different port (Supabase's pooler is on 6543, or if you mapped something like 5433 in Docker) you have to write the port yourself, there's no auto detection.
  • It's not really a Prisma thing, it's just how the Postgres protocol works. Prisma passes the URL straight to the driver and Postgres assumes 5432 when nothing is gi…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@raadtotheraad
Comment options

Answer selected by raadtotheraad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussion/needs-confirmation Needs a user to confirm the solution before the Discussion can be marked as answered
4 participants