Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: value too long for type character varying(255) #2216

Closed
prachim-collab opened this issue Oct 26, 2022 · 3 comments · Fixed by #2217
Closed

Error: value too long for type character varying(255) #2216

prachim-collab opened this issue Oct 26, 2022 · 3 comments · Fixed by #2217
Assignees

Comments

@prachim-collab
Copy link
Contributor

Error in Db migration script.

Message    : ERROR: value too long for type character varying(255)
Location   : marquez/db/migration/V48__dataset_symlinks.sql (/usr/src/app/file:/usr/src/app/datakin-api.jar!/marquez/db/migration/V48__dataset_symlinks.sql)
Line       : 16
Statement  : INSERT INTO dataset_symlinks (dataset_uuid, name, namespace_uuid, is_primary, created_at, updated_at)
SELECT d.uuid, d.name, d.namespace_uuid, TRUE, d.created_at, d.updated_at FROM datasets d

V48__dataset_symlinks.sql Db migration script is throwing error while it inserts data in dataset_symlinks table

@boring-cyborg
Copy link

boring-cyborg bot commented Oct 26, 2022

Thanks for opening your first issue in the Marquez project! Please be sure to follow the issue template!

@pawel-big-lebowski
Copy link
Collaborator

@prachim-collab You're right 😢 This happens because of:

The solution to this would be:

  • modify V48__dataset_symlinks.sql and change column type to varchar for those who failed on migration,
  • create extra migration step to alter column for those who succeeded migration so that they can have longer names in future.

@prachim-collab
Copy link
Contributor Author

@prachim-collab You're right 😢 This happens because of:

The solution to this would be:

  • modify V48__dataset_symlinks.sql and change column type to varchar for those who failed on migration,

The change to varchar should take effect for all old and new rows automatically.

  • create extra migration step to alter column for those who succeeded migration so that they can have longer names in future.

The insert statement in V48__dataset_symlinks.sql would have inserted partial data successfully so we also need to modify the insert to fail gracefully on duplicate keys and continue inserting missing data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants