-
Notifications
You must be signed in to change notification settings - Fork 21
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
FATAL icingadb-migrate/misc.go:119 pq: syntax error at or near "name" #884
Comments
Thank you for reporting this bug and please excuse the trouble. The failing query is in the Unfortunately I was unable to reproduce this error locally. Could you please provide some more information about your setup? Which version of PostgreSQL are you using? Could you please execute the following query manually in a SELECT ch.commenthistory_id, UNIX_TIMESTAMP(ch.entry_time) entry_time,
ch.entry_time_usec, ch.entry_type, ch.author_name, ch.comment_data, ch.is_persistent,
COALESCE(UNIX_TIMESTAMP(ch.expiration_time), 0) expiration_time,
COALESCE(UNIX_TIMESTAMP(ch.deletion_time), 0) deletion_time,
ch.deletion_time_usec,
COALESCE(ch.name, CONCAT(o.name1, '!', COALESCE(o.name2, ''), '!', ch.commenthistory_id, '-', ch.object_id)) name,
o.objecttype_id, o.name1, COALESCE(o.name2, '') name2
FROM icinga_commenthistory ch
INNER JOIN icinga_objects o ON o.object_id=ch.object_id; |
I have just given it another shot on a Debian 11, using PostgreSQL in version 13+225+deb11u1, were I was able to reproduce the error. Please give us some time to work on a fix and thanks again for reporting this.
|
The issue at hand is the rewritten
This keyword list contains NAME, both in version 13 as well as in the latest version 17, but stating it as "non-reserved". I will look into adding the |
By introducing an explicit "AS" to set output names in the SELECT column list, there are no issues with reserved names. Unfortunately, this happened on PostgreSQL in the older version 13 with the reserved name "name". Adding "AS" mitigates this issue. Furthermore, I have put each column name in its own line for the SELECT queries to ease the readability of the query itself and of future diffs. Closes #884.
@netphantm: I have created #885 addressing this very issue. Please feel free to try it out, if you like to. |
cool, it worked ;)
|
Describe the bug
I get an error on migrating the ido to icingadb
To Reproduce
Expected behavior
migration to run smoothly
Your Environment
Include as many relevant details about the environment you experienced the problem in
Additional context
icingadb-migration.yml:
The text was updated successfully, but these errors were encountered: