Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu> writes:
> I would like to know a postgresql command which tells me the name of
> the database I am connected to.
select current_database();
> I suspect the system is doing something funny and have contacted
> our sysadmin people, who are doing all kinds of things to our network as
> a result of our being hacked a couple of weeks ago. But it would help
> to know the name of the database I actually connected to!
You should also consider the possibility that you're connected to the
wrong server. A network-level issue seems more likely to lead to
that...
regards, tom lane