Problem with PostgreSQL connection and table structure view

Wappler Version : last stable 6.0.0
Operating System : Sonoma 14.1.1
Server Model: Node.JS
Database Type: DO PostgreSQL
Hosting Type: custom server

I have some ERROR CONNECTION - when I try to add field in table - process with applying database successfully, but new field not show in table. When I trying refresh full scheme - have error

An error has occurred connecting to the database!

SELECT DISTINCT rc.TABLE_NAME AS ‘table’, kcu.COLUMN_NAME AS ‘column’, c.ORDINAL_POSITION, rc.REFERENCED_TABLE_NAME AS ‘foreign_key_table’, kcu.REFERENCED_COLUMN_NAME AS ‘foreign_key_column’, rc.CONSTRAINT_NAME AS ‘constraint_name’, rc.UPDATE_RULE AS on_update, rc.DELETE_RULE AS on_delete FROM information_schema.referential_constraints AS rc JOIN information_schema.key_column_usage AS kcu ON rc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME JOIN information_schema.columns c ON c.TABLE_NAME = rc.TABLE_NAME AND c.COLUMN_NAME = kcu.COLUMN_NAME WHERE rc.CONSTRAINT_SCHEMA = $1 ORDER BY rc.TABLE_NAME, c.ORDINAL_POSITION - syntax error at or near “‘table’”

ChatGPT gave advise - The issue is related to the use of single quotes around aliases like 'table' . In PostgreSQL, double quotes should be used for aliases, not single quotes. Also, it’s advisable to use lowercase identifiers for table and column names to avoid potential conflicts.

Could there really be an error in the request?

also the last two fields that I added are visible when viewing the data, but are not visible in the structure and cannot be changed there

Receipt to solve

  1. Logoff and relogin in Wappler
  2. Rollback changes (where was added colums)
  3. edit changes files (hide in comment)
  4. re apply changes

So what was the initial problem? Case sensitivity in field names?

No, the problem was with adding fields to the table - the names were normal, lower case, Wappler just didn’t reflect the changes and seemed to be trying to re-create the fields on further actions - but that’s my guess.

Did you try manualky refreshing the schema after applying the changes?
Sometime it does not refresh automatically so wappler get confused thinking the fields are not present (by reference to local schema copy) so tries to reapply them again.

That’s great you were able to utilize ChatGPT!

1 Like

Of course, I know about this and often update the scheme - but in this case it did not work.

1 Like