PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plpgsql.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * plpgsql.h - Definitions for the PL/pgSQL
4  * procedural language
5  *
6  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  *
10  * IDENTIFICATION
11  * src/pl/plpgsql/src/plpgsql.h
12  *
13  *-------------------------------------------------------------------------
14  */
15 
16 #ifndef PLPGSQL_H
17 #define PLPGSQL_H
18 
19 #include "access/xact.h"
20 #include "commands/event_trigger.h"
21 #include "commands/trigger.h"
22 #include "executor/spi.h"
23 
24 /**********************************************************************
25  * Definitions
26  **********************************************************************/
27 
28 /* define our text domain for translations */
29 #undef TEXTDOMAIN
30 #define TEXTDOMAIN PG_TEXTDOMAIN("plpgsql")
31 
32 #undef _
33 #define _(x) dgettext(TEXTDOMAIN, x)
34 
35 /*
36  * Compiler's namespace item types
37  */
38 typedef enum PLpgSQL_nsitem_type
39 {
45 
46 /*
47  * A PLPGSQL_NSTYPE_LABEL stack entry must be one of these types
48  */
49 typedef enum PLpgSQL_label_type
50 {
51  PLPGSQL_LABEL_BLOCK, /* DECLARE/BEGIN block */
52  PLPGSQL_LABEL_LOOP, /* looping construct */
53  PLPGSQL_LABEL_OTHER /* anything else */
55 
56 /*
57  * Datum array node types
58  */
59 typedef enum PLpgSQL_datum_type
60 {
68 
69 /*
70  * Variants distinguished in PLpgSQL_type structs
71  */
72 typedef enum PLpgSQL_type_type
73 {
74  PLPGSQL_TTYPE_SCALAR, /* scalar types and domains */
75  PLPGSQL_TTYPE_ROW, /* composite types */
76  PLPGSQL_TTYPE_REC, /* RECORD pseudotype */
77  PLPGSQL_TTYPE_PSEUDO /* other pseudotypes */
79 
80 /*
81  * Execution tree node types
82  */
83 typedef enum PLpgSQL_stmt_type
84 {
110 
111 /*
112  * Execution node return codes
113  */
114 enum
115 {
120 };
121 
122 /*
123  * GET DIAGNOSTICS information items
124  */
126 {
141 
142 /*
143  * RAISE statement options
144  */
146 {
157 
158 /*
159  * Behavioral modes for plpgsql variable resolution
160  */
162 {
163  PLPGSQL_RESOLVE_ERROR, /* throw error if ambiguous */
164  PLPGSQL_RESOLVE_VARIABLE, /* prefer plpgsql var to table column */
165  PLPGSQL_RESOLVE_COLUMN /* prefer table column to plpgsql var */
167 
168 
169 /**********************************************************************
170  * Node and structure definitions
171  **********************************************************************/
172 
173 /*
174  * Postgres data type
175  */
176 typedef struct PLpgSQL_type
177 {
178  char *typname; /* (simple) name of the type */
179  Oid typoid; /* OID of the data type */
180  PLpgSQL_type_type ttype; /* PLPGSQL_TTYPE_ code */
181  int16 typlen; /* stuff copied from its pg_type entry */
182  bool typbyval;
183  char typtype;
185  Oid collation; /* from pg_type, but can be overridden */
186  bool typisarray; /* is "true" array, or domain over one */
187  int32 atttypmod; /* typmod (taken from someplace else) */
188 } PLpgSQL_type;
189 
190 /*
191  * Generic datum array item
192  *
193  * PLpgSQL_datum is the common supertype for PLpgSQL_expr, PLpgSQL_var,
194  * PLpgSQL_row, PLpgSQL_rec, PLpgSQL_recfield, and PLpgSQL_arrayelem
195  */
196 typedef struct PLpgSQL_datum
197 {
199  int dno;
200 } PLpgSQL_datum;
201 
202 /*
203  * Scalar or composite variable
204  *
205  * The variants PLpgSQL_var, PLpgSQL_row, and PLpgSQL_rec share these
206  * fields
207  */
208 typedef struct PLpgSQL_variable
209 {
211  int dno;
212  char *refname;
213  int lineno;
215 
216 /*
217  * SQL Query to plan and execute
218  */
219 typedef struct PLpgSQL_expr
220 {
222  int dno;
223  char *query;
225  Bitmapset *paramnos; /* all dnos referenced by this query */
226  int rwparam; /* dno of read/write param, or -1 if none */
227 
228  /* function containing this expr (not set until we first parse query) */
230 
231  /* namespace chain visible to this expr */
233 
234  /* fields for "simple expression" fast-path execution: */
235  Expr *expr_simple_expr; /* NULL means not a simple expr */
236  int expr_simple_generation; /* plancache generation we checked */
237  Oid expr_simple_type; /* result type Oid, if simple */
238  int32 expr_simple_typmod; /* result typmod, if simple */
239 
240  /*
241  * if expr is simple AND prepared in current transaction,
242  * expr_simple_state and expr_simple_in_use are valid. Test validity by
243  * seeing if expr_simple_lxid matches current LXID. (If not,
244  * expr_simple_state probably points at garbage!)
245  */
246  ExprState *expr_simple_state; /* eval tree for expr_simple_expr */
247  bool expr_simple_in_use; /* true if eval tree is active */
249 } PLpgSQL_expr;
250 
251 /*
252  * Scalar variable
253  */
254 typedef struct PLpgSQL_var
255 {
257  int dno;
258  char *refname;
259  int lineno;
260 
262  int isconst;
263  int notnull;
268 
270  bool isnull;
271  bool freeval;
272 } PLpgSQL_var;
273 
274 /*
275  * Row variable
276  */
277 typedef struct PLpgSQL_row
278 {
280  int dno;
281  char *refname;
282  int lineno;
283 
284  /* Note: TupleDesc is only set up for named rowtypes, else it is NULL. */
286 
287  /*
288  * Note: if the underlying rowtype contains a dropped column, the
289  * corresponding fieldnames[] entry will be NULL, and there is no
290  * corresponding var (varnos[] will be -1).
291  */
292  int nfields;
293  char **fieldnames;
294  int *varnos;
295 } PLpgSQL_row;
296 
297 /*
298  * Record variable (non-fixed structure)
299  */
300 typedef struct PLpgSQL_rec
301 {
303  int dno;
304  char *refname;
305  int lineno;
306 
309  bool freetup;
311 } PLpgSQL_rec;
312 
313 /*
314  * Field in record
315  */
316 typedef struct PLpgSQL_recfield
317 {
319  int dno;
320  char *fieldname;
321  int recparentno; /* dno of parent record */
323 
324 /*
325  * Element of array variable
326  */
327 typedef struct PLpgSQL_arrayelem
328 {
330  int dno;
332  int arrayparentno; /* dno of parent array variable */
333 
334  /* Remaining fields are cached info about the array variable's type */
335  Oid parenttypoid; /* type of array variable; 0 if not yet set */
336  int32 parenttypmod; /* typmod of array variable */
337  Oid arraytypoid; /* OID of actual array type */
338  int32 arraytypmod; /* typmod of array (and its elements too) */
339  int16 arraytyplen; /* typlen of array type */
340  Oid elemtypoid; /* OID of array element type */
341  int16 elemtyplen; /* typlen of element type */
342  bool elemtypbyval; /* element type is pass-by-value? */
343  char elemtypalign; /* typalign of element type */
345 
346 /*
347  * Item in the compilers namespace tree
348  */
349 typedef struct PLpgSQL_nsitem
350 {
352  /*
353  * For labels, itemno is a value of enum PLpgSQL_label_type. For other
354  * itemtypes, itemno is the associated PLpgSQL_datum's dno.
355  */
356  int itemno;
358  char name[FLEXIBLE_ARRAY_MEMBER]; /* nul-terminated string */
360 
361 /*
362  * Generic execution node
363  */
364 typedef struct PLpgSQL_stmt
365 {
367  int lineno;
368 } PLpgSQL_stmt;
369 
370 /*
371  * One EXCEPTION condition name
372  */
373 typedef struct PLpgSQL_condition
374 {
375  int sqlerrstate; /* SQLSTATE code */
376  char *condname; /* condition name (for debugging) */
379 
380 /*
381  * EXCEPTION block
382  */
384 {
387  List *exc_list; /* List of WHEN clauses */
389 
390 /*
391  * One EXCEPTION ... WHEN clause
392  */
393 typedef struct PLpgSQL_exception
394 {
395  int lineno;
397  List *action; /* List of statements */
399 
400 /*
401  * Block of statements
402  */
403 typedef struct PLpgSQL_stmt_block
404 {
406  int lineno;
407  char *label;
408  List *body; /* List of statements */
413 
414 /*
415  * Assign statement
416  */
417 typedef struct PLpgSQL_stmt_assign
418 {
420  int lineno;
421  int varno;
424 
425 /*
426  * PERFORM statement
427  */
428 typedef struct PLpgSQL_stmt_perform
429 {
431  int lineno;
434 
435 /*
436  * GET DIAGNOSTICS item
437  */
438 typedef struct PLpgSQL_diag_item
439 {
440  PLpgSQL_getdiag_kind kind; /* id for diagnostic value desired */
441  int target; /* where to assign it */
443 
444 /*
445  * GET DIAGNOSTICS statement
446  */
447 typedef struct PLpgSQL_stmt_getdiag
448 {
450  int lineno;
451  bool is_stacked; /* STACKED or CURRENT diagnostics area? */
452  List *diag_items; /* List of PLpgSQL_diag_item */
454 
455 /*
456  * IF statement
457  */
458 typedef struct PLpgSQL_stmt_if
459 {
461  int lineno;
462  PLpgSQL_expr *cond; /* boolean expression for THEN */
463  List *then_body; /* List of statements */
464  List *elsif_list; /* List of PLpgSQL_if_elsif structs */
465  List *else_body; /* List of statements */
467 
468 /*
469  * one ELSIF arm of IF statement
470  */
471 typedef struct PLpgSQL_if_elsif
472 {
473  int lineno;
474  PLpgSQL_expr *cond; /* boolean expression for this case */
475  List *stmts; /* List of statements */
477 
478 /*
479  * CASE statement
480  */
481 typedef struct PLpgSQL_stmt_case
482 {
484  int lineno;
485  PLpgSQL_expr *t_expr; /* test expression, or NULL if none */
486  int t_varno; /* var to store test expression value into */
487  List *case_when_list; /* List of PLpgSQL_case_when structs */
488  bool have_else; /* flag needed because list could be empty */
489  List *else_stmts; /* List of statements */
491 
492 /*
493  * one arm of CASE statement
494  */
495 typedef struct PLpgSQL_case_when
496 {
497  int lineno;
498  PLpgSQL_expr *expr; /* boolean expression for this case */
499  List *stmts; /* List of statements */
501 
502 /*
503  * Unconditional LOOP statement
504  */
505 typedef struct PLpgSQL_stmt_loop
506 {
508  int lineno;
509  char *label;
510  List *body; /* List of statements */
512 
513 /*
514  * WHILE cond LOOP statement
515  */
516 typedef struct PLpgSQL_stmt_while
517 {
519  int lineno;
520  char *label;
522  List *body; /* List of statements */
524 
525 /*
526  * FOR statement with integer loopvar
527  */
528 typedef struct PLpgSQL_stmt_fori
529 {
531  int lineno;
532  char *label;
536  PLpgSQL_expr *step; /* NULL means default (ie, BY 1) */
537  int reverse;
538  List *body; /* List of statements */
540 
541 /*
542  * PLpgSQL_stmt_forq represents a FOR statement running over a SQL query.
543  * It is the common supertype of PLpgSQL_stmt_fors, PLpgSQL_stmt_forc
544  * and PLpgSQL_dynfors.
545  */
546 typedef struct PLpgSQL_stmt_forq
547 {
549  int lineno;
550  char *label;
553  List *body; /* List of statements */
555 
556 /*
557  * FOR statement running over SELECT
558  */
559 typedef struct PLpgSQL_stmt_fors
560 {
562  int lineno;
563  char *label;
566  List *body; /* List of statements */
567  /* end of fields that must match PLpgSQL_stmt_forq */
570 
571 /*
572  * FOR statement running over cursor
573  */
574 typedef struct PLpgSQL_stmt_forc
575 {
577  int lineno;
578  char *label;
581  List *body; /* List of statements */
582  /* end of fields that must match PLpgSQL_stmt_forq */
583  int curvar;
584  PLpgSQL_expr *argquery; /* cursor arguments if any */
586 
587 /*
588  * FOR statement running over EXECUTE
589  */
590 typedef struct PLpgSQL_stmt_dynfors
591 {
593  int lineno;
594  char *label;
597  List *body; /* List of statements */
598  /* end of fields that must match PLpgSQL_stmt_forq */
600  List *params; /* USING expressions */
602 
603 /*
604  * FOREACH item in array loop
605  */
607 {
609  int lineno;
610  char *label;
611  int varno; /* loop target variable */
612  int slice; /* slice dimension, or 0 */
613  PLpgSQL_expr *expr; /* array expression */
614  List *body; /* List of statements */
616 
617 /*
618  * OPEN a curvar
619  */
620 typedef struct PLpgSQL_stmt_open
621 {
623  int lineno;
624  int curvar;
630  List *params; /* USING expressions */
632 
633 /*
634  * FETCH or MOVE statement
635  */
636 typedef struct PLpgSQL_stmt_fetch
637 {
639  int lineno;
640  PLpgSQL_rec *rec; /* target, as record or row */
642  int curvar; /* cursor variable to fetch from */
643  FetchDirection direction; /* fetch direction */
644  long how_many; /* count, if constant (expr is NULL) */
645  PLpgSQL_expr *expr; /* count, if expression */
646  bool is_move; /* is this a fetch or move? */
647  bool returns_multiple_rows; /* can return more than one row? */
649 
650 /*
651  * CLOSE curvar
652  */
653 typedef struct PLpgSQL_stmt_close
654 {
656  int lineno;
657  int curvar;
659 
660 /*
661  * EXIT or CONTINUE statement
662  */
663 typedef struct PLpgSQL_stmt_exit
664 {
666  int lineno;
667  bool is_exit; /* Is this an exit or a continue? */
668  char *label; /* NULL if it's an unlabelled EXIT/CONTINUE */
671 
672 /*
673  * RETURN statement
674  */
675 typedef struct PLpgSQL_stmt_return
676 {
678  int lineno;
680  int retvarno;
682 
683 /*
684  * RETURN NEXT statement
685  */
687 {
689  int lineno;
691  int retvarno;
693 
694 /*
695  * RETURN QUERY statement
696  */
698 {
700  int lineno;
701  PLpgSQL_expr *query; /* if static query */
702  PLpgSQL_expr *dynquery; /* if dynamic query (RETURN QUERY EXECUTE) */
703  List *params; /* USING arguments for dynamic query */
705 
706 /*
707  * RAISE statement
708  */
709 typedef struct PLpgSQL_stmt_raise
710 {
712  int lineno;
714  char *condname; /* condition name, SQLSTATE, or NULL */
715  char *message; /* old-style message format literal, or NULL */
716  List *params; /* list of expressions for old-style message */
717  List *options; /* list of PLpgSQL_raise_option */
719 
720 /*
721  * RAISE statement option
722  */
723 typedef struct PLpgSQL_raise_option
724 {
728 
729 /*
730  * ASSERT statement
731  */
732 typedef struct PLpgSQL_stmt_assert
733 {
735  int lineno;
739 
740 /*
741  * Generic SQL statement to execute
742  */
743 typedef struct PLpgSQL_stmt_execsql
744 {
746  int lineno;
748  bool mod_stmt; /* is the stmt INSERT/UPDATE/DELETE? Note:
749  mod_stmt is set when we plan the query */
750  bool into; /* INTO supplied? */
751  bool strict; /* INTO STRICT flag */
752  PLpgSQL_rec *rec; /* INTO target, if record */
753  PLpgSQL_row *row; /* INTO target, if row */
755 
756 /*
757  * Dynamic SQL string to execute
758  */
760 {
762  int lineno;
763  PLpgSQL_expr *query; /* string expression */
764  bool into; /* INTO supplied? */
765  bool strict; /* INTO STRICT flag */
766  PLpgSQL_rec *rec; /* INTO target, if record */
767  PLpgSQL_row *row; /* INTO target, if row */
768  List *params; /* USING expressions */
770 
771 /*
772  * Hash lookup key for functions
773  */
774 typedef struct PLpgSQL_func_hashkey
775 {
777 
778  bool isTrigger; /* true if called as a trigger */
779 
780  /* be careful that pad bytes in this struct get zeroed! */
781 
782  /*
783  * For a trigger function, the OID of the trigger is part of the hash key
784  * --- we want to compile the trigger function separately for each trigger
785  * it is used with, in case the rowtype or transition table names are
786  * different. Zero if not called as a trigger.
787  */
789 
790  /*
791  * We must include the input collation as part of the hash key too,
792  * because we have to generate different plans (with different Param
793  * collations) for different collation settings.
794  */
796 
797  /*
798  * We include actual argument types in the hash key to support polymorphic
799  * PLpgSQL functions. Be careful that extra positions are zeroed!
800  */
803 
804 /*
805  * Trigger type
806  */
807 typedef enum PLpgSQL_trigtype
808 {
813 
814 /*
815  * Complete compiled function
816  */
817 typedef struct PLpgSQL_function
818 {
825  PLpgSQL_func_hashkey *fn_hashkey; /* back-link to hashtable key */
827 
832  bool fn_retset;
834 
835  int fn_nargs;
851 
852  /* for event triggers */
855 
857 
859 
860  /* extra checks */
863 
864  /* the datums representing the function's local variables */
865  int ndatums;
867  Bitmapset *resettable_datums; /* dnos of non-simple vars */
868 
869  /* function body parsetree */
871 
872  /* these fields change when the function is used */
874  unsigned long use_count;
876 
877 /*
878  * Runtime execution data
879  */
880 typedef struct PLpgSQL_execstate
881 {
882  PLpgSQL_function *func; /* function being executed */
883 
885  bool retisnull;
886  Oid rettype; /* type of current retval */
887 
888  Oid fn_rettype; /* info about declared function rettype */
890  bool retisset;
891 
893 
895  char *exitlabel; /* the "target" label of the current EXIT or
896  * CONTINUE stmt, if any */
897  ErrorData *cur_error; /* current exception handler's error */
898 
899  Tuplestorestate *tuple_store; /* SRFs accumulate results here */
903 
904  /* the datums representing the function's local variables */
906  int ndatums;
908 
909  /* we pass datums[i] to the executor, when needed, in paramLI->params[i] */
911  bool params_dirty; /* T if any resettable datum has been passed */
912 
913  /* EState to use for "simple" expression evaluation */
915 
916  /* lookup table to use for executing type casts */
919 
920  /* memory context for statement-lifespan temporary values */
921  MemoryContext stmt_mcontext; /* current stmt context, or NULL if none */
922  MemoryContext stmt_mcontext_parent; /* parent of current context */
923 
924  /* temporary state for results from evaluation of query or expr */
928  ExprContext *eval_econtext; /* for executing simple expressions */
929 
930  /* status information for error context reporting */
931  PLpgSQL_stmt *err_stmt; /* current stmt */
932  const char *err_text; /* additional state info */
933 
934  void *plugin_info; /* reserved for use by optional plugin */
936 
937 /*
938  * A PLpgSQL_plugin structure represents an instrumentation plugin.
939  * To instrument PL/pgSQL, a plugin library must access the rendezvous
940  * variable "PLpgSQL_plugin" and set it to point to a PLpgSQL_plugin struct.
941  * Typically the struct could just be static data in the plugin library.
942  * We expect that a plugin would do this at library load time (_PG_init()).
943  * It must also be careful to set the rendezvous variable back to NULL
944  * if it is unloaded (_PG_fini()).
945  *
946  * This structure is basically a collection of function pointers --- at
947  * various interesting points in pl_exec.c, we call these functions
948  * (if the pointers are non-NULL) to give the plugin a chance to watch
949  * what we are doing.
950  *
951  * func_setup is called when we start a function, before we've initialized
952  * the local variables defined by the function.
953  *
954  * func_beg is called when we start a function, after we've initialized
955  * the local variables.
956  *
957  * func_end is called at the end of a function.
958  *
959  * stmt_beg and stmt_end are called before and after (respectively) each
960  * statement.
961  *
962  * Also, immediately before any call to func_setup, PL/pgSQL fills in the
963  * error_callback and assign_expr fields with pointers to its own
964  * plpgsql_exec_error_callback and exec_assign_expr functions. This is
965  * a somewhat ad-hoc expedient to simplify life for debugger plugins.
966  */
967 typedef struct PLpgSQL_plugin
968 {
969  /* Function pointers set up by the plugin */
971  void (*func_beg) (PLpgSQL_execstate *estate, PLpgSQL_function *func);
972  void (*func_end) (PLpgSQL_execstate *estate, PLpgSQL_function *func);
973  void (*stmt_beg) (PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt);
974  void (*stmt_end) (PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt);
975 
976  /* Function pointers set by PL/pgSQL itself */
977  void (*error_callback) (void *arg);
978  void (*assign_expr) (PLpgSQL_execstate *estate, PLpgSQL_datum *target,
979  PLpgSQL_expr *expr);
981 
982 /*
983  * Struct types used during parsing
984  */
985 
986 typedef struct PLword
987 {
988  char *ident; /* palloc'd converted identifier */
989  bool quoted; /* Was it double-quoted? */
990 } PLword;
991 
992 typedef struct PLcword
993 {
994  List *idents; /* composite identifiers (list of String) */
995 } PLcword;
996 
997 typedef struct PLwdatum
998 {
999  PLpgSQL_datum *datum; /* referenced variable */
1000  char *ident; /* valid if simple name */
1001  bool quoted;
1002  List *idents; /* valid if composite name */
1003 } PLwdatum;
1004 
1005 /**********************************************************************
1006  * Global variable declarations
1007  **********************************************************************/
1008 
1009 typedef enum
1010 {
1011  IDENTIFIER_LOOKUP_NORMAL, /* normal processing of var names */
1012  IDENTIFIER_LOOKUP_DECLARE, /* In DECLARE --- don't look up names */
1013  IDENTIFIER_LOOKUP_EXPR /* In SQL expression --- special case */
1015 
1017 
1018 extern int plpgsql_variable_conflict;
1019 
1020 extern bool plpgsql_print_strict_params;
1021 
1022 extern bool plpgsql_check_asserts;
1023 
1024 /* extra compile-time checks */
1025 #define PLPGSQL_XCHECK_NONE 0
1026 #define PLPGSQL_XCHECK_SHADOWVAR 1
1027 #define PLPGSQL_XCHECK_ALL ((int) ~0)
1028 
1029 extern int plpgsql_extra_warnings;
1030 extern int plpgsql_extra_errors;
1031 
1032 extern bool plpgsql_check_syntax;
1033 extern bool plpgsql_DumpExecTree;
1034 
1036 
1037 extern int plpgsql_nDatums;
1038 extern PLpgSQL_datum **plpgsql_Datums;
1039 
1040 extern char *plpgsql_error_funcname;
1041 
1044 
1046 
1047 /**********************************************************************
1048  * Function declarations
1049  **********************************************************************/
1050 
1051 /*
1052  * Functions in pl_comp.c
1053  */
1055  bool forValidator);
1056 extern PLpgSQL_function *plpgsql_compile_inline(char *proc_source);
1057 extern void plpgsql_parser_setup(struct ParseState *pstate,
1058  PLpgSQL_expr *expr);
1059 extern bool plpgsql_parse_word(char *word1, const char *yytxt,
1060  PLwdatum *wdatum, PLword *word);
1061 extern bool plpgsql_parse_dblword(char *word1, char *word2,
1062  PLwdatum *wdatum, PLcword *cword);
1063 extern bool plpgsql_parse_tripword(char *word1, char *word2, char *word3,
1064  PLwdatum *wdatum, PLcword *cword);
1065 extern PLpgSQL_type *plpgsql_parse_wordtype(char *ident);
1066 extern PLpgSQL_type *plpgsql_parse_cwordtype(List *idents);
1067 extern PLpgSQL_type *plpgsql_parse_wordrowtype(char *ident);
1069 extern PLpgSQL_type *plpgsql_build_datatype(Oid typeOid, int32 typmod,
1070  Oid collation);
1071 extern PLpgSQL_variable *plpgsql_build_variable(const char *refname, int lineno,
1072  PLpgSQL_type *dtype,
1073  bool add2namespace);
1074 extern PLpgSQL_rec *plpgsql_build_record(const char *refname, int lineno,
1075  bool add2namespace);
1076 extern int plpgsql_recognize_err_condition(const char *condname,
1077  bool allow_sqlstate);
1078 extern PLpgSQL_condition *plpgsql_parse_err_condition(char *condname);
1079 extern void plpgsql_adddatum(PLpgSQL_datum *new);
1080 extern int plpgsql_add_initdatums(int **varnos);
1081 extern void plpgsql_HashTableInit(void);
1082 
1083 /*
1084  * Functions in pl_handler.c
1085  */
1086 extern void _PG_init(void);
1087 
1088 /*
1089  * Functions in pl_exec.c
1090  */
1092  FunctionCallInfo fcinfo,
1093  EState *simple_eval_estate);
1095  TriggerData *trigdata);
1097  EventTriggerData *trigdata);
1098 extern void plpgsql_xact_cb(XactEvent event, void *arg);
1099 extern void plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid,
1100  SubTransactionId parentSubid, void *arg);
1102  PLpgSQL_datum *datum);
1104  PLpgSQL_datum *datum,
1105  Oid *typeid, int32 *typmod, Oid *collation);
1106 
1107 /*
1108  * Functions for namespace handling in pl_funcs.c
1109  */
1110 extern void plpgsql_ns_init(void);
1111 extern void plpgsql_ns_push(const char *label,
1112  PLpgSQL_label_type label_type);
1113 extern void plpgsql_ns_pop(void);
1114 extern PLpgSQL_nsitem *plpgsql_ns_top(void);
1115 extern void plpgsql_ns_additem(PLpgSQL_nsitem_type itemtype, int itemno, const char *name);
1116 extern PLpgSQL_nsitem *plpgsql_ns_lookup(PLpgSQL_nsitem *ns_cur, bool localmode,
1117  const char *name1, const char *name2,
1118  const char *name3, int *names_used);
1120  const char *name);
1122 
1123 /*
1124  * Other functions in pl_funcs.c
1125  */
1126 extern const char *plpgsql_stmt_typename(PLpgSQL_stmt *stmt);
1127 extern const char *plpgsql_getdiag_kindname(PLpgSQL_getdiag_kind kind);
1129 extern void plpgsql_dumptree(PLpgSQL_function *func);
1130 
1131 /*
1132  * Scanner functions in pl_scanner.c
1133  */
1134 extern int plpgsql_base_yylex(void);
1135 extern int plpgsql_yylex(void);
1136 extern void plpgsql_push_back_token(int token);
1137 extern bool plpgsql_token_is_unreserved_keyword(int token);
1139  int startlocation, int endlocation);
1140 extern int plpgsql_peek(void);
1141 extern void plpgsql_peek2(int *tok1_p, int *tok2_p, int *tok1_loc,
1142  int *tok2_loc);
1143 extern int plpgsql_scanner_errposition(int location);
1144 extern void plpgsql_yyerror(const char *message) pg_attribute_noreturn();
1145 extern int plpgsql_location_to_lineno(int location);
1146 extern int plpgsql_latest_lineno(void);
1147 extern void plpgsql_scanner_init(const char *str);
1148 extern void plpgsql_scanner_finish(void);
1149 
1150 /*
1151  * Externs in gram.y
1152  */
1153 extern int plpgsql_yyparse(void);
1154 
1155 #endif /* PLPGSQL_H */
int plpgsql_nDatums
Definition: pl_comp.c:46
int expr_simple_generation
Definition: plpgsql.h:236
PLpgSQL_nsitem * plpgsql_ns_top(void)
Definition: pl_funcs.c:83
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:622
signed short int16
Definition: c.h:255
bool fn_retbyval
Definition: plpgsql.h:830
int plpgsql_yyparse(void)
PLpgSQL_datum_type dtype
Definition: plpgsql.h:302
PLpgSQL_raise_option_type
Definition: plpgsql.h:145
int16 elemtyplen
Definition: plpgsql.h:341
int plpgsql_extra_warnings
Definition: pl_handler.c:54
HTAB * cast_hash
Definition: plpgsql.h:917
TupleDesc tupdesc
Definition: plpgsql.h:308
int tg_event_varno
Definition: plpgsql.h:853
XactEvent
Definition: xact.h:99
struct PLpgSQL_stmt_dynexecute PLpgSQL_stmt_dynexecute
PLpgSQL_expr * query
Definition: plpgsql.h:763
struct PLpgSQL_stmt_forq PLpgSQL_stmt_forq
bool print_strict_params
Definition: plpgsql.h:858
PLpgSQL_datum ** datums
Definition: plpgsql.h:866
struct PLpgSQL_stmt_block PLpgSQL_stmt_block
int fn_argvarnos[FUNC_MAX_ARGS]
Definition: plpgsql.h:836
Oid argtypes[FUNC_MAX_ARGS]
Definition: plpgsql.h:801
PLpgSQL_expr * cond
Definition: plpgsql.h:462
PLpgSQL_expr * cond
Definition: plpgsql.h:521
PLpgSQL_nsitem * plpgsql_ns_find_nearest_loop(PLpgSQL_nsitem *ns_cur)
Definition: pl_funcs.c:216
struct PLpgSQL_stmt_return_query PLpgSQL_stmt_return_query
List * then_body
Definition: plpgsql.h:463
PLpgSQL_expr * expr
Definition: plpgsql.h:613
PLpgSQL_func_hashkey * fn_hashkey
Definition: plpgsql.h:825
char * refname
Definition: plpgsql.h:281
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:530
ItemPointerData fn_tid
Definition: plpgsql.h:822
struct PLpgSQL_stmt_raise PLpgSQL_stmt_raise
char * query
Definition: plpgsql.h:223
struct PLpgSQL_stmt_fori PLpgSQL_stmt_fori
int notnull
Definition: plpgsql.h:263
SPITupleTable * eval_tuptable
Definition: plpgsql.h:925
FetchDirection direction
Definition: plpgsql.h:643
int isconst
Definition: plpgsql.h:262
struct PLpgSQL_stmt_getdiag PLpgSQL_stmt_getdiag
FetchDirection
Definition: parsenodes.h:2628
int lineno
Definition: plpgsql.h:367
PLpgSQL_function * plpgsql_compile_inline(char *proc_source)
Definition: pl_comp.c:794
int tg_table_name_varno
Definition: plpgsql.h:847
PLpgSQL_plugin ** plpgsql_plugin_ptr
Definition: pl_handler.c:58
PLpgSQL_row * row
Definition: plpgsql.h:596
char * refname
Definition: plpgsql.h:258
int tg_relid_varno
Definition: plpgsql.h:845
struct PLpgSQL_execstate PLpgSQL_execstate
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:576
PLpgSQL_type * plpgsql_build_datatype(Oid typeOid, int32 typmod, Oid collation)
Definition: pl_comp.c:2125
uint64 eval_processed
Definition: plpgsql.h:926
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:460
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:419
uint32 TransactionId
Definition: c.h:397
PLpgSQL_expr * expr
Definition: plpgsql.h:679
List * elsif_list
Definition: plpgsql.h:464
int extra_warnings
Definition: plpgsql.h:861
PLpgSQL_stmt * err_stmt
Definition: plpgsql.h:931
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:548
PLpgSQL_datum_type dtype
Definition: plpgsql.h:256
int plpgsql_recognize_err_condition(const char *condname, bool allow_sqlstate)
Definition: pl_comp.c:2224
PLpgSQL_rec * rec
Definition: plpgsql.h:551
PLpgSQL_rec * rec
Definition: plpgsql.h:595
PLpgSQL_row * returntype
Definition: plpgsql.h:626
PLpgSQL_stmt_block * action
Definition: plpgsql.h:870
PLpgSQL_type * plpgsql_parse_cwordtype(List *idents)
Definition: pl_comp.c:1691
void plpgsql_peek2(int *tok1_p, int *tok2_p, int *tok1_loc, int *tok2_loc)
Definition: pl_scanner.c:555
void plpgsql_append_source_text(StringInfo buf, int startlocation, int endlocation)
Definition: pl_scanner.c:520
PLpgSQL_expr * cursor_explicit_expr
Definition: plpgsql.h:265
List * stmts
Definition: plpgsql.h:475
ResourceOwner tuple_store_owner
Definition: plpgsql.h:901
IdentifierLookup
Definition: plpgsql.h:1009
struct PLpgSQL_plugin PLpgSQL_plugin
struct PLpgSQL_stmt PLpgSQL_stmt
int plpgsql_base_yylex(void)
PLpgSQL_datum ** plpgsql_Datums
Definition: pl_comp.c:47
char * condname
Definition: plpgsql.h:376
PLpgSQL_type * datatype
Definition: plpgsql.h:261
PLpgSQL_datum_type
Definition: plpgsql.h:59
bool freetup
Definition: plpgsql.h:309
PLpgSQL_type * plpgsql_parse_wordtype(char *ident)
Definition: pl_comp.c:1628
struct PLpgSQL_stmt_exit PLpgSQL_stmt_exit
void plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid, SubTransactionId parentSubid, void *arg)
Definition: pl_exec.c:7118
PLpgSQL_row * row
Definition: plpgsql.h:565
int tg_table_schema_varno
Definition: plpgsql.h:848
PLpgSQL_datum_type dtype
Definition: plpgsql.h:329
PLpgSQL_row * row
Definition: plpgsql.h:767
PLpgSQL_type_type ttype
Definition: plpgsql.h:180
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:745
struct PLpgSQL_variable PLpgSQL_variable
PLpgSQL_row * row
Definition: plpgsql.h:580
TransactionId fn_xmin
Definition: plpgsql.h:821
MemoryContext cast_hash_context
Definition: plpgsql.h:918
PLpgSQL_expr * sqlstmt
Definition: plpgsql.h:747
struct PLpgSQL_condition * next
Definition: plpgsql.h:377
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:449
bool plpgsql_check_asserts
Definition: pl_handler.c:50
PLpgSQL_type * plpgsql_parse_wordrowtype(char *ident)
Definition: pl_comp.c:1808
struct PLpgSQL_stmt_dynfors PLpgSQL_stmt_dynfors
PLpgSQL_expr * dynquery
Definition: plpgsql.h:629
uint32 SubTransactionId
Definition: c.h:401
PLpgSQL_rec * rec
Definition: plpgsql.h:640
struct PLpgSQL_exception PLpgSQL_exception
void * plugin_info
Definition: plpgsql.h:934
PLpgSQL_function * func
Definition: plpgsql.h:882
PLpgSQL_expr * expr
Definition: plpgsql.h:432
PLpgSQL_expr * cond
Definition: plpgsql.h:474
char * ident
Definition: plpgsql.h:988
unsigned int Oid
Definition: postgres_ext.h:31
void plpgsql_ns_additem(PLpgSQL_nsitem_type itemtype, int itemno, const char *name)
Definition: pl_funcs.c:94
Datum plpgsql_exec_function(PLpgSQL_function *func, FunctionCallInfo fcinfo, EState *simple_eval_estate)
Definition: pl_exec.c:330
int plpgsql_scanner_errposition(int location)
Definition: pl_scanner.c:588
struct PLpgSQL_type PLpgSQL_type
List * else_stmts
Definition: plpgsql.h:489
Bitmapset * resettable_datums
Definition: plpgsql.h:867
PLpgSQL_datum_type dtype
Definition: plpgsql.h:198
struct PLpgSQL_var PLpgSQL_var
char * refname
Definition: plpgsql.h:304
PLpgSQL_expr * lower
Definition: plpgsql.h:534
IdentifierLookup plpgsql_IdentifierLookup
Definition: pl_scanner.c:29
bool plpgsql_print_strict_params
Definition: pl_handler.c:48
int plpgsql_latest_lineno(void)
Definition: pl_scanner.c:688
PLpgSQL_getdiag_kind kind
Definition: plpgsql.h:440
SPIPlanPtr plan
Definition: plpgsql.h:224
signed int int32
Definition: c.h:256
PLpgSQL_raise_option_type opt_type
Definition: plpgsql.h:725
PLpgSQL_datum ** datums
Definition: plpgsql.h:907
int32 arraytypmod
Definition: plpgsql.h:338
PLpgSQL_resolve_option resolve_option
Definition: plpgsql.h:856
struct PLpgSQL_stmt_close PLpgSQL_stmt_close
PLpgSQL_expr * query
Definition: plpgsql.h:701
#define FUNC_MAX_ARGS
struct PLpgSQL_stmt_fors PLpgSQL_stmt_fors
struct PLpgSQL_stmt_forc PLpgSQL_stmt_forc
void plpgsql_parser_setup(struct ParseState *pstate, PLpgSQL_expr *expr)
Definition: pl_comp.c:1018
void plpgsql_free_function_memory(PLpgSQL_function *func)
Definition: pl_funcs.c:695
int out_param_varno
Definition: plpgsql.h:837
int tg_relname_varno
Definition: plpgsql.h:846
Definition: dynahash.c:193
char * plpgsql_error_funcname
Definition: pl_comp.c:50
int cursor_explicit_argrow
Definition: plpgsql.h:266
Bitmapset * paramnos
Definition: plpgsql.h:225
PLpgSQL_rec * rec
Definition: plpgsql.h:752
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:518
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:761
ParamListInfo paramLI
Definition: plpgsql.h:910
TupleDesc rettupdesc
Definition: plpgsql.h:894
PLpgSQL_expr * expr
Definition: plpgsql.h:690
Oid plpgsql_exec_get_datum_type(PLpgSQL_execstate *estate, PLpgSQL_datum *datum)
Definition: pl_exec.c:4938
void plpgsql_scanner_init(const char *str)
Definition: pl_scanner.c:702
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:711
MemoryContext tuple_store_cxt
Definition: plpgsql.h:900
const char * plpgsql_getdiag_kindname(PLpgSQL_getdiag_kind kind)
Definition: pl_funcs.c:296
PLpgSQL_var * var
Definition: plpgsql.h:533
char ** fieldnames
Definition: plpgsql.h:293
struct PLpgSQL_execstate * cur_estate
Definition: plpgsql.h:873
EState * simple_eval_estate
Definition: plpgsql.h:914
struct PLpgSQL_func_hashkey PLpgSQL_func_hashkey
void _PG_init(void)
Definition: auth_delay.c:56
struct PLpgSQL_stmt_while PLpgSQL_stmt_while
PLpgSQL_expr * message
Definition: plpgsql.h:737
PLpgSQL_label_type
Definition: plpgsql.h:49
PLpgSQL_expr * default_val
Definition: plpgsql.h:264
void plpgsql_adddatum(PLpgSQL_datum *new)
Definition: pl_comp.c:2328
unsigned long use_count
Definition: plpgsql.h:874
int plpgsql_yylex(void)
Definition: pl_scanner.c:250
List * idents
Definition: plpgsql.h:994
struct PLpgSQL_nsitem * ns
Definition: plpgsql.h:232
bool fn_readonly
Definition: plpgsql.h:833
struct PLpgSQL_stmt_foreach_a PLpgSQL_stmt_foreach_a
static char * buf
Definition: pg_test_fsync.c:66
struct PLword PLword
bool plpgsql_parse_word(char *word1, const char *yytxt, PLwdatum *wdatum, PLword *word)
Definition: pl_comp.c:1355
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:734
int cursor_options
Definition: plpgsql.h:267
struct PLpgSQL_stmt_return PLpgSQL_stmt_return
void plpgsql_push_back_token(int token)
Definition: pl_scanner.c:486
struct PLpgSQL_stmt_fetch PLpgSQL_stmt_fetch
ReturnSetInfo * rsi
Definition: plpgsql.h:902
Expr * expr_simple_expr
Definition: plpgsql.h:235
uint32 LocalTransactionId
Definition: c.h:399
MemoryContext fn_cxt
Definition: plpgsql.h:826
void(* stmt_beg)(PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt)
Definition: plpgsql.h:973
struct PLpgSQL_arrayelem PLpgSQL_arrayelem
PLpgSQL_datum_type dtype
Definition: plpgsql.h:221
struct PLpgSQL_case_when PLpgSQL_case_when
List * idents
Definition: plpgsql.h:1002
PLpgSQL_expr * expr
Definition: plpgsql.h:498
List * case_when_list
Definition: plpgsql.h:487
PLpgSQL_function * plpgsql_curr_compile
Definition: pl_comp.c:54
bool freeval
Definition: plpgsql.h:271
Tuplestorestate * tuple_store
Definition: plpgsql.h:899
PLpgSQL_expr * query
Definition: plpgsql.h:599
Oid typrelid
Definition: plpgsql.h:184
void plpgsql_yyerror(const char *message) pg_attribute_noreturn()
Definition: pl_scanner.c:615
int * varnos
Definition: plpgsql.h:294
Oid fn_input_collation
Definition: plpgsql.h:824
const char * plpgsql_stmt_typename(PLpgSQL_stmt *stmt)
Definition: pl_funcs.c:234
bool typbyval
Definition: plpgsql.h:182
int rwparam
Definition: plpgsql.h:226
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:688
struct PLpgSQL_datum PLpgSQL_datum
void(* stmt_end)(PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt)
Definition: plpgsql.h:974
Oid collation
Definition: plpgsql.h:185
void(* assign_expr)(PLpgSQL_execstate *estate, PLpgSQL_datum *target, PLpgSQL_expr *expr)
Definition: plpgsql.h:978
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:665
ErrorData * cur_error
Definition: plpgsql.h:897
SubXactEvent
Definition: xact.h:113
ExprState * expr_simple_state
Definition: plpgsql.h:246
void plpgsql_HashTableInit(void)
Definition: pl_comp.c:2564
MemoryContext stmt_mcontext_parent
Definition: plpgsql.h:922
bool typisarray
Definition: plpgsql.h:186
PLpgSQL_stmt_type
Definition: plpgsql.h:83
struct PLpgSQL_exception_block PLpgSQL_exception_block
struct PLpgSQL_function PLpgSQL_function
uintptr_t Datum
Definition: postgres.h:372
struct PLpgSQL_rec PLpgSQL_rec
int tg_level_varno
Definition: plpgsql.h:843
bool quoted
Definition: plpgsql.h:989
PLpgSQL_getdiag_kind
Definition: plpgsql.h:125
PLpgSQL_rec * rec
Definition: plpgsql.h:564
int32 parenttypmod
Definition: plpgsql.h:336
static char * label
Definition: pg_basebackup.c:81
PLpgSQL_nsitem * plpgsql_ns_lookup(PLpgSQL_nsitem *ns_cur, bool localmode, const char *name1, const char *name2, const char *name3, int *names_used)
Definition: pl_funcs.c:132
PLpgSQL_datum_type dtype
Definition: plpgsql.h:318
PLpgSQL_expr * cond
Definition: plpgsql.h:669
LocalTransactionId expr_simple_lxid
Definition: plpgsql.h:248
const char * err_text
Definition: plpgsql.h:932
struct PLpgSQL_recfield PLpgSQL_recfield
void(* func_setup)(PLpgSQL_execstate *estate, PLpgSQL_function *func)
Definition: plpgsql.h:970
PLpgSQL_expr * query
Definition: plpgsql.h:628
struct PLpgSQL_stmt_if PLpgSQL_stmt_if
Datum value
Definition: plpgsql.h:269
PLpgSQL_row * row
Definition: plpgsql.h:641
struct PLpgSQL_function * func
Definition: plpgsql.h:229
PLpgSQL_condition * conditions
Definition: plpgsql.h:396
PLpgSQL_trigtype fn_is_trigger
Definition: plpgsql.h:823
struct PLpgSQL_nsitem * prev
Definition: plpgsql.h:357
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:430
int tg_nargs_varno
Definition: plpgsql.h:849
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:655
void(* func_beg)(PLpgSQL_execstate *estate, PLpgSQL_function *func)
Definition: plpgsql.h:971
struct PLpgSQL_row PLpgSQL_row
int nfields
Definition: plpgsql.h:292
int lineno
Definition: plpgsql.h:259
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:405
void plpgsql_exec_get_datum_type_info(PLpgSQL_execstate *estate, PLpgSQL_datum *datum, Oid *typeid, int32 *typmod, Oid *collation)
Definition: pl_exec.c:5020
void plpgsql_ns_init(void)
Definition: pl_funcs.c:45
bool plpgsql_parse_dblword(char *word1, char *word2, PLwdatum *wdatum, PLcword *cword)
Definition: pl_comp.c:1411
PLpgSQL_exception_block * exceptions
Definition: plpgsql.h:411
int16 arraytyplen
Definition: plpgsql.h:339
PLpgSQL_rec * rec
Definition: plpgsql.h:579
struct PLpgSQL_stmt_case PLpgSQL_stmt_case
struct PLpgSQL_stmt_perform PLpgSQL_stmt_perform
ExprContext * eval_econtext
Definition: plpgsql.h:928
bool readonly_func
Definition: plpgsql.h:892
char * fn_signature
Definition: plpgsql.h:819
List * else_body
Definition: plpgsql.h:465
PLpgSQL_type_type
Definition: plpgsql.h:72
PLpgSQL_datum * datum
Definition: plpgsql.h:999
char * typname
Definition: plpgsql.h:178
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:592
PLpgSQL_expr * step
Definition: plpgsql.h:536
PLpgSQL_expr * t_expr
Definition: plpgsql.h:485
char * refname
Definition: plpgsql.h:212
PLpgSQL_expr * dynquery
Definition: plpgsql.h:702
bool freetupdesc
Definition: plpgsql.h:310
PLpgSQL_datum_type dtype
Definition: plpgsql.h:210
PLpgSQL_expr * expr
Definition: plpgsql.h:645
bool plpgsql_DumpExecTree
Definition: pl_comp.c:51
const char * name
Definition: encode.c:521
PLpgSQL_expr * expr
Definition: plpgsql.h:422
#define pg_attribute_noreturn()
Definition: c.h:653
static void word(struct vars *, int, struct state *, struct state *)
Definition: regcomp.c:1243
struct PLpgSQL_condition PLpgSQL_condition
PLpgSQL_expr * expr
Definition: plpgsql.h:726
char typtype
Definition: plpgsql.h:183
bool plpgsql_parse_tripword(char *word1, char *word2, char *word3, PLwdatum *wdatum, PLcword *cword)
Definition: pl_comp.c:1531
bool plpgsql_check_syntax
Definition: pl_comp.c:52
struct PLpgSQL_nsitem PLpgSQL_nsitem
void(* error_callback)(void *arg)
Definition: plpgsql.h:977
struct PLpgSQL_raise_option PLpgSQL_raise_option
PLpgSQL_variable * plpgsql_build_variable(const char *refname, int lineno, PLpgSQL_type *dtype, bool add2namespace)
Definition: pl_comp.c:1863
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:507
bool quoted
Definition: plpgsql.h:1001
int32 expr_simple_typmod
Definition: plpgsql.h:238
char * ident
Definition: plpgsql.h:1000
PLpgSQL_nsitem * plpgsql_ns_lookup_label(PLpgSQL_nsitem *ns_cur, const char *name)
Definition: pl_funcs.c:197
PLpgSQL_rec * rec
Definition: plpgsql.h:766
struct PLpgSQL_stmt_assign PLpgSQL_stmt_assign
int32 atttypmod
Definition: plpgsql.h:187
HeapTuple tup
Definition: plpgsql.h:307
PLpgSQL_expr * argquery
Definition: plpgsql.h:627
PLpgSQL_type * plpgsql_parse_cwordrowtype(List *idents)
Definition: pl_comp.c:1829
PLpgSQL_nsitem_type itemtype
Definition: plpgsql.h:351
struct PLpgSQL_stmt_execsql PLpgSQL_stmt_execsql
void(* func_end)(PLpgSQL_execstate *estate, PLpgSQL_function *func)
Definition: plpgsql.h:972
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:561
struct PLpgSQL_diag_item PLpgSQL_diag_item
TupleDesc rowtupdesc
Definition: plpgsql.h:285
PLpgSQL_expr * subscript
Definition: plpgsql.h:331
bool fn_retistuple
Definition: plpgsql.h:831
PLpgSQL_row * row
Definition: plpgsql.h:552
PLpgSQL_expr * argquery
Definition: plpgsql.h:584
void plpgsql_ns_push(const char *label, PLpgSQL_label_type label_type)
Definition: pl_funcs.c:56
void * arg
MemoryContext stmt_mcontext
Definition: plpgsql.h:921
PLpgSQL_trigtype
Definition: plpgsql.h:807
void plpgsql_exec_event_trigger(PLpgSQL_function *func, EventTriggerData *trigdata)
Definition: pl_exec.c:890
PLpgSQL_expr * upper
Definition: plpgsql.h:535
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:366
PLpgSQL_rec * plpgsql_build_record(const char *refname, int lineno, bool add2namespace)
Definition: pl_comp.c:1943
PLpgSQL_resolve_option
Definition: plpgsql.h:161
struct PLwdatum PLwdatum
int plpgsql_location_to_lineno(int location)
Definition: pl_scanner.c:654
struct PLpgSQL_stmt_assert PLpgSQL_stmt_assert
bool expr_simple_in_use
Definition: plpgsql.h:247
struct PLpgSQL_if_elsif PLpgSQL_if_elsif
struct PLpgSQL_stmt_return_next PLpgSQL_stmt_return_next
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:483
PLpgSQL_expr * query
Definition: plpgsql.h:568
int16 typlen
Definition: plpgsql.h:181
void plpgsql_xact_cb(XactEvent event, void *arg)
Definition: pl_exec.c:7086
char * exitlabel
Definition: plpgsql.h:895
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:699
PLpgSQL_expr * cond
Definition: plpgsql.h:736
int plpgsql_peek(void)
Definition: pl_scanner.c:536
struct PLpgSQL_stmt_loop PLpgSQL_stmt_loop
bool plpgsql_token_is_unreserved_keyword(int token)
Definition: pl_scanner.c:503
PLpgSQL_row * row
Definition: plpgsql.h:753
MemoryContext plpgsql_compile_tmp_cxt
Definition: pl_comp.c:57
int plpgsql_add_initdatums(int **varnos)
Definition: pl_comp.c:2389
char name[FLEXIBLE_ARRAY_MEMBER]
Definition: plpgsql.h:358
int plpgsql_extra_errors
Definition: pl_handler.c:55
PLpgSQL_condition * plpgsql_parse_err_condition(char *condname)
Definition: pl_comp.c:2260
Definition: pg_list.h:45
int plpgsql_variable_conflict
Definition: pl_handler.c:46
char * fieldname
Definition: plpgsql.h:320
int lineno
Definition: plpgsql.h:305
PLpgSQL_function * plpgsql_compile(FunctionCallInfo fcinfo, bool forValidator)
Definition: pl_comp.c:137
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:677
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:638
void plpgsql_dumptree(PLpgSQL_function *func)
Definition: pl_funcs.c:1543
void plpgsql_ns_pop(void)
Definition: pl_funcs.c:69
PLpgSQL_datum_type dtype
Definition: plpgsql.h:279
PLpgSQL_stmt_block * plpgsql_parse_result
Definition: pl_comp.c:43
void plpgsql_scanner_finish(void)
Definition: pl_scanner.c:729
struct PLpgSQL_expr PLpgSQL_expr
Oid expr_simple_type
Definition: plpgsql.h:237
HeapTuple plpgsql_exec_trigger(PLpgSQL_function *func, TriggerData *trigdata)
Definition: pl_exec.c:616
PLpgSQL_nsitem_type
Definition: plpgsql.h:38
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:608
int lineno
Definition: plpgsql.h:282
bool isnull
Definition: plpgsql.h:270
struct PLcword PLcword
bool returns_multiple_rows
Definition: plpgsql.h:647
Oid typoid
Definition: plpgsql.h:179
struct PLpgSQL_stmt_open PLpgSQL_stmt_open