Re: ERROR: relation "userroles" does not exist

Lists: pgsql-php
From: Sean <sean712(at)gmail(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: ERROR: relation "userroles" does not exist
Date: 2008-10-10 17:30:31
Message-ID: d953ccea0810101030r285012bdv9029c5763d6955cc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

*Hello All,

*I keep receiving the following when trying to select from a table in my
database. the Tables are there i see them in pgAdmin...

*Warning*: pg_query_params()
[function.pg-query-params<http://localhost:8888/HH/function.pg-query-params>]:
Query failed: ERROR: relation "userroles" does not exist

The query I'm running is

SELECT userPassword, salt, roleName
FROM User u, UserRoles ur, Roles r
where u.id = ur.user_id
and r.id = ur.role_id
and u.username = $1
and u.active = true


From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Sean <sean712(at)gmail(dot)com>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: ERROR: relation "userroles" does not exist
Date: 2008-10-10 18:17:08
Message-ID: 48EF9C24.40201@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

On 10/10/2008 18:30, Sean wrote:
> *I keep receiving the following when trying to select from a table in my
> database. the Tables are there i see them in pgAdmin...
>
> *Warning*: pg_query_params() [function.pg-query-params
> <http://localhost:8888/HH/function.pg-query-params>]: Query failed:
> ERROR: relation "userroles" does not exist

Would you have defined the table using quoted upper-case? PG folds names
to lower-case unless you double quote them, so:

test=# create table test();
CREATE TABLE
test=# create table "Test"();
CREATE TABLE
test=# \dt
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | Test | table | postgres
public | test | table | postgres
(2 rows)

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------


From: Sean <sean712(at)gmail(dot)com>
To: rod(at)iol(dot)ie
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: ERROR: relation "userroles" does not exist
Date: 2008-10-10 20:03:44
Message-ID: d953ccea0810101303h10d47ee2y342a63b64bbe35be@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

That's it. thank you.. I created it using PgAdmin.

On Fri, Oct 10, 2008 at 2:17 PM, Raymond O'Donnell <rod(at)iol(dot)ie> wrote:

> On 10/10/2008 18:30, Sean wrote:
> > *I keep receiving the following when trying to select from a table in my
> > database. the Tables are there i see them in pgAdmin...
> >
> > *Warning*: pg_query_params() [function.pg-query-params
> > <http://localhost:8888/HH/function.pg-query-params>]: Query failed:
> > ERROR: relation "userroles" does not exist
>
> Would you have defined the table using quoted upper-case? PG folds names
> to lower-case unless you double quote them, so:
>
> test=# create table test();
> CREATE TABLE
> test=# create table "Test"();
> CREATE TABLE
> test=# \dt
> List of relations
> Schema | Name | Type | Owner
> --------+------+-------+----------
> public | Test | table | postgres
> public | test | table | postgres
> (2 rows)
>
>
> Ray.
>
> ------------------------------------------------------------------
> Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
> rod(at)iol(dot)ie
> Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
> ------------------------------------------------------------------
>