Re: Strange interaction with php's pg_query

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Strange interaction with php's pg_query
Date: 2002-05-14 13:32:59
Message-ID: 3CE1120B.5080304@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Bill Moran <wmoran(at)potentialtech(dot)com> writes:
>
>>And if I start psql and enter:
>>"select * from sysinfo"
>>I get the expected list of name/value pairs that were entered
>>into the table at an earlier operation.
>
>>However, if I execute the same query using pg_query() in php,
>>I get the error:
>>Warning: pg_query() query failed: ERROR: Relation "sysinfo" does not exist in /usr/home/group/webpages/epd/class/base.class.php on line 44
>
> I think your php client must be connecting to a different database
> than you are connecting to when you run psql by hand. If you are
> allowing the default choice of database name = user name to be taken,
> this isn't real surprising...

That's it. I guess it really was _too_ late for me to be working
on this last night. Thanks.

>>This really confuses me, as "sysinfo" isn't even a relation and
>>why should the parser even imagine it to be a relation?
>
> "relation" and "table" are more or less synonymous in PG error messages.
> (IMHO the exact meaning of "relation" in our code is "something with a
> pg_class entry", which covers also views, sequences, indexes, etc; but
> you probably didn't need to know that.)

That helps too. Knowing the terminology that Postgre uses will help
me be less of a dummy when interpreting error messages in the future.

--
Bill Moran
Potential Technology
http://www.potentialtech.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2002-05-14 13:44:31 Re: Use of OIDS as primary keys
Previous Message Martín Marqués 2002-05-14 13:25:44 Re: restoreing dumps fail