Informix Error -19821: Cannot rename a table using a synonym.
Cause and resolution
Cannot rename a table using a synonym.
You cannot rename a table using a synonym. Specify the <table-name> instead. </table-name>
If you intend to rename the synonym, then drop the existing synonym and create a new one.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-19821 fires when RENAME TABLE (or similar) is given a synonym instead of the actual table
name — per the official guidance.
- A synonym used in place of the actual table name in a rename operation, per the official guidance — the direct, only cause.
Solutions / Resolution
- Specify the actual table name instead of the synonym, per the official guidance.
- If the synonym itself needs renaming, drop it and create a new one, per the official guidance.
Examples
Renaming via a synonym
RENAME TABLE mysynonym TO newname;
Corrected
RENAME TABLE actual_table_name TO newname;
Diagnostic Checks
- Check whether the name used is a synonym, and substitute the actual table name.
Related Errors / Related Topics
- -19822 — "Cannot alter or truncate a table or drop a table or view using a synonym."
The same restriction, extended to
ALTER/TRUNCATE/DROPrather thanRENAME.
RENAME TABLE can't target a synonym — use the actual table name.