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