Extraneous log messages from Postgres JDBC driver
Description
Environment
Linux, Java 1.6, Liquibase 1.9.5
Activity
Nathan Voxland April 15, 2010 at 7:56 PM
I applied the changes to trunk as well. Although I didn't remove them, just changed them to log level debug
Don Smith April 8, 2010 at 8:49 PM
Fixed:
------------------------------------------------------------------------
r1331 | donsmith | 2010-04-08 16:47:35 -0400 (Thu, 08 Apr 2010) | 1 line
Changed paths:
M /CORE/branches/1_9/core/src/java/liquibase/database/structure/SQLiteDatabaseSnapshot.java
M /CORE/branches/1_9/core/src/java/liquibase/database/structure/SqlDatabaseSnapshot.java
JIRA CORE-587: removed erroneous log message from SqlDatabaseSnapshot and SQLiteDatabaseSnapshot
------------------------------------------------------------------------
Don Smith April 8, 2010 at 8:10 PMEdited
The offending logging statements are in the SqlDatabaseSnapshot and SQLiteDatabaseSnapshot classes:
find core/src/java -name '*.java' -exec grep -H 'Could not find table or view' {} \;
core/src/java/liquibase/database/structure/SqlDatabaseSnapshot.java: log.info("Could not find table or view " + tableName + " for column " + columnName);
core/src/java/liquibase/database/structure/SQLiteDatabaseSnapshot.java: log.info("Could not find table or view " + tableName + " for column " + columnName);
The method readColumns() selects all columns from the database dictionary, then searches through the ResultSet looking for columns with a table_name value that matches a table or view in the tablesMap or viewsMap, respectively. When it does not find a match, it logs this error. This is erroneous, as some of the columns belong to primary keys or other types, at least in the case of Postgres.
Removing the log message will solve the problem.
When running a changelog on Postgres, the preCondition checks that result in "table not found" etc. print messages to the output log, and keep printing for every subsequent error, i.e. accumulating and printing the whole list of all log messages for each changeset:
[updateDatabase] Changeset DbCreateTables.xml::500::IDMRBPM:MD5Sum: 1fea4d028789271ebfd4baf856e18a8)
[updateDatabase] Creating table PORTALPRODUCERS
[updateDatabase] Could not find table or view portalcategory_pk for column elementtype
[updateDatabase] Could not find table or view portalcategory_pk for column elementid
[updateDatabase] Could not find table or view portalcategory_pk for column categoryid
[updateDatabase] Changeset DbCreateTables.xml::250::IDMRBPM:MD5Sum: 98c04e22ea5f8def4f1c675c3faaa82)
[updateDatabase] Creating table PORTALREGISTRY
[updateDatabase] Could not find table or view portalcategory_pk for column elementtype
[updateDatabase] Could not find table or view portalcategory_pk for column elementid
[updateDatabase] Could not find table or view portalcategory_pk for column categoryid
[updateDatabase] Could not find table or view producers_pk for column producerid
[updateDatabase] Changeset DbCreateTables.xml::300::IDMRBPM:MD5Sum: baa920fe21ec6f45e9f3a78150e0)
[updateDatabase] Creating table PORTALPORTLETHANDLES
[updateDatabase] Could not find table or view portalcategory_pk for column elementtype
[updateDatabase] Could not find table or view portalcategory_pk for column elementid
[updateDatabase] Could not find table or view portalcategory_pk for column categoryid
[updateDatabase] Could not find table or view portalregistry_pk for column portletid
[updateDatabase] Could not find table or view producers_pk for column producerid
[updateDatabase] Changeset DbCreateTables.xml::400::IDMRBPM:MD5Sum: 463c31262dffee26e25698e8243145)
[updateDatabase] Creating table PORTALPORTLETSETTINGS
[updateDatabase] – Creating primary key PORTLETSETTINGS_PK
[updateDatabase] Could not find table or view portalcategory_pk for column elementtype
[updateDatabase] Could not find table or view portalcategory_pk for column elementid
[updateDatabase] Could not find table or view portalcategory_pk for column categoryid
[updateDatabase] Could not find table or view portalregistry_pk for column portletid
[updateDatabase] Could not find table or view portlethandles_pk for column portletiid
[updateDatabase] Could not find table or view producers_pk for column producerid
[updateDatabase] Changeset DbCreateTables.xml::600::IDMRBPM:MD5Sum: 1c88cb5efe37d9a66e4d96a19eed6c8)
[updateDatabase] Creating table PORTALPRODUCERREGISTRY