I just spent half a day trying to set up a log4net AdoNetAppender to write into 
a PostgreSQL table named "Log".  It was not working, and I was not getting any 
error messages anyplace.  Not my application, not PostgreSQL log files.  I 
stripped the log4net configuration file to a bare minimum, where it merely 
writes the same message every time, using this query:

INSERT INTO Log (message) VALUES ('This is a log message');

I could not get it to work.

Finally, in desperation, I opened an SQL window in PGAdmin, and pasted the 
query into it.  It didn't work!  It claimed there is no relation named Log.  I 
tried this:
INSERT INTO log (message) VALUES ('This is a log message');
It didn't work either.
I tried this:
INSERT INTO "Log" (message) VALUES ('This is a log message');
That worked!

When I was staring at the table definition PGAdmin showed me, I noticed that 
the SQL to create the table began with:
CREATE TABLE "Log"
Note the double quotes around the word Log.  I came to the conclusion that the 
double quotes are actually being included in the table name.

I dropped the table and recreated it manually.  Now, when I look at the create 
table script, I see that it begins with:
CREATE TABLE Log
And when I run the application that tries to write log messages into that 
table, it works!

We cannot have double quotes embedded in object names for our applications.  It 
would be a huge change in the way many pieces of our products are configured.  
Is there a way to change this behavior, or do we have to revert to an older 
version of PostgreSQL?

Thank you very much!

RobR

Reply via email to