1

There are multiple databases used in my application and redshift is one of them. Because of using hibernate framework for configuring the connections I am trying to use appropriate dialect for redshift. But both PostgreSQL9Dialect and MySQL5InnoDBDialect are working for me.

Curious to know which dialect is best for Redshift? Also, I have below questions.

Is dialect mandatory while using hibernate?

What is the default dialect if nothing is mentioned?

Vamsi Vegesna
  • 87
  • 1
  • 15
  • Given Amazon Redshift is based on PostgreSQL 8, it should be clear that you shouldn't be using a MySQL based dialect. That probably only works by accident until you hit something that isn't valid PostgreSQL/Redshift syntax. – Mark Rotteveel Jun 03 '19 at 14:12

1 Answers1

3

As Redshift is based on PostgreSQL 8.0.2 (see this) , it is better to use PostgreSQL dialect. Since it has some differences between PostgreSQL, it is not surprise that it will not work for some cases but you could have a try.

Dialect is mandatory for hibernate . If you do not specify a dialect , it will try to choose the most suitable one for you based on the metadata get from the JDBC driver. If no dialect can be chosen , it will throw an exception saying that Unable to determine Dialect to use.

Ken Chan
  • 84,777
  • 26
  • 143
  • 172