From a26116c6cbf4117e8efaa7cfc5bacc887f01517f Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Sat, 17 Feb 2018 19:02:15 -0300 Subject: Refactor format_type APIs to be more modular Introduce a new format_type_extended, with a flags bitmask argument that can modify the default behavior. A few compatibility and readability wrappers remain: format_type_be format_type_be_qualified format_type_with_typemod while format_type_with_typemod_qualified, which had a single caller, is removed. Author: Michael Paquier, some revisions by me Discussion: 20180213035107.GA2915@paquier.xyz --- contrib/postgres_fdw/deparse.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'contrib/postgres_fdw/deparse.c') diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index f4b38c65aca..02894a7e354 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -854,10 +854,12 @@ foreign_expr_walker(Node *node, static char * deparse_type_name(Oid type_oid, int32 typemod) { - if (is_builtin(type_oid)) - return format_type_with_typemod(type_oid, typemod); - else - return format_type_with_typemod_qualified(type_oid, typemod); + uint8 flags = FORMAT_TYPE_TYPEMOD_GIVEN; + + if (!is_builtin(type_oid)) + flags |= FORMAT_TYPE_FORCE_QUALIFY; + + return format_type_extended(type_oid, typemod, flags); } /* -- cgit v1.2.3