Bug or intentionally under-documented "\c databasename;" behavior? - Mailing list pgsql-bugs

From David G. Johnston
Subject Bug or intentionally under-documented "\c databasename;" behavior?
Date
Msg-id CAKFQuwYwWh9wNWxbFAc_9apovbRo9Sfe8jRM7Mf98C8Tn2dE9A@mail.gmail.com
Whole thread Raw
Responses Re: Bug or intentionally under-documented "\c databasename;" behavior?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hey,

I expected the following to tell me: database "testdb;" does not exist

Instead the connection attempt was successful.

postgres=# create database testdb;
CREATE DATABASE
postgres=# \c testdb;
You are now connected to database "testdb" as user "vagrant".

Specifically, the trailing semi-colon on the testdb is being treated, apparently, as a second parameter to \c (or just plain ignored which seems wrong too); which itself is a surprise given the absence of whitespace, and \c documents that - passed as a parameter is an acceptable way to omit a parameter so the semi-colon should have been considered as a username.

David J.

pgsql-bugs by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Incorrect messages emitted from pgoutput when using column lists
Next
From: Tom Lane
Date:
Subject: Re: Bug or intentionally under-documented "\c databasename;" behavior?