Logstash JDBC Output to Postgres case-sensitive issue

Hi, i got issue with logstash when trying to import data to postgres table. here are my output config:

and it always show error that :[ERROR] 2024-01-26 20:22:38.348 [[main]>worker0] jdbc - JDBC - Exception. Not retrying {:exception=>#<Java::OrgPostgresqlUtil::PSQLException: ERROR: column "candidateid" of relation "language" does not exist, dont know why system always change the name from camel case to lower case.

1 Like

Have you tried setting lowercase_column_names => false?

It defaults to true Jdbc input plugin | Logstash Reference [8.12] | Elastic

I think various databases have requirements or strong suggestions to lowercase column names which might be where this default comes from. See: Don't Do This - PostgreSQL wiki

But i am using jdbc output and the configuration does not have lowercase_column_names :(((

But i am using jdbc output and the configuration does not have lowercase_column_names :(((

1 Like

The default value for that setting is true so if you have not explicitly set it to false then it defaults to true.

In other words, this is the default behavior. If you want different behavior, you have to set that setting to false.

lowercase_column_names

  • Value type is boolean
  • Default value is true

Whether to force the lowercasing of identifier fields

tks u for anwers me, i am using this jdbc ouput , refer to this link repos, GitHub - theangryangel/logstash-output-jdbc: JDBC output for Logstash and this does not provide lowercase_column_names. itried adding this to ouput configuraiton like this


but it showed me error that can not recognize the 'lowercase_column_names

Oh sorry, I understand now. Unfortunately that's not an elastic plugin and the original author of that plugin doesn't appear to be supporting it anymore so I'm not sure we'll be able to help on this one

ya, thank you for replying. Does Elastic provide any other plugins for this feature? If not, I think I have to manually change the column name to make it work.

I don't believe there is a currently supported way to get the behavior.

This happens down in postgres, not in logstash (see the Dont Do This link that @strawgate posted). You could try

statement => [
    'INSERT INTO language (proficiency, "candidateIdName", ...

but I do not know if the double quotes will make it all the way through to the DB.

1 Like

ya,agree with u that the error comes from postgres itself. I tried this way before but unfortunately it showed error 'syntax error'.