0

While I was trying to hash the owner_name column with this set of Liquibase Script as suggested by the Corda here: I have used the PostgreSQL DB

<changeSet author="My_Company" id="replace owner_name with owner_name_hash">
<addColumn tableName="iou_states">
    <column name="owner_name_hash" type="nvarchar(130)"/>
</addColumn>
<update tableName="iou_states">
    <column name="owner_name_hash" valueComputed="hash(owner_name)"/>
</update>
<dropColumn tableName="iou_states" columnName="owner_name"/>

I was getting the following error:

Reason: liquibase.exception.DatabaseException: Invalid parameter count for "HASH", expected count: "2..3"; SQL statement

The reason I am not understanding here what are the other fields we need to give to the hash function.

Can any one help me with this, and provide the correct script which will do the hashing of the column in table. Many Thanks in Advance.

1 Answers1

0

Liquibase is doing what you're telling it to do correctly, but the syntax is not valid because it needs an additional parameter for the HASH. The PostgreSQL docs don't have a lot of information about the available parameters, but here are a couple of links that have more details.

tabbyfoo
  • 355
  • 1
  • 8