0

I'm migrating a table with a column field that contains query's from BigSql to Greenplum.

In the old query I have a funcition DBMS_UTILITY.GET_HASH_VALUE(Field,0,10) that returns an Integer value.

I tried to use the function md5 in greenplum and casting it, but I receive error.

Can you please help me? Do you know a function in PostgreSql/Greenplum that works like the DBMS_UTILITY.GET_HASH_VALUE and returns a Integer value?

Camel878
  • 1
  • 2
  • You can convert the hex value from `md5()` to a bigint: https://stackoverflow.com/questions/8316164 –  Jul 29 '19 at 07:51
  • Don't post code in comments. **[edit]** your question by clicking on the [edit] link below it. –  Jul 29 '19 at 12:27
  • I tried the solution purposed in the link.Anyway: I need Integer values from 0 to 9 and casting to bit i cannot reach this interval. DBMS_UTILITY.GET_HASH_VALUE(Field,0,10) VS the function above, don't return the same values. Any suggestions? Thank you so much! – – Camel878 Jul 29 '19 at 13:44
  • Someone who can help me? – Camel878 Jul 30 '19 at 13:02

0 Answers0