Skip to content

Foreign key referencing table with uppercase character(s) breaks schema "ER Diagram" generation. #882

Description

@BrianFehrleCMD

Version tested: 1.4
PostgreSQL Version: PostgreSQL 17.10

It looks like when a foreign key is added to reference a table with an uppercase character in the name, the ER Diagram generation breaks.

To recreate:

Step 1: Create tables

CREATE TABLE public."Testtable" (
    id serial primary key,
    one text NOT NULL,
    two text NOT NULL
);


CREATE TABLE public.some_othertable (
    id text NOT NULL,
    other_id integer NOT NULL
);

Step 2: Test diagram.
In the program, navigate to the schema public, right click and select 'ER Diagram', it will generate a diagram with two tables.

Step 3: Create a foreign key:

ALTER TABLE ONLY public.some_othertable ADD CONSTRAINT ibrokeit FOREIGN KEY (other_id) REFERENCES public."Testtable"(id);

Step 4: Test Diagram again.
Generate the 'ER Diagram' again and it will error with something like:

Image

Log output:

[07/01/2026 19:03:42] ERROR [pid:3031965] [app.views.logging:15] [request_id:28] [JS Error] Error: Can not create edge `22116205-658d-4e55-a9c8-effc20083897` with nonexistant target `"Testtable"`
    at Ve (http://localhost:28409/static/dist/assets/ERDTab.DsN5xvgJ.js:3:12281)
    at Ie.restore (http://localhost:28409/static/dist/assets/ERDTab.DsN5xvgJ.js:13:28507)
    at new je (http://localhost:28409/static/dist/assets/ERDTab.DsN5xvgJ.js:13:25069)
    at Proxy.add (http://localhost:28409/static/dist/assets/ERDTab.DsN5xvgJ.js:13:32410)
    at Proxy.initGraph (http://localhost:28409/static/dist/assets/ERDTab.DsN5xvgJ.js:16:113270)
    at http://localhost:28409/static/dist/assets/ERDTab.DsN5xvgJ.js:16:112167
  • Brian

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions