PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "access/xact.h"
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_language.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_transform.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "executor/functions.h"
#include "funcapi.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "nodes/nodeFuncs.h"
#include "parser/parse_coerce.h"
#include "pgstat.h"
#include "rewrite/rewriteHandler.h"
#include "tcop/pquery.h"
#include "tcop/tcopprot.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/regproc.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
struct | parse_error_callback_arg |
Functions | |
static void | sql_function_parse_error_callback (void *arg) |
static int | match_prosrc_to_query (const char *prosrc, const char *queryText, int cursorpos) |
static bool | match_prosrc_to_literal (const char *prosrc, const char *literal, int cursorpos, int *newcursorpos) |
ObjectAddress | ProcedureCreate (const char *procedureName, Oid procNamespace, bool replace, bool returnsSet, Oid returnType, Oid proowner, Oid languageObjectId, Oid languageValidator, const char *prosrc, const char *probin, Node *prosqlbody, char prokind, bool security_definer, bool isLeakProof, bool isStrict, char volatility, char parallel, oidvector *parameterTypes, Datum allParameterTypes, Datum parameterModes, Datum parameterNames, List *parameterDefaults, Datum trftypes, Datum proconfig, Oid prosupport, float4 procost, float4 prorows) |
Datum | fmgr_internal_validator (PG_FUNCTION_ARGS) |
Datum | fmgr_c_validator (PG_FUNCTION_ARGS) |
Datum | fmgr_sql_validator (PG_FUNCTION_ARGS) |
bool | function_parse_error_transpose (const char *prosrc) |
List * | oid_array_to_list (Datum datum) |
Datum fmgr_c_validator | ( | PG_FUNCTION_ARGS | ) |
Definition at line 768 of file pg_proc.c.
References CheckFunctionValidatorAccess(), elog, ERROR, fetch_finfo_record(), HeapTupleIsValid, load_external_function(), ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_VOID, ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Datum fmgr_internal_validator | ( | PG_FUNCTION_ARGS | ) |
Definition at line 725 of file pg_proc.c.
References CheckFunctionValidatorAccess(), elog, ereport, errcode(), errmsg(), ERROR, fmgr_internal_function(), HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_VOID, ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Datum fmgr_sql_validator | ( | PG_FUNCTION_ARGS | ) |
Definition at line 811 of file pg_proc.c.
References AcquireRewriteLocks(), ErrorContextCallback::arg, ErrorContextCallback::callback, castNode, check_function_bodies, check_sql_fn_retval(), check_sql_fn_statements(), CheckFunctionValidatorAccess(), elog, ereport, errcode(), errmsg(), ERROR, error_context_stack, format_type_be(), get_func_result_type(), get_typtype(), GETSTRUCT, HeapTupleIsValid, i, InvalidOid, IsA, lappend(), lfirst_node, linitial, list_make1, NameStr, NIL, ObjectIdGetDatum(), pg_analyze_and_rewrite_withcb(), PG_GETARG_OID, pg_parse_query(), PG_RETURN_VOID, pg_rewrite_query(), prepare_sql_fn_parse_info(), ErrorContextCallback::previous, parse_error_callback_arg::proname, parse_error_callback_arg::prosrc, ReleaseSysCache(), SearchSysCache1(), sql_fn_parser_setup(), sql_function_parse_error_callback(), stringToNode(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
bool function_parse_error_transpose | ( | const char * | prosrc | ) |
Definition at line 1002 of file pg_proc.c.
References ActivePortal, errposition(), geterrposition(), getinternalerrposition(), internalerrposition(), internalerrquery(), match_prosrc_to_query(), PORTAL_ACTIVE, PortalData::sourceText, and PortalData::status.
Referenced by plpgsql_compile_error_callback(), and sql_function_parse_error_callback().
|
static |
Definition at line 1127 of file pg_proc.c.
References pg_mblen().
Referenced by match_prosrc_to_query().
|
static |
Definition at line 1069 of file pg_proc.c.
References match_prosrc_to_literal(), and pg_mbstrlen_with_len().
Referenced by function_parse_error_transpose().
Definition at line 1184 of file pg_proc.c.
References DatumGetArrayTypeP, deconstruct_array_builtin(), i, lappend_oid(), NIL, and values.
Referenced by compile_plperl_function(), and PLy_procedure_create().
ObjectAddress ProcedureCreate | ( | const char * | procedureName, |
Oid | procNamespace, | ||
bool | replace, | ||
bool | returnsSet, | ||
Oid | returnType, | ||
Oid | proowner, | ||
Oid | languageObjectId, | ||
Oid | languageValidator, | ||
const char * | prosrc, | ||
const char * | probin, | ||
Node * | prosqlbody, | ||
char | prokind, | ||
bool | security_definer, | ||
bool | isLeakProof, | ||
bool | isStrict, | ||
char | volatility, | ||
char | parallel, | ||
oidvector * | parameterTypes, | ||
Datum | allParameterTypes, | ||
Datum | parameterModes, | ||
Datum | parameterNames, | ||
List * | parameterDefaults, | ||
Datum | trftypes, | ||
Datum | proconfig, | ||
Oid | prosupport, | ||
float4 | procost, | ||
float4 | prorows | ||
) |
Definition at line 70 of file pg_proc.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, add_exact_object_address(), ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, Assert, AtEOXact_GUC(), BoolGetDatum(), build_function_result_tupdesc_d(), build_function_result_tupdesc_t(), castNode, CatalogTupleInsert(), CatalogTupleUpdate(), CharGetDatum(), check_function_bodies, check_valid_internal_signature(), check_valid_polymorphic_signature(), CommandCounterIncrement(), CStringGetTextDatum, DatumGetPointer(), deleteDependencyRecordsFor(), DEPENDENCY_NORMAL, oidvector::dim1, elog, equalRowTypes(), ereport, errcode(), errdetail(), errdetail_internal(), errhint(), errmsg(), errmsg_plural(), ERROR, exprType(), Float4GetDatum(), format_procedure(), free_object_addresses(), FUNC_MAX_ARGS, get_element_type(), get_func_input_arg_names(), get_transform_oid(), get_user_default_acl(), GetNewOidWithIndex(), GETSTRUCT, GUC_ACTION_SAVE, heap_form_tuple(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, i, InvalidOid, InvokeObjectPostCreateHook, j, lfirst, list_length(), list_nth_cell(), lnext(), NameGetDatum(), namestrcpy(), new_object_addresses(), NewGUCNestLevel(), NIL, nodeToString(), OBJECT_FUNCTION, object_ownercheck(), ObjectAddressSet, ObjectIdGetDatum(), OidFunctionCall1, OidIsValid, PGC_S_SESSION, PGC_SUSET, PGC_USERSET, pgstat_create_function(), PointerGetDatum(), PointerIsValid, ProcessGUCArray(), record_object_address_dependencies(), recordDependencyOnCurrentExtension(), recordDependencyOnExpr(), recordDependencyOnNewAcl(), recordDependencyOnOwner(), RelationGetDescr, ReleaseSysCache(), RowExclusiveLock, SearchSysCache3(), stringToNode(), superuser(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), HeapTupleData::t_self, table_close(), table_open(), TextDatumGetCString, UInt16GetDatum(), oidvector::values, and values.
Referenced by AggregateCreate(), CreateFunction(), makeMultirangeConstructors(), and makeRangeConstructors().
|
static |
Definition at line 978 of file pg_proc.c.
References arg, errcontext, function_parse_error_transpose(), parse_error_callback_arg::proname, and parse_error_callback_arg::prosrc.
Referenced by fmgr_sql_validator().