hubert depesz lubaczewski wrote:
On Fri, Jan 08, 2010 at 11:20:36AM +0000, Mark Morgan Lloyd wrote:
Is there any way of getting psql to display the name of the
currently-connected server in its prompt, and perhaps a custom string
identifying e.g. a disc set, without having to create a psqlrc file on
every client system that's got a precompiled psql installed?
what exactly is the problem with distributing your own .psqlrc?
for me it's one of the first things that I do - I setup environment.
Thanks everybody for the comments. The problem is that in an environment
where the end-users generally have enough nous (or are sufficiently
assertive) to run their own systems (e.g. an engineering department)
there is still a requirement to protect shared resources like a
database. It's not really feasible for the overall sysadmin to work his
way around all possible machines, work out which distro each is running,
and install a suitable psqlrc in the place expected by that distro's
psql. It's even less feasible to install a shim that forces default
command-line parameters.
When I referred to a disc set I wasn't thinking about something in the
context of PostgreSQL, I was thinking about a group of discs in
removable (Compaq) caddies that might be transferred to one of a number
of chassis. At present I've got one chassis here into which I'm putting
one of two disc sets, both of which are the 8.4 upgrade target: I'd like
to be able to confirm from the client which set is in the chassis.
After playing some more I think there are actually three issues:
i) Getting psql to take its initial defaults, i.e. if there isn't a
psqlrc file, from the server (e.g. for the prompt).
ii) Getting the prompt to display the actual hostname of the server,
rather than what was put on the command line which might be an alias or
dotted-quad address.
iii) Getting the prompt to display some other identifier from the server
to identify the disc set.
I don't think anybody else thinks this is an issue so I guess all I can
say is thanks for listening :-)
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general