Hi,

I am using Apache metamodel with data source PostgreSQL 11 and while executing 
insert(InsertInto) or update statement query is failing if table column name 
contains upper characters.
According to logs statement is generating properly but it seems postgresql is 
converting column names to lowercases.

Is it know issue? Is there any workaround for resolving it?

Logs
org.apache.metamodel.jdbc.JdbcUtils Could not execute insert statement: INSERT 
INTO "public"."employee" (id,name,age,dob,mobileNo,zip,profilePicture,vendor) 
VALUES (?,?,?,?,?,?,?,?): ERROR: column "mobileno" of relation "employee" does 
not exist
  Position: 50, Error code=0, SQL state=42703
org.postgresql.util.PSQLException: ERROR: column "mobileno" of relation 
"employee" does not exist
  Position: 50
                at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
 [org.postgresql.jdbc42:42.2.5]
                at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
 [org.postgresql.jdbc42:42.2.5]
                at 
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) 
[org.postgresql.jdbc42:42.2.5]
                at 
org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) 
[org.postgresql.jdbc42:42.2.5]
                at 
org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) 
[org.postgresql.jdbc42:42.2.5]
                at 
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)
 [org.postgresql.jdbc42:42.2.5]
                at 
org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:120)
 [org.postgresql.jdbc42:42.2.5]
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at 
org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport$StatementProxy.invoke(AbstractQueryReport.java:235)
 [org.apache.sling.datasource:1.0.2]
                at com.sun.proxy.$Proxy195.executeUpdate(Unknown Source)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at 
org.apache.tomcat.jdbc.pool.interceptor.StatementDecoratorInterceptor$StatementProxy.invoke(StatementDecoratorInterceptor.java:261)
 [org.apache.sling.datasource:1.0.2]
                at com.sun.proxy.$Proxy195.executeUpdate(Unknown Source)
                at 
org.apache.metamodel.jdbc.JdbcSimpleUpdateCallback.executePreparedStatement(JdbcSimpleUpdateCallback.java:45)
 [aem-dermis-core:3.0.33.SNAPSHOT]
                at 
org.apache.metamodel.jdbc.JdbcUpdateCallback.executePreparedStatement(JdbcUpdateCallback.java:71)
 [aem-dermis-core:3.0.33.SNAPSHOT]
                at 
org.apache.metamodel.jdbc.JdbcUpdateCallback.executeInsert(JdbcUpdateCallback.java:272)
 [aem-dermis-core:3.0.33.SNAPSHOT]
                at 
org.apache.metamodel.jdbc.JdbcInsertBuilder.execute(JdbcInsertBuilder.java:85) 
[aem-dermis-core:3.0.33.SNAPSHOT]


Regards,
Vijay Kumar J

Reply via email to