When you generate the postgres database URL it takes a shortened version of the workspace ID that doesn't appear in the workspace API JSON response:
Eg my workspace returns:
{
"workspaces": [
{
"id": "Eugene-Marcotte-s-workspace-dumj43",
"slug": "Eugene-Marcotte-s-workspace",
"name": "Eugene Marcotte's workspace",
"role": "owner",
"plan": "free"
}
]
}
but postgres wants
dumj43
. I'm slightly reluctant to parse ID's cause that seems a little sus :)