Skip site navigation (1) Skip section navigation (2)

Re: Connect to database with php pg_connect, cannot find table even though it shows up on psql connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mary Anderson <maryfran(at)demog(dot)berkeley(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Connect to database with php pg_connect, cannot find table even though it shows up on psql connection
Date: 2009-10-01 16:25:08
Message-ID: 20540.1254414308@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
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

In response to

pgsql-novice by date

Next:From: paresh masaniDate: 2009-10-02 11:44:33
Subject: usage of spi_prepare from PL/Perl
Previous:From: dvanattaDate: 2009-10-01 16:15:24
Subject: Moving from MS SQL Server to PostgreSql 8.3

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group