On Tuesday 05 February 2008 05:33:05 pm Ed Leafe wrote:
> On Feb 5, 2008, at 6:14 PM, johnf wrote:
> > On the surface this looks like a postgres bug.  I have emailed the
> > postgres
> > list.  BTW what version of postgres are you using?
>
>       8.1, IIRC.
>
> -- Ed Leafe
Looks like we have the answer.  Now the question what to do about it?  I look 
forward to your suggestion!  


PostgreSQL folds to lower case unless you put the name in double-quotes. Try 
putting the table name in double-quotes.
> 
 E.g.: select has_table_privilege('johnf', 'public."Account_Text_Table"',
'SELECT')
> 

That won't help if the table was not created with a quoted name.

test=# CREATE TABLE Account_Text_Table (foo CHAR(1));
CREATE TABLE

test=# SELECT * FROM Account_Text_Table;
  foo
-----
(0 rows)

test=# SELECT * FROM "Account_Text_Table";
ERROR:  relation "Account_Text_Table" does not exist

test=# DROP TABLE account_text_table;
DROP TABLE

test=# CREATE TABLE "Account_Text_Table" (foo CHAR(1));
CREATE TABLE

test=# SELECT * FROM Account_Text_Table;
ERROR:  relation "account_text_table" does not exist

test=# SELECT * FROM "Account_Text_Table";
  foo
-----
(0 rows)

So, you'll need to quote the table name when you create it. But this 
means that you'll *always* have to quote references to it.

-- 
John Fabiani


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to