Describe the bug
When viewing a table's structure or generating its SQL, functional indexes (e.g., CREATE UNIQUE INDEX ... ON table (column, md5(xml_column::text))) are not shown in the output. The table appears to have fewer indexes than it actually does.
To Reproduce
Steps to reproduce the behavior:
This was done using postgres databases.
- Create a table, using a query/SQL
CREATE TABLE IF NOT EXISTS "public"."test12345" (
"run_uuid" UUID NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(),
"run_time" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
"extracted_feed_uuid" UUID NOT NULL,
"extracted_timestamp" TIMESTAMP WITH TIME ZONE NOT NULL,
"feed_xml" XML NOT NULL
);
- Run this query.
- On completion, you may need to reload, or exit out and reopen, DBgate for the table to appear in the bottom left of the screen.
- In the same database when you ran the first query, run this query
CREATE UNIQUE INDEX IF NOT EXISTS "test54321"
ON "public"."test12345" (
"extracted_feed_uuid",
"extracted_timestamp",
md5("feed_xml"::text)
);
Make note of that md5 part.
When successful, close and reopen DBgate again.
Right click on the table in the bottom left, then "show SQL".
You will see this:
CREATE TABLE "public"."test12345" (
"run_uuid" UUID NOT NULL DEFAULT gen_random_uuid() ,
"run_time" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now() ,
"extracted_feed_uuid" UUID NOT NULL,
"extracted_timestamp" TIMESTAMP WITH TIME ZONE NOT NULL,
"feed_xml" XML NOT NULL,
CONSTRAINT "test12345_pkey" PRIMARY KEY ("run_uuid")
);
CREATE UNIQUE INDEX "test54321"
ON "public"."test12345" (
"extracted_feed_uuid" ASC,
"extracted_timestamp" ASC
);
It's missing the md5 section.
Further, when using "structure" view, it doesn't appear correctly either
Expected behavior
This is the view when using the terminal/psql:
Table "public.test12345"
Column | Type | Collation | Nullable | Default
---------------------+--------------------------+-----------+----------+-------------------
run_uuid | uuid | | not null | gen_random_uuid()
run_time | timestamp with time zone | | not null | now()
extracted_feed_uuid | uuid | | not null |
extracted_timestamp | timestamp with time zone | | not null |
feed_xml | xml | | not null |
Indexes:
"test12345_pkey" PRIMARY KEY, btree (run_uuid)
"test54321" UNIQUE, btree (extracted_feed_uuid, extracted_timestamp, md5(feed_xml::text))
This is how DBeaver shows it
Version Information (please complete the following information):
- OS: Linux
- App Version: 7.2.1, build date 2026-06-19
- Install source: DBgate website download
- Type - Application
- Database engine: PostgreSQL 18.3
Describe the bug
When viewing a table's structure or generating its SQL, functional indexes (e.g.,
CREATE UNIQUE INDEX ... ON table (column, md5(xml_column::text))) are not shown in the output. The table appears to have fewer indexes than it actually does.To Reproduce
Steps to reproduce the behavior:
This was done using postgres databases.
Make note of that md5 part.
When successful, close and reopen DBgate again.
Right click on the table in the bottom left, then "show SQL".
You will see this:
It's missing the md5 section.
Further, when using "structure" view, it doesn't appear correctly either
Expected behavior
This is the view when using the terminal/psql:
This is how DBeaver shows it
Version Information (please complete the following information):