Thread

  1. Re: [HACKERS] PSQL man page patch

    Peter T Mount <psqlhack@maidast.demon.co.uk> — 1998-01-18T11:21:48Z

    On Sun, 18 Jan 1998, Vadim B. Mikheev wrote:
    
    > Peter T Mount wrote:
    > > 
    > > On Fri, 16 Jan 1998, Thomas G. Lockhart wrote:
    > > 
    > > > I'm in favor of it also, perhaps as a libpq function call which is used in
    > > > psql. That way, other apps or frontends can choose to use it or not.
    > > >
    > > > Would much prefer leaving it out as a _mandatory_ part of connection
    > > > initialization, since there will be side-effects for embedded apps. Combined
    > > > with PGDATESTYLE and PGTZ there will be pretty good control over the frontend
    > > > environment.
    > > 
    > > I agree entirely with you Tom, as this could cause problems if it was a
    > > _mandatory_ part of connecting.
    > 
    > Agreed!
    > 
    > BTW, do you like X11 ?
    
    Yes, as its much better than a certain other windowing front end I could
    mention ;-)
    
    > XLock.background:			Black
    > Netscape*background:		#B2B2B2
    > 
    > How about following this way ?
    > 
    > psql.pgdatestyle:		euro	# this is for psql
    > _some_app_.pgdatestyle:	iso	# this is for some application
    > pgaccess.background:	black	# setting pgaccess' specific feature
    > *.pggeqo:		on=3	# this is for all applics
    
    I assume you mean using X style configuration in /etc/psqlrc ? If so, then
    yes, it's a good way to go, as it allows a lot of flexibility.
    
    One problem with the earlier .psqlrc idea was that any commands would run
    for any database (as I saw it). This could cause big problems, if the user
    accessed a database that didn't support those commands. With the above
    method, you can get round this, by something like:
    
    psql.database.mydb:	.mydbrc		# sql file run when mydb is opened
    psql.database.*:	.generalrc	# sql file run when any db is
    					# opened
    
    Now, JDBC driver can't use the same config file as that violates security.
    To get round this, we use Java's system properties. For applets, the
    driver simply gets nothing when it asks for the parameter. Applications
    can load their own parameters from a file, or have them set on the command
    line.
    
    The file looks like:
    
    # Default authorisation scheme
    postgresql.auth=password
    
    The command line form looks like:
    
    java -Dpostgresql.auth=password myapp
    
    > We could use 'pg' prefix for standard features (datestyle, tz, etc)
    > to give applic developers ability to set applic' specific features
    > in the pgsqlrc file(s).
    
    Sounds good to me
    
    -- 
    Peter T Mount  petermount@earthling.net or pmount@maidast.demon.co.uk
    Main Homepage: http://www.demon.co.uk/finder
    Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk