On Thu, Dec 1, 2022 at 6:41 PM Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote: > On 12/1/22 09:24, Dominique Devienne wrote: > > I guess is a DBA-versus-Developer point-of-view difference. --DD > > What this points to is that there are multiple ways to handle this, many > external to the server itself. My take is that the system catalogs are > there for the proper operation of the server and that is their task, > first and foremost. If you can piggyback of that then great, but with > the knowledge that the information may change to meet the needs of the > server not external users. I see. Still, Oracle preserves SQL as-is. SQLite preserve SQL as-is. Would be nice if PostgreSQL did too. That's all I'm saying. Having in libpq functionality that allows to do the same kind of SQL normalization / rewriting done server-side would help. Then I could use that to generate the DDL "just right" the first time. For now, our current work-around is a two step process. We first generate at-build-time the DDL using "our syntax" and instantiate the schema. Then introspect that and re-generate code with the "rewritten syntax". Subsequent generation (it's dynamic, at runtime) will use the re-generated code that matches the syntax re-write. Thus now the introspection and diff'ing match the in-memory DDL. Still, that's a PITA. I of course don't contest that PostgreSQL maintains what it needs. But ALSO maintaining the original, at least until a re-write is necessary on renames, would go A LONG WAY to satisfy the OP and myself in our use-cases. FWIW. --DD