1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

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
This commit is contained in:
Alvaro Herrera
2018-02-17 19:02:15 -03:00
parent cef60043dd
commit a26116c6cb
3 changed files with 81 additions and 72 deletions

View File

@ -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);
}
/*