# Logstash JDBC Output to Postgres case-sensitive issue

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881>\
**Category:** Logstash\
**Tags:** jdbc\
**Created:** [January 26, 2024, 1:35pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881 "2024-01-26T13:35:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![h\_ng\_d\_ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/h_ng_d_ng/32/125786_2.png) [@h\_ng\_d\_ng](https://discuss.elastic.co/u/h_ng_d_ng)\
**Post date:** [January 26, 2024, 1:35pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/1 "2024-01-26T13:35:03Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/7/17e209c2314520066b9eabb54bc6faac405c1118.png)

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.

---

<div class="post-metadata">

**Author:** ![strawgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/strawgate/32/131008_2.png) [@strawgate](https://discuss.elastic.co/u/strawgate)\
**Post date:** [January 26, 2024, 1:51pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/2 "2024-01-26T13:51:59Z")

</div>

Have you tried setting `lowercase_column_names => false`?

It defaults to true [Jdbc input plugin | Logstash Reference [8.12] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-lowercase_column_names)

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](https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_upper_case_table_or_column_names)

---

<div class="post-metadata">

**Author:** ![h\_ng\_d\_ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/h_ng_d_ng/32/125786_2.png) [@h\_ng\_d\_ng](https://discuss.elastic.co/u/h_ng_d_ng)\
**Post date:** [January 26, 2024, 2:24pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/4 "2024-01-26T14:24:32Z")

</div>

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 :(((

---

<div class="post-metadata">

**Author:** ![strawgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/strawgate/32/131008_2.png) [@strawgate](https://discuss.elastic.co/u/strawgate)\
**Post date:** [January 26, 2024, 2:30pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/5 "2024-01-26T14:30:33Z")

</div>

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](https://www.elastic.co/guide/en/logstash/current/configuration-file-structure.html#boolean)
> - Default value is **`true`**
> 
> Whether to force the lowercasing of identifier fields

---

<div class="post-metadata">

**Author:** ![h\_ng\_d\_ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/h_ng_d_ng/32/125786_2.png) [@h\_ng\_d\_ng](https://discuss.elastic.co/u/h_ng_d_ng)\
**Post date:** [January 26, 2024, 2:44pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/6 "2024-01-26T14:44:33Z")

</div>

> [@strawgate](#):
>
> lowercase\_column\_names

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](https://github.com/theangryangel/logstash-output-jdbc) and this does not provide `lowercase_column_names`. itried adding this to ouput configuraiton like this

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/1/316b12d262ee46f108729a3fb4911d3167dd979a.png)  
but it showed me error that can not recognize the '`lowercase_column_names`

---

<div class="post-metadata">

**Author:** ![strawgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/strawgate/32/131008_2.png) [@strawgate](https://discuss.elastic.co/u/strawgate)\
**Post date:** [January 26, 2024, 3:24pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/7 "2024-01-26T15:24:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![h\_ng\_d\_ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/h_ng_d_ng/32/125786_2.png) [@h\_ng\_d\_ng](https://discuss.elastic.co/u/h_ng_d_ng)\
**Post date:** [January 26, 2024, 4:25pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/8 "2024-01-26T16:25:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![strawgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/strawgate/32/131008_2.png) [@strawgate](https://discuss.elastic.co/u/strawgate)\
**Post date:** [January 26, 2024, 6:23pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/9 "2024-01-26T18:23:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 26, 2024, 7:48pm UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/10 "2024-01-26T19:48:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![h\_ng\_d\_ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/h_ng_d_ng/32/125786_2.png) [@h\_ng\_d\_ng](https://discuss.elastic.co/u/h_ng_d_ng)\
**Post date:** [January 28, 2024, 9:53am UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/11 "2024-01-28T09:53:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 25, 2024, 9:54am UTC](https://discuss.elastic.co/t/logstash-jdbc-output-to-postgres-case-sensitive-issue/351881/12 "2024-02-25T09:54:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
