skip to Main Content

I tried exporting the data to CSV and importing it to the new database, but it does not seem to respect the case sensitivity of column names. "createdAt" becomes "createdat" and does not change even when trying to modify the table. How do I do it correctly?

2

Answers


  1. You can use the "dump" and "restore" feature of datagrip which uses "pg_dump" and "pg_restore" behind the scenes, this will respect the case-sensitivity of the column names.

    Here are the steps:

    1. dump the database/table by right clicking on it and choose the "export with ‘pg_dump’" option, this will export the dump to selected destination. Make sure you add ".dump" as the destination file extension.
      enter image description here
    2. restore the database/table by right clicking on your second database and choose the "Restore…" option, selected the file that you exported in step 1.

    Note: If the path to pg_dump or pg_restore is invalid, you can use the "which" command in your terminal and get the correct path from there.

    Login or Signup to reply.
  2. This is an issue related to the character case not being retained in postgres data sources. We have this issue reported here and a fix should be included in the DataGrip 2024.3 version

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search