Re: pg_get_constraintdef: Schema qualify foreign tables unless pretty printing is enabled - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_get_constraintdef: Schema qualify foreign tables unless pretty printing is enabled
Date
Msg-id 105329.1660091587@sss.pgh.pa.us
Whole thread Raw
In response to pg_get_constraintdef: Schema qualify foreign tables unless pretty printing is enabled  (Lukas Fittl <lukas@fittl.com>)
Responses Re: pg_get_constraintdef: Schema qualify foreign tables unless pretty printing is enabled
List pgsql-hackers
Lukas Fittl <lukas@fittl.com> writes:
> Whilst debugging an issue with the output of pg_get_constraintdef, we've
> discovered that pg_get_constraintdef doesn't schema qualify foreign tables
> mentioned in the REFERENCES clause, even if pretty printing
> (PRETTYFLAG_SCHEMA) is turned off.

> This is a problem because it means there is no way to get a constraint
> definition that can be recreated on another system when multiple schemas
> are in use, but a different search_path is set. It's also different from
> pg_get_indexdef, where this flag is correctly respected.

I would say that pg_get_indexdef is the one that's out of step.
I count 11 calls of generate_relation_name in ruleutils.c,
of which only three have this business of being overridden
when not-pretty.  What is the rationale for that, and why
would we move pg_get_constraintdef from one category to the
other?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: optimize lookups in snapshot [sub]xip arrays
Next
From: Lukas Fittl
Date:
Subject: Re: pg_get_constraintdef: Schema qualify foreign tables unless pretty printing is enabled