diff options
author | Michael Paquier <michael@paquier.xyz> | 2020-07-06 13:06:08 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2020-07-06 13:06:08 +0900 |
commit | aa38434824c4fa52e55a9c7465b24c246caddc81 (patch) | |
tree | 40d8a98aaaba81c7e598b30f92d948b2581ba396 /src/include/utils/regproc.h | |
parent | 04c7f4144fec3bcddc82b6abdbfebd88989f7953 (diff) |
Refactor routines for name lookups of procedures and operators
This introduces a new set of extended routines for procedure and
operator name lookups, with a flag bitmask argument that can modify the
result. The following options are available:
- Force schema qualification, ignoring search_path. This is similar to
the existing option for format_{operator|procedure}_qualified().
- Force NULL as result instead of a numeric OID for an undefined
object. This option is new.
This is a refactoring similar to 1185c78, that will be used for a future
patch to improve the SQL functions providing information using object
addresses for undefined objects.
Author: Michael Paquier
Reviewed-by: Aleksander Alekseev, Dmitry Dolgov, Daniel Gustafsson,
Álvaro Herrera
Discussion: https://postgr.es/m/CAB7nPqSZxrSmdHK-rny7z8mi=EAFXJ5J-0RbzDw6aus=wB5azQ@mail.gmail.com
Diffstat (limited to 'src/include/utils/regproc.h')
-rw-r--r-- | src/include/utils/regproc.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/utils/regproc.h b/src/include/utils/regproc.h index 383dfe641e4..145452a5ad7 100644 --- a/src/include/utils/regproc.h +++ b/src/include/utils/regproc.h @@ -15,6 +15,16 @@ #include "nodes/pg_list.h" +/* Control flags for format_procedure_extended */ +#define FORMAT_PROC_INVALID_AS_NULL 0x01 /* NULL if undefined */ +#define FORMAT_PROC_FORCE_QUALIFY 0x02 /* force qualification */ +extern char *format_procedure_extended(Oid procedure_oid, bits16 flags); + +/* Control flags for format_operator_extended */ +#define FORMAT_OPERATOR_INVALID_AS_NULL 0x01 /* NULL if undefined */ +#define FORMAT_OPERATOR_FORCE_QUALIFY 0x02 /* force qualification */ +extern char *format_operator_extended(Oid operator_oid, bits16 flags); + extern List *stringToQualifiedNameList(const char *string); extern char *format_procedure(Oid procedure_oid); extern char *format_procedure_qualified(Oid procedure_oid); |