pgroll icon indicating copy to clipboard operation
pgroll copied to clipboard

`pgroll init` defaults to localhost:5432

Open richardgill opened this issue 9 months ago • 4 comments

I was expecting an error if I hadn't set the postgres url properly explaining what I'd done wrong.

(I think this happens for many commands)

Image

richardgill avatar Mar 13 '25 09:03 richardgill

If I recall this follows the default behavior for most postgres tools. For xata roll I think it probably makes more sense to default to a branch vs. local. So you essentially like to remove a default and always be prompted for the URL during init. Is that fair to say? I'd be ok with not following typical Postgres tooling patterns if we're able to find a better workflow

What do you think @gulcin @andrew-farries @kvch ?

alexfrancoeur avatar Mar 31 '25 20:03 alexfrancoeur

It defaults to postgres tools but the behavior is slightly different. Default postgres tools use the current logged in user AND respect documented env vars.

pgroll has slightly different defaults using postgres for username and password. IMO, we should probably default to the postgres tool behavior (which is more intuitive for Postgres users) OR fail and ask for configuration instead of using defaults.

divyenduz avatar May 05 '25 14:05 divyenduz

It defaults to postgres tools but the behavior is slightly different. Default postgres tools use the current logged in user AND respect documented env vars.

pgroll has slightly different defaults using postgres for username and password. IMO, we should probably default to the postgres tool behavior (which is more intuitive for Postgres users) OR fail and ask for configuration instead of using defaults.

I agree with this ☝ I wonder if there was a reasoning behind the current behaviour. Tagging @andrew-farries and @kvch for more insights.

gulcin avatar May 05 '25 14:05 gulcin

IMO we should preserve the Postgres tool behaviour of defaulting to a local Postgres in the absence of an explicit host, but respect the libpq default env vars.

andrew-farries avatar May 06 '25 08:05 andrew-farries