Skip to content

Pascal Case Handling in Postgresql

Victor Tomaili edited this page May 3, 2021 · 1 revision

Postgresql is cases sensitive https://stackoverflow.com/questions/21796446/postgres-case-sensitivity and when there is pascal column names and you have used pascal case in your code like following [Expression("CONCAT(CONCAT(FirstName, '-'), LastName)")] with Serenity. PostgreSQL then recognizes FirstName and LastName unquoted and then changes the column names to lowercase like firstname and lastname. When this is processed the postgresql engine cannot find because they are in pascal case in the table.

To solve this issue, you can change your code as following:

[Expression("CONCAT(CONCAT(\"FirstName\", '-'), \"FirstName\")")]
public String NameFull

or

[Expression("CONCAT(CONCAT([FirstName], '-'), [FirstName])")]
public String NameFull

or if referring to another table

[Expression("CONCAT(CONCAT(employee.[FirstName], '-'), employee.[FirstName])")]
public String NameFull

You can refer the original post here 4933

Clone this wiki locally