[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#72229: pg_wrapper breaks psql database selection



On Fri, 22 Sep 2000, Oliver Elphick wrote:
> 1. I should use any environment variables that are already
> set; it is definitely a bug not to do this.

Really necessary for upstream compatibility.

> 2. If the database name is still blank, I should try connections
> in this order:
> 
> 	a) as defined by ~/.psqlrc          | current upstream default at
> 	b) user's name                      | version 7.0.2-x
> 	c) locally-configured default database
>            (ideally, it should be the default database on PGHOST, but
>             there is no mechanism for reading that)
> 	d) if connection still fails, print an error message and abort

Yupp. A new user should never end up in 'template1'.

Maybe ask on install if the user with the default first UID (1000?)

	- should be 'CREATE USER'ed (optionally CREATEDB, CREATEUSER)
          (defaults to: NO)
          - if yes, should a database be created for him automatically

Then the postgres-and-debian-newbie won't have troubles when playing with
postgres.

> 3. There should be added to the configuration
> (/etc/postgresql/postmaster.init) the following:
> 
> # The default database to which psql should connect if none is
> # specified on the command line and there is none defined in ~/.psqlrc
> # and there is no database which has the same name as the user's login.
> # If this is undefined, an unspecified connection will fail.
> PG_DEFAULT_DATABASE=
> 
> # Whether to report progress in finding and connecting to a default
> # database when none is specified on the command line (yes/no).
> PG_DEFAULT_VERBOSE=yes
> 
> Comments please?

At a first glance, no major problems. We have other UN*X boxes with stock
postgres here, and the difference to debian tripped me up more than once ...

Thank you for your help,
greetings, Mike

-- 
Don't feed.                                               DI Michael Wildpaner
Don't provoke.                                                   Ph.D. Student
Don't enter the cage.



Reply to: