[logback-dev] [JIRA] Resolved: (LBCORE-126) ch.qos.logback.core.db.DBAppenderBase tries to use column "EVENT_ID" but does not exist
Ceki Gulcu (JIRA)
noreply-jira at qos.ch
Mon Mar 22 15:50:16 CET 2010
[ http://jira.qos.ch/browse/LBCORE-126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ceki Gulcu resolved LBCORE-126.
-------------------------------
Fix Version/s: 0.9.19
Resolution: Fixed
Actually, PostgreSQL is case *insensitive" unless the column name is passed between quotes. Internally, PostgreSQL lower-cases names unless they are passed between quotes.
It seems that the PostgreSQL JDBC driver places column names between quotes when the prepareStatement(String sql, String columnNames[]) method in the java.sql.Connection class is called. Other column names are unaffected. Example:
INSERT INTO LOGGING_EVENT (TIMESTMP, FORMATTED_MESSAGE, ...) VALUES ('1269266024834', 'a message', ...) RETURNING "event_id"
note how event_id is between quotes after the RETURNING keyword.
This bug is fixed in [1] by lower-casing "EVENT_ID" when passed as the return value of a prepared statement.
[1] http://github.com/ceki/logback/commit/39dbbf9a5f7d41
> ch.qos.logback.core.db.DBAppenderBase tries to use column "EVENT_ID" but does not exist
> ---------------------------------------------------------------------------------------
>
> Key: LBCORE-126
> URL: http://jira.qos.ch/browse/LBCORE-126
> Project: logback-core
> Issue Type: Bug
> Components: Appender
> Affects Versions: 0.9.17
> Environment: postgresql
> Reporter: Brian Edwards
> Assignee: Ceki Gulcu
> Priority: Critical
> Fix For: 0.9.19
>
>
> on line 91 in ch.qos.logback.core.db.DBAppenderBase append creates a java.sql.PreparedStatement by calling connection.prepareStatement(getInsertSQL(), new String[] {"EVENT_ID"}); but because postgres is case sensitive the column does not exist because it is called event_id
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the logback-dev
mailing list