Re: Why does app fail? - Mailing list pgsql-general

From Paul Simpson
Subject Re: Why does app fail?
Date
Msg-id s03b7ea6.089@spgs.org
Whole thread Raw
In response to Why does app fail?  ("Paul Simpson" <Paul.Simpson@spgs.org>)
Responses Re: Why does app fail?
Re: Why does app fail?
List pgsql-general
Ok, I've done that and it would appear to be a table naming issue...
 
When I look at the logfile at the point where a table is creates, I get the following lines (for each table, as far as I can tell, although the third line only appears for some):-
 
select relname, nspname, relkind from pg_catalog.pg_class, pg_catalog.pg_namespace where relkind in ('r', 'v')and nspname like 'public' and relname like 'TTATTASSOC' and relname !~ '^pg_|^dd_' and pg_namespace.oid = relnamespace order by nspname, relname
Create Table TTATTASSOC (AssocId varchar(10), SetId varchar(10), SlotId int4)
select u.nspname, c.relname, a.attname, a.atttypid, t.typname, a.attnum, a.attlen, a.atttypmod, a.attnotnull,c.relhasrules, c.relkind from pg_catalog.pg_namespace u, pg_catalog.pg_class c, pg_catalog.pg_attribute a, pg_catalog.pg_type t where u.oid = c.relnamespace and (not a.attisdropped) and c.oid= a.attrelid and a.atttypid = t.oid and (a.attnum > 0) and c.relname = 'TTATTASSOC' and u.nspname = 'public' order by u.nspname, c.relname, attnum
select relname, nspname, relkind from pg_catalog.pg_class, pg_catalog.pg_namespace where relkind in ('r', 'v') and nspname like 'public' and relname like 'TTATTASSOC' and relname !~ '^pg_|^dd_' and pg_namespace.oid = relnamespace order by nspname, relname

If I am correct (comments please) then I assume it is looking for the existence of the table, when it doesn't find it, it is creating it. I'm not entirely sure what the third line does, but the fourth seems to be checking again for the table's existence.
 
I have run the statements manually and they all seem to work, however the first (and fourth) always return zero rows. If I replace the table name with a lower case version, then I get one row returned.
 
I have, therefore, come to the conclusion that the app requires table names in Upper case. How can I force this to work?
 
Sorry for the long question...!
 
Paul
 

>>> Shridhar Daithankar <shridhar@frodo.hserus.net> 24/02/2004 12:02:30 >>>
On Tuesday 24 February 2004 16:51, Paul Simpson wrote:
> 1) If there is a log somewhere showing failed requests, I might be able to
> see what the application is trying to do and then figure out a way around
> it.

You can log in every query server is executing. You need to enable the
corresponding log statement in pg_hba.conf. I think it is called
log_statement.

And of course, don't throw away server logs. If they are redirected
to /dev/null, they are useless anyways..

I am sure you will find lot of information in there..

HTH

Shridhar

pgsql-general by date:

Previous
From: sferriol
Date:
Subject: dynamic views
Next
From: Richard Huxton
Date:
Subject: Re: dynamic views