Disclosure: Navicat gave me a one-year licence for Navicat for PostgreSQL in exchange for an honest review. Everything below I tested on a 14-day trial build of Navicat for PostgreSQL 18.0.6 on an M-series Mac, against PostgreSQL 18 running locally in Postgres.app. Navicat didn't see this before it went out.
A couple of weeks ago I wrote about the SQL your Drizzle schema doesn't know about: the triggers, comments and extensions that live in a hand-written migration file, and the triggers Postgres quietly drops when a table gets recreated. I built drizzle-pg-extras so that SQL sits next to the table definition.
So when Navicat asked for a review, the obvious test was: point a database GUI at exactly that kind of SQL. What does it show, and what does its schema diff do with it?
The setup
Two throwaway databases on the same server:
-
nav_refis what I meant to have: auserstable,pg_trgm, a GIN trigram index ondisplay_name, aset_updated_at()function with aBEFORE UPDATEtrigger, and comments on the table and onemail. -
nav_migis what a migration that skipped the hand-written file leaves you with: just the bareuserstable.
-- nav_ref
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE TABLE users (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
email text NOT NULL UNIQUE,
display_name text,
updated_at timestamptz NOT NULL DEFAULT now()
);
COMMENT ON TABLE users IS 'Accounts. One row per sign-up.';
COMMENT ON COLUMN users.email IS 'Lower-cased before insert.';
CREATE FUNCTION set_updated_at() RETURNS trigger
LANGUAGE plpgsql AS $$
BEGIN
NEW.updated_at := now();
RETURN NEW;
END;
$$;
CREATE TRIGGER users_set_updated_at
BEFORE UPDATE ON users
FOR EACH ROW EXECUTE FUNCTION set_updated_at();
CREATE INDEX users_display_name_trgm ON users USING gin (display_name gin_trgm_ops);
What the object designer shows
This part is good. Open the table designer and the column comment sits right in the Fields grid, and the table comment is in the info pane. The Triggers tab lists users_set_updated_at as row-level, BEFORE, on UPDATE, enabled, and points at public.set_updated_at. The DDL tab prints the whole table back: identity column, constraints, the trigram index, the trigger and both comments.
That's what I want from a GUI. If a trigger went missing after a table rebuild, this is where you'd spot it at a glance instead of querying pg_trigger.
One nit: it prints the trigger as EXECUTE PROCEDURE, the older spelling. Postgres still accepts it, but if you diff Navicat's DDL against your own migration you'll get noise there.
Structure Synchronization: the useful part and the sharp edge
I compared nav_ref (source) with nav_mig (target), default options.
It found everything that was missing. users came back as "to be modified", and its script was just the two COMMENT ON statements, which is exactly right. The function, the index and the trigger came back as "to be created".
Two things surprised me.
The extension. There's no "compare extensions" option, and the diff never emitted CREATE EXTENSION pg_trgm. Instead it listed all 31 of pg_trgm's functions as loose functions to create, one by one. None of the "to be created" rows are ticked by default, which is the safe choice, but it means you have to work out which of 34 rows are actually yours.
What happens when you run it anyway. I ticked the table, my function, the index and the trigger, and pressed Start. Four statements ran, then the index failed:
ERROR: operator class "public.gin_trgm_ops" does not exist for access method "gin"
The trigger after it never ran. The comments and the function stayed applied. So the target ended up half-synced: comments yes, trigger no.
The fix was simple once I knew. Run CREATE EXTENSION pg_trgm on the target yourself, then compare again. The 31 functions dropped to "no operation" because the extension now owns them, and the diff was down to the index and the trigger. That ran cleanly, and a final compare showed nothing left to do.
While you're in the options: "Drop with CASCADE" is on by default. On a real database I'd turn that off before pressing Start.
The editor
Real-time error detection flagged users in COMMENT ON COLUMN users.email as an identifier it couldn't find, and the warning stayed after the same script had created the table. Oddly, COMMENT ON TABLE users one line above wasn't flagged. It didn't stop anything from running, but it's the kind of false positive you learn to ignore, which defeats the point of the check. I didn't test whether refreshing the connection clears it.
Where I landed
Navicat is a good way to see what's actually in a database, triggers and comments included, and Structure Synchronization finds drift that a Drizzle schema can't see. I'd use it to check a database after a migration, not as the thing that writes your migrations.
If you do use the sync to repair a database:
- create extensions on the target yourself first
- read the generated script before you press Start, because a failure partway leaves the earlier statements applied
- turn off Drop with CASCADE
- take a backup
And keep the SQL that matters in version control, next to the table, so the next rebuild doesn't drop it in the first place. That's the problem drizzle-pg-extras exists for, and a GUI doesn't replace it. It's a good second pair of eyes.
What I didn't test: this was one table on one local server with a trial build. No cloud databases, no large schemas, and I didn't try Code Insight's completions. Navicat also points out there's a free Navicat Premium Lite if you only need the basics.
Top comments (0)