RE: pgbench without dbname worked differently with psql and pg_dump

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: "'David G(dot) Johnston'" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: pgbench without dbname worked differently with psql and pg_dump
Date: 2025-01-22 04:38:09
Message-ID: OSCPR01MB14966AC081DC90C079537DFE2F5E12@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear David,

> As none of those programs "create" a database the wording "The default is to
> create a database" seems quite a poor choice to standardize on.

Oh, I misunderstood. Sorry. I wanted to suggest like below:

```
The default is to connect to a database with the same name as the current system
user.
````

My main point was we should clarify that the OS (system) user-name is used.

> "connection to default database failed" is a strictly worse error message than the
> existing one used unconditionally.
> There probably should still be the existing "else" block in the other hunk - we do
> default to OS user name - but to handle -U shouldn't we just add an "else if (username)
> ...block before it?

You meant like attached, right? It seems simpler than my idea.

PSA updated version.

----------
Best regards,
Hayato Kuroda

Attachment Content-Type Size
v2-0001-pgbench-Use-default-connection-when-dbname-is-not.patch application/octet-stream 754 bytes
v2-0002-Unify-descriptions-when-dbname-is-not-specified.patch application/octet-stream 3.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nisha Moond 2025-01-22 05:16:45 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Amul Sul 2025-01-22 04:07:16 Re: Bug in detaching a partition with a foreign key.