Lukas Fittl <lu...@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