Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-420

Syntax error at or near "." because table name is reserved word

    XMLWordPrintable

Details

    • CP: Roadmap backlog
    • 1
    • Core: Platform

    Description

      If a table name is a reserved word
      https://www.postgresql.org/docs/current/sql-keywords-appendix.html
      then the PostgreSQL error message syntax error at or near "." may arise.

      Example: user is a reserved word. The query

      select * from diku_mod_inventory_storage.user where user.jsonb is not null;

      will therefore fail at the . of user.jsonb.

      Option 1: Quote identifiers as described in https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
      Example:

      select * from "diku_mod_inventory_storage"."user" where "user".jsonb is not null;

      Option 2: Disallow reserved words as table names. Add a check to RMB's SchemaMaker that throws an exception if any table name is a reserved word in PostgreSQL or SQL-92.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                julianladisch Julian Ladisch
                julianladisch Julian Ladisch
                Hongwei Ji Hongwei Ji
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases