I accidentally asked chatGPT how to implement the following requirement:
Add a field to PostgreSQL, and insert this field after a specific field.
chatGPT failed miserably and used solutions for MySQL:
ALTER TABLE moldata.main ALTER COLUMN energy SET AFTER moldata.eg;
It gave an error, and then confidently split it into two statements: first delete, then insert, but still gave an error.
We had this conversation over a dozen times...
Finally, after Googling, I discovered that PostgreSQL does not support changing the order of fields at all.