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  /*
354  * For labels, itemno is a value of enum PLpgSQL_label_type. For other
355  * itemtypes, itemno is the associated PLpgSQL_datum's dno.
356  */
357  int itemno;
359  char name[FLEXIBLE_ARRAY_MEMBER]; /* nul-terminated string */
361 
362 /*
363  * Generic execution node
364  */
365 typedef struct PLpgSQL_stmt
366 {
368  int lineno;
369 } PLpgSQL_stmt;
370 
371 /*
372  * One EXCEPTION condition name
373  */
374 typedef struct PLpgSQL_condition
375 {
376  int sqlerrstate; /* SQLSTATE code */
377  char *condname; /* condition name (for debugging) */
380 
381 /*
382  * EXCEPTION block
383  */
385 {
388  List *exc_list; /* List of WHEN clauses */
390 
391 /*
392  * One EXCEPTION ... WHEN clause
393  */
394 typedef struct PLpgSQL_exception
395 {
396  int lineno;
398  List *action; /* List of statements */
400 
401 /*
402  * Block of statements
403  */
404 typedef struct PLpgSQL_stmt_block
405 {
407  int lineno;
408  char *label;
409  List *body; /* List of statements */
414 
415 /*
416  * Assign statement
417  */
418 typedef struct PLpgSQL_stmt_assign
419 {
421  int lineno;
422  int varno;
425 
426 /*
427  * PERFORM statement
428  */
429 typedef struct PLpgSQL_stmt_perform
430 {
432  int lineno;
435 
436 /*
437  * GET DIAGNOSTICS item
438  */
439 typedef struct PLpgSQL_diag_item
440 {
441  PLpgSQL_getdiag_kind kind; /* id for diagnostic value desired */
442  int target; /* where to assign it */
444 
445 /*
446  * GET DIAGNOSTICS statement
447  */
448 typedef struct PLpgSQL_stmt_getdiag
449 {
451  int lineno;
452  bool is_stacked; /* STACKED or CURRENT diagnostics area? */
453  List *diag_items; /* List of PLpgSQL_diag_item */
455 
456 /*
457  * IF statement
458  */
459 typedef struct PLpgSQL_stmt_if
460 {
462  int lineno;
463  PLpgSQL_expr *cond; /* boolean expression for THEN */
464  List *then_body; /* List of statements */
465  List *elsif_list; /* List of PLpgSQL_if_elsif structs */
466  List *else_body; /* List of statements */
468 
469 /*
470  * one ELSIF arm of IF statement
471  */
472 typedef struct PLpgSQL_if_elsif
473 {
474  int lineno;
475  PLpgSQL_expr *cond; /* boolean expression for this case */
476  List *stmts; /* List of statements */
478 
479 /*
480  * CASE statement
481  */
482 typedef struct PLpgSQL_stmt_case
483 {
485  int lineno;
486  PLpgSQL_expr *t_expr; /* test expression, or NULL if none */
487  int t_varno; /* var to store test expression value into */
488  List *case_when_list; /* List of PLpgSQL_case_when structs */
489  bool have_else; /* flag needed because list could be empty */
490  List *else_stmts; /* List of statements */
492 
493 /*
494  * one arm of CASE statement
495  */
496 typedef struct PLpgSQL_case_when
497 {
498  int lineno;
499  PLpgSQL_expr *expr; /* boolean expression for this case */
500  List *stmts; /* List of statements */
502 
503 /*
504  * Unconditional LOOP statement
505  */
506 typedef struct PLpgSQL_stmt_loop
507 {
509  int lineno;
510  char *label;
511  List *body; /* List of statements */
513 
514 /*
515  * WHILE cond LOOP statement
516  */
517 typedef struct PLpgSQL_stmt_while
518 {
520  int lineno;
521  char *label;
523  List *body; /* List of statements */
525 
526 /*
527  * FOR statement with integer loopvar
528  */
529 typedef struct PLpgSQL_stmt_fori
530 {
532  int lineno;
533  char *label;
537  PLpgSQL_expr *step; /* NULL means default (ie, BY 1) */
538  int reverse;
539  List *body; /* List of statements */
541 
542 /*
543  * PLpgSQL_stmt_forq represents a FOR statement running over a SQL query.
544  * It is the common supertype of PLpgSQL_stmt_fors, PLpgSQL_stmt_forc
545  * and PLpgSQL_dynfors.
546  */
547 typedef struct PLpgSQL_stmt_forq
548 {
550  int lineno;
551  char *label;
554  List *body; /* List of statements */
556 
557 /*
558  * FOR statement running over SELECT
559  */
560 typedef struct PLpgSQL_stmt_fors
561 {
563  int lineno;
564  char *label;
567  List *body; /* List of statements */
568  /* end of fields that must match PLpgSQL_stmt_forq */
571 
572 /*
573  * FOR statement running over cursor
574  */
575 typedef struct PLpgSQL_stmt_forc
576 {
578  int lineno;
579  char *label;
582  List *body; /* List of statements */
583  /* end of fields that must match PLpgSQL_stmt_forq */
584  int curvar;
585  PLpgSQL_expr *argquery; /* cursor arguments if any */
587 
588 /*
589  * FOR statement running over EXECUTE
590  */
591 typedef struct PLpgSQL_stmt_dynfors
592 {
594  int lineno;
595  char *label;
598  List *body; /* List of statements */
599  /* end of fields that must match PLpgSQL_stmt_forq */
601  List *params; /* USING expressions */
603 
604 /*
605  * FOREACH item in array loop
606  */
608 {
610  int lineno;
611  char *label;
612  int varno; /* loop target variable */
613  int slice; /* slice dimension, or 0 */
614  PLpgSQL_expr *expr; /* array expression */
615  List *body; /* List of statements */
617 
618 /*
619  * OPEN a curvar
620  */
621 typedef struct PLpgSQL_stmt_open
622 {
624  int lineno;
625  int curvar;
631  List *params; /* USING expressions */
633 
634 /*
635  * FETCH or MOVE statement
636  */
637 typedef struct PLpgSQL_stmt_fetch
638 {
640  int lineno;
641  PLpgSQL_rec *rec; /* target, as record or row */
643  int curvar; /* cursor variable to fetch from */
644  FetchDirection direction; /* fetch direction */
645  long how_many; /* count, if constant (expr is NULL) */
646  PLpgSQL_expr *expr; /* count, if expression */
647  bool is_move; /* is this a fetch or move? */
648  bool returns_multiple_rows; /* can return more than one row? */
650 
651 /*
652  * CLOSE curvar
653  */
654 typedef struct PLpgSQL_stmt_close
655 {
657  int lineno;
658  int curvar;
660 
661 /*
662  * EXIT or CONTINUE statement
663  */
664 typedef struct PLpgSQL_stmt_exit
665 {
667  int lineno;
668  bool is_exit; /* Is this an exit or a continue? */
669  char *label; /* NULL if it's an unlabelled EXIT/CONTINUE */
672 
673 /*
674  * RETURN statement
675  */
676 typedef struct PLpgSQL_stmt_return
677 {
679  int lineno;
681  int retvarno;
683 
684 /*
685  * RETURN NEXT statement
686  */
688 {
690  int lineno;
692  int retvarno;
694 
695 /*
696  * RETURN QUERY statement
697  */
699 {
701  int lineno;
702  PLpgSQL_expr *query; /* if static query */
703  PLpgSQL_expr *dynquery; /* if dynamic query (RETURN QUERY EXECUTE) */
704  List *params; /* USING arguments for dynamic query */
706 
707 /*
708  * RAISE statement
709  */
710 typedef struct PLpgSQL_stmt_raise
711 {
713  int lineno;
715  char *condname; /* condition name, SQLSTATE, or NULL */
716  char *message; /* old-style message format literal, or NULL */
717  List *params; /* list of expressions for old-style message */
718  List *options; /* list of PLpgSQL_raise_option */
720 
721 /*
722  * RAISE statement option
723  */
724 typedef struct PLpgSQL_raise_option
725 {
729 
730 /*
731  * ASSERT statement
732  */
733 typedef struct PLpgSQL_stmt_assert
734 {
736  int lineno;
740 
741 /*
742  * Generic SQL statement to execute
743  */
744 typedef struct PLpgSQL_stmt_execsql
745 {
747  int lineno;
749  bool mod_stmt; /* is the stmt INSERT/UPDATE/DELETE? Note:
750  * mod_stmt is set when we plan the query */
751  bool into; /* INTO supplied? */
752  bool strict; /* INTO STRICT flag */
753  PLpgSQL_rec *rec; /* INTO target, if record */
754  PLpgSQL_row *row; /* INTO target, if row */
756 
757 /*
758  * Dynamic SQL string to execute
759  */
761 {
763  int lineno;
764  PLpgSQL_expr *query; /* string expression */
765  bool into; /* INTO supplied? */
766  bool strict; /* INTO STRICT flag */
767  PLpgSQL_rec *rec; /* INTO target, if record */
768  PLpgSQL_row *row; /* INTO target, if row */
769  List *params; /* USING expressions */
771 
772 /*
773  * Hash lookup key for functions
774  */
775 typedef struct PLpgSQL_func_hashkey
776 {
778 
779  bool isTrigger; /* true if called as a trigger */
780 
781  /* be careful that pad bytes in this struct get zeroed! */
782 
783  /*
784  * For a trigger function, the OID of the trigger is part of the hash key
785  * --- we want to compile the trigger function separately for each trigger
786  * it is used with, in case the rowtype or transition table names are
787  * different. Zero if not called as a trigger.
788  */
790 
791  /*
792  * We must include the input collation as part of the hash key too,
793  * because we have to generate different plans (with different Param
794  * collations) for different collation settings.
795  */
797 
798  /*
799  * We include actual argument types in the hash key to support polymorphic
800  * PLpgSQL functions. Be careful that extra positions are zeroed!
801  */
804 
805 /*
806  * Trigger type
807  */
808 typedef enum PLpgSQL_trigtype
809 {
814 
815 /*
816  * Complete compiled function
817  */
818 typedef struct PLpgSQL_function
819 {
826  PLpgSQL_func_hashkey *fn_hashkey; /* back-link to hashtable key */
828 
833  bool fn_retset;
835 
836  int fn_nargs;
852 
853  /* for event triggers */
856 
858 
860 
861  /* extra checks */
864 
865  /* the datums representing the function's local variables */
866  int ndatums;
868  Bitmapset *resettable_datums; /* dnos of non-simple vars */
869 
870  /* function body parsetree */
872 
873  /* these fields change when the function is used */
875  unsigned long use_count;
877 
878 /*
879  * Runtime execution data
880  */
881 typedef struct PLpgSQL_execstate
882 {
883  PLpgSQL_function *func; /* function being executed */
884 
886  bool retisnull;
887  Oid rettype; /* type of current retval */
888 
889  Oid fn_rettype; /* info about declared function rettype */
891  bool retisset;
892 
894 
896  char *exitlabel; /* the "target" label of the current EXIT or
897  * CONTINUE stmt, if any */
898  ErrorData *cur_error; /* current exception handler's error */
899 
900  Tuplestorestate *tuple_store; /* SRFs accumulate results here */
904 
905  /* the datums representing the function's local variables */
907  int ndatums;
909 
910  /* we pass datums[i] to the executor, when needed, in paramLI->params[i] */
912  bool params_dirty; /* T if any resettable datum has been passed */
913 
914  /* EState to use for "simple" expression evaluation */
916 
917  /* lookup table to use for executing type casts */
920 
921  /* memory context for statement-lifespan temporary values */
922  MemoryContext stmt_mcontext; /* current stmt context, or NULL if none */
923  MemoryContext stmt_mcontext_parent; /* parent of current context */
924 
925  /* temporary state for results from evaluation of query or expr */
929  ExprContext *eval_econtext; /* for executing simple expressions */
930 
931  /* status information for error context reporting */
932  PLpgSQL_stmt *err_stmt; /* current stmt */
933  const char *err_text; /* additional state info */
934 
935  void *plugin_info; /* reserved for use by optional plugin */
937 
938 /*
939  * A PLpgSQL_plugin structure represents an instrumentation plugin.
940  * To instrument PL/pgSQL, a plugin library must access the rendezvous
941  * variable "PLpgSQL_plugin" and set it to point to a PLpgSQL_plugin struct.
942  * Typically the struct could just be static data in the plugin library.
943  * We expect that a plugin would do this at library load time (_PG_init()).
944  * It must also be careful to set the rendezvous variable back to NULL
945  * if it is unloaded (_PG_fini()).
946  *
947  * This structure is basically a collection of function pointers --- at
948  * various interesting points in pl_exec.c, we call these functions
949  * (if the pointers are non-NULL) to give the plugin a chance to watch
950  * what we are doing.
951  *
952  * func_setup is called when we start a function, before we've initialized
953  * the local variables defined by the function.
954  *
955  * func_beg is called when we start a function, after we've initialized
956  * the local variables.
957  *
958  * func_end is called at the end of a function.
959  *
960  * stmt_beg and stmt_end are called before and after (respectively) each
961  * statement.
962  *
963  * Also, immediately before any call to func_setup, PL/pgSQL fills in the
964  * error_callback and assign_expr fields with pointers to its own
965  * plpgsql_exec_error_callback and exec_assign_expr functions. This is
966  * a somewhat ad-hoc expedient to simplify life for debugger plugins.
967  */
968 typedef struct PLpgSQL_plugin
969 {
970  /* Function pointers set up by the plugin */
972  void (*func_beg) (PLpgSQL_execstate *estate, PLpgSQL_function *func);
973  void (*func_end) (PLpgSQL_execstate *estate, PLpgSQL_function *func);
974  void (*stmt_beg) (PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt);
975  void (*stmt_end) (PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt);
976 
977  /* Function pointers set by PL/pgSQL itself */
978  void (*error_callback) (void *arg);
979  void (*assign_expr) (PLpgSQL_execstate *estate, PLpgSQL_datum *target,
980  PLpgSQL_expr *expr);
982 
983 /*
984  * Struct types used during parsing
985  */
986 
987 typedef struct PLword
988 {
989  char *ident; /* palloc'd converted identifier */
990  bool quoted; /* Was it double-quoted? */
991 } PLword;
992 
993 typedef struct PLcword
994 {
995  List *idents; /* composite identifiers (list of String) */
996 } PLcword;
997 
998 typedef struct PLwdatum
999 {
1000  PLpgSQL_datum *datum; /* referenced variable */
1001  char *ident; /* valid if simple name */
1002  bool quoted;
1003  List *idents; /* valid if composite name */
1004 } PLwdatum;
1005 
1006 /**********************************************************************
1007  * Global variable declarations
1008  **********************************************************************/
1009 
1010 typedef enum
1011 {
1012  IDENTIFIER_LOOKUP_NORMAL, /* normal processing of var names */
1013  IDENTIFIER_LOOKUP_DECLARE, /* In DECLARE --- don't look up names */
1014  IDENTIFIER_LOOKUP_EXPR /* In SQL expression --- special case */
1016 
1018 
1019 extern int plpgsql_variable_conflict;
1020 
1021 extern bool plpgsql_print_strict_params;
1022 
1023 extern bool plpgsql_check_asserts;
1024 
1025 /* extra compile-time checks */
1026 #define PLPGSQL_XCHECK_NONE 0
1027 #define PLPGSQL_XCHECK_SHADOWVAR 1
1028 #define PLPGSQL_XCHECK_ALL ((int) ~0)
1029 
1030 extern int plpgsql_extra_warnings;
1031 extern int plpgsql_extra_errors;
1032 
1033 extern bool plpgsql_check_syntax;
1034 extern bool plpgsql_DumpExecTree;
1035 
1037 
1038 extern int plpgsql_nDatums;
1039 extern PLpgSQL_datum **plpgsql_Datums;
1040 
1041 extern char *plpgsql_error_funcname;
1042 
1045 
1047 
1048 /**********************************************************************
1049  * Function declarations
1050  **********************************************************************/
1051 
1052 /*
1053  * Functions in pl_comp.c
1054  */
1056  bool forValidator);
1057 extern PLpgSQL_function *plpgsql_compile_inline(char *proc_source);
1058 extern void plpgsql_parser_setup(struct ParseState *pstate,
1059  PLpgSQL_expr *expr);
1060 extern bool plpgsql_parse_word(char *word1, const char *yytxt,
1061  PLwdatum *wdatum, PLword *word);
1062 extern bool plpgsql_parse_dblword(char *word1, char *word2,
1063  PLwdatum *wdatum, PLcword *cword);
1064 extern bool plpgsql_parse_tripword(char *word1, char *word2, char *word3,
1065  PLwdatum *wdatum, PLcword *cword);
1066 extern PLpgSQL_type *plpgsql_parse_wordtype(char *ident);
1067 extern PLpgSQL_type *plpgsql_parse_cwordtype(List *idents);
1068 extern PLpgSQL_type *plpgsql_parse_wordrowtype(char *ident);
1070 extern PLpgSQL_type *plpgsql_build_datatype(Oid typeOid, int32 typmod,
1071  Oid collation);
1072 extern PLpgSQL_variable *plpgsql_build_variable(const char *refname, int lineno,
1073  PLpgSQL_type *dtype,
1074  bool add2namespace);
1075 extern PLpgSQL_rec *plpgsql_build_record(const char *refname, int lineno,
1076  bool add2namespace);
1077 extern int plpgsql_recognize_err_condition(const char *condname,
1078  bool allow_sqlstate);
1079 extern PLpgSQL_condition *plpgsql_parse_err_condition(char *condname);
1080 extern void plpgsql_adddatum(PLpgSQL_datum *new);
1081 extern int plpgsql_add_initdatums(int **varnos);
1082 extern void plpgsql_HashTableInit(void);
1083 
1084 /*
1085  * Functions in pl_handler.c
1086  */
1087 extern void _PG_init(void);
1088 
1089 /*
1090  * Functions in pl_exec.c
1091  */
1093  FunctionCallInfo fcinfo,
1094  EState *simple_eval_estate);
1096  TriggerData *trigdata);
1098  EventTriggerData *trigdata);
1099 extern void plpgsql_xact_cb(XactEvent event, void *arg);
1100 extern void plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid,
1101  SubTransactionId parentSubid, void *arg);
1103  PLpgSQL_datum *datum);
1105  PLpgSQL_datum *datum,
1106  Oid *typeid, int32 *typmod, Oid *collation);
1107 
1108 /*
1109  * Functions for namespace handling in pl_funcs.c
1110  */
1111 extern void plpgsql_ns_init(void);
1112 extern void plpgsql_ns_push(const char *label,
1113  PLpgSQL_label_type label_type);
1114 extern void plpgsql_ns_pop(void);
1115 extern PLpgSQL_nsitem *plpgsql_ns_top(void);
1116 extern void plpgsql_ns_additem(PLpgSQL_nsitem_type itemtype, int itemno, const char *name);
1117 extern PLpgSQL_nsitem *plpgsql_ns_lookup(PLpgSQL_nsitem *ns_cur, bool localmode,
1118  const char *name1, const char *name2,
1119  const char *name3, int *names_used);
1121  const char *name);
1123 
1124 /*
1125  * Other functions in pl_funcs.c
1126  */
1127 extern const char *plpgsql_stmt_typename(PLpgSQL_stmt *stmt);
1128 extern const char *plpgsql_getdiag_kindname(PLpgSQL_getdiag_kind kind);
1130 extern void plpgsql_dumptree(PLpgSQL_function *func);
1131 
1132 /*
1133  * Scanner functions in pl_scanner.c
1134  */
1135 extern int plpgsql_base_yylex(void);
1136 extern int plpgsql_yylex(void);
1137 extern void plpgsql_push_back_token(int token);
1138 extern bool plpgsql_token_is_unreserved_keyword(int token);
1140  int startlocation, int endlocation);
1141 extern int plpgsql_peek(void);
1142 extern void plpgsql_peek2(int *tok1_p, int *tok2_p, int *tok1_loc,
1143  int *tok2_loc);
1144 extern int plpgsql_scanner_errposition(int location);
1145 extern void plpgsql_yyerror(const char *message) pg_attribute_noreturn();
1146 extern int plpgsql_location_to_lineno(int location);
1147 extern int plpgsql_latest_lineno(void);
1148 extern void plpgsql_scanner_init(const char *str);
1149 extern void plpgsql_scanner_finish(void);
1150 
1151 /*
1152  * Externs in gram.y
1153  */
1154 extern int plpgsql_yyparse(void);
1155 
1156 #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:623
signed short int16
Definition: c.h:255
bool fn_retbyval
Definition: plpgsql.h:831
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:918
TupleDesc tupdesc
Definition: plpgsql.h:308
int tg_event_varno
Definition: plpgsql.h:854
XactEvent
Definition: xact.h:98
struct PLpgSQL_stmt_dynexecute PLpgSQL_stmt_dynexecute
PLpgSQL_expr * query
Definition: plpgsql.h:764
struct PLpgSQL_stmt_forq PLpgSQL_stmt_forq
bool print_strict_params
Definition: plpgsql.h:859
PLpgSQL_datum ** datums
Definition: plpgsql.h:867
struct PLpgSQL_stmt_block PLpgSQL_stmt_block
int fn_argvarnos[FUNC_MAX_ARGS]
Definition: plpgsql.h:837
Oid argtypes[FUNC_MAX_ARGS]
Definition: plpgsql.h:802
PLpgSQL_expr * cond
Definition: plpgsql.h:463
PLpgSQL_expr * cond
Definition: plpgsql.h:522
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:464
PLpgSQL_expr * expr
Definition: plpgsql.h:614
PLpgSQL_func_hashkey * fn_hashkey
Definition: plpgsql.h:826
char * refname
Definition: plpgsql.h:281
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:531
ItemPointerData fn_tid
Definition: plpgsql.h:823
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:926
FetchDirection direction
Definition: plpgsql.h:644
int isconst
Definition: plpgsql.h:262
struct PLpgSQL_stmt_getdiag PLpgSQL_stmt_getdiag
FetchDirection
Definition: parsenodes.h:2648
int lineno
Definition: plpgsql.h:368
PLpgSQL_function * plpgsql_compile_inline(char *proc_source)
Definition: pl_comp.c:794
int tg_table_name_varno
Definition: plpgsql.h:848
PLpgSQL_plugin ** plpgsql_plugin_ptr
Definition: pl_handler.c:58
PLpgSQL_row * row
Definition: plpgsql.h:597
char * refname
Definition: plpgsql.h:258
int tg_relid_varno
Definition: plpgsql.h:846
struct PLpgSQL_execstate PLpgSQL_execstate
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:577
PLpgSQL_type * plpgsql_build_datatype(Oid typeOid, int32 typmod, Oid collation)
Definition: pl_comp.c:2127
uint64 eval_processed
Definition: plpgsql.h:927
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:461
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:420
uint32 TransactionId
Definition: c.h:397
PLpgSQL_expr * expr
Definition: plpgsql.h:680
List * elsif_list
Definition: plpgsql.h:465
int extra_warnings
Definition: plpgsql.h:862
PLpgSQL_stmt * err_stmt
Definition: plpgsql.h:932
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:549
PLpgSQL_datum_type dtype
Definition: plpgsql.h:256
int plpgsql_recognize_err_condition(const char *condname, bool allow_sqlstate)
Definition: pl_comp.c:2226
PLpgSQL_rec * rec
Definition: plpgsql.h:552
PLpgSQL_rec * rec
Definition: plpgsql.h:596
PLpgSQL_row * returntype
Definition: plpgsql.h:627
PLpgSQL_stmt_block * action
Definition: plpgsql.h:871
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:476
ResourceOwner tuple_store_owner
Definition: plpgsql.h:902
IdentifierLookup
Definition: plpgsql.h:1010
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:377
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:566
int tg_table_schema_varno
Definition: plpgsql.h:849
PLpgSQL_datum_type dtype
Definition: plpgsql.h:329
PLpgSQL_row * row
Definition: plpgsql.h:768
PLpgSQL_type_type ttype
Definition: plpgsql.h:180
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:746
struct PLpgSQL_variable PLpgSQL_variable
PLpgSQL_row * row
Definition: plpgsql.h:581
TransactionId fn_xmin
Definition: plpgsql.h:822
MemoryContext cast_hash_context
Definition: plpgsql.h:919
PLpgSQL_expr * sqlstmt
Definition: plpgsql.h:748
struct PLpgSQL_condition * next
Definition: plpgsql.h:378
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:450
bool plpgsql_check_asserts
Definition: pl_handler.c:50
PLpgSQL_type * plpgsql_parse_wordrowtype(char *ident)
Definition: pl_comp.c:1809
struct PLpgSQL_stmt_dynfors PLpgSQL_stmt_dynfors
PLpgSQL_expr * dynquery
Definition: plpgsql.h:630
uint32 SubTransactionId
Definition: c.h:401
PLpgSQL_rec * rec
Definition: plpgsql.h:641
struct PLpgSQL_exception PLpgSQL_exception
void * plugin_info
Definition: plpgsql.h:935
PLpgSQL_function * func
Definition: plpgsql.h:883
PLpgSQL_expr * expr
Definition: plpgsql.h:433
PLpgSQL_expr * cond
Definition: plpgsql.h:475
char * ident
Definition: plpgsql.h:989
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:490
Bitmapset * resettable_datums
Definition: plpgsql.h:868
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:535
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:441
SPIPlanPtr plan
Definition: plpgsql.h:224
signed int int32
Definition: c.h:256
PLpgSQL_raise_option_type opt_type
Definition: plpgsql.h:726
PLpgSQL_datum ** datums
Definition: plpgsql.h:908
int32 arraytypmod
Definition: plpgsql.h:338
PLpgSQL_resolve_option resolve_option
Definition: plpgsql.h:857
struct PLpgSQL_stmt_close PLpgSQL_stmt_close
PLpgSQL_expr * query
Definition: plpgsql.h:702
#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:838
int tg_relname_varno
Definition: plpgsql.h:847
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:753
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:519
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:762
ParamListInfo paramLI
Definition: plpgsql.h:911
TupleDesc rettupdesc
Definition: plpgsql.h:895
PLpgSQL_expr * expr
Definition: plpgsql.h:691
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:712
MemoryContext tuple_store_cxt
Definition: plpgsql.h:901
const char * plpgsql_getdiag_kindname(PLpgSQL_getdiag_kind kind)
Definition: pl_funcs.c:296
PLpgSQL_var * var
Definition: plpgsql.h:534
char ** fieldnames
Definition: plpgsql.h:293
struct PLpgSQL_execstate * cur_estate
Definition: plpgsql.h:874
EState * simple_eval_estate
Definition: plpgsql.h:915
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:738
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:2330
unsigned long use_count
Definition: plpgsql.h:875
int plpgsql_yylex(void)
Definition: pl_scanner.c:250
List * idents
Definition: plpgsql.h:995
struct PLpgSQL_nsitem * ns
Definition: plpgsql.h:232
bool fn_readonly
Definition: plpgsql.h:834
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:735
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:903
Expr * expr_simple_expr
Definition: plpgsql.h:235
uint32 LocalTransactionId
Definition: c.h:399
MemoryContext fn_cxt
Definition: plpgsql.h:827
void(* stmt_beg)(PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt)
Definition: plpgsql.h:974
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:1003
PLpgSQL_expr * expr
Definition: plpgsql.h:499
List * case_when_list
Definition: plpgsql.h:488
PLpgSQL_function * plpgsql_curr_compile
Definition: pl_comp.c:54
bool freeval
Definition: plpgsql.h:271
Tuplestorestate * tuple_store
Definition: plpgsql.h:900
PLpgSQL_expr * query
Definition: plpgsql.h:600
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:825
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:689
struct PLpgSQL_datum PLpgSQL_datum
void(* stmt_end)(PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt)
Definition: plpgsql.h:975
Oid collation
Definition: plpgsql.h:185
void(* assign_expr)(PLpgSQL_execstate *estate, PLpgSQL_datum *target, PLpgSQL_expr *expr)
Definition: plpgsql.h:979
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:666
ErrorData * cur_error
Definition: plpgsql.h:898
SubXactEvent
Definition: xact.h:112
ExprState * expr_simple_state
Definition: plpgsql.h:246
void plpgsql_HashTableInit(void)
Definition: pl_comp.c:2566
MemoryContext stmt_mcontext_parent
Definition: plpgsql.h:923
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:844
bool quoted
Definition: plpgsql.h:990
PLpgSQL_getdiag_kind
Definition: plpgsql.h:125
PLpgSQL_rec * rec
Definition: plpgsql.h:565
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:670
LocalTransactionId expr_simple_lxid
Definition: plpgsql.h:248
const char * err_text
Definition: plpgsql.h:933
struct PLpgSQL_recfield PLpgSQL_recfield
void(* func_setup)(PLpgSQL_execstate *estate, PLpgSQL_function *func)
Definition: plpgsql.h:971
PLpgSQL_expr * query
Definition: plpgsql.h:629
struct PLpgSQL_stmt_if PLpgSQL_stmt_if
Datum value
Definition: plpgsql.h:269
PLpgSQL_row * row
Definition: plpgsql.h:642
struct PLpgSQL_function * func
Definition: plpgsql.h:229
PLpgSQL_condition * conditions
Definition: plpgsql.h:397
PLpgSQL_trigtype fn_is_trigger
Definition: plpgsql.h:824
struct PLpgSQL_nsitem * prev
Definition: plpgsql.h:358
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:431
int tg_nargs_varno
Definition: plpgsql.h:850
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:656
void(* func_beg)(PLpgSQL_execstate *estate, PLpgSQL_function *func)
Definition: plpgsql.h:972
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:406
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:412
int16 arraytyplen
Definition: plpgsql.h:339
PLpgSQL_rec * rec
Definition: plpgsql.h:580
struct PLpgSQL_stmt_case PLpgSQL_stmt_case
struct PLpgSQL_stmt_perform PLpgSQL_stmt_perform
ExprContext * eval_econtext
Definition: plpgsql.h:929
bool readonly_func
Definition: plpgsql.h:893
char * fn_signature
Definition: plpgsql.h:820
List * else_body
Definition: plpgsql.h:466
PLpgSQL_type_type
Definition: plpgsql.h:72
PLpgSQL_datum * datum
Definition: plpgsql.h:1000
char * typname
Definition: plpgsql.h:178
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:593
PLpgSQL_expr * step
Definition: plpgsql.h:537
PLpgSQL_expr * t_expr
Definition: plpgsql.h:486
char * refname
Definition: plpgsql.h:212
PLpgSQL_expr * dynquery
Definition: plpgsql.h:703
bool freetupdesc
Definition: plpgsql.h:310
PLpgSQL_datum_type dtype
Definition: plpgsql.h:210
PLpgSQL_expr * expr
Definition: plpgsql.h:646
bool plpgsql_DumpExecTree
Definition: pl_comp.c:51
const char * name
Definition: encode.c:521
PLpgSQL_expr * expr
Definition: plpgsql.h:423
#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:727
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:978
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:1864
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:508
bool quoted
Definition: plpgsql.h:1002
int32 expr_simple_typmod
Definition: plpgsql.h:238
char * ident
Definition: plpgsql.h:1001
PLpgSQL_nsitem * plpgsql_ns_lookup_label(PLpgSQL_nsitem *ns_cur, const char *name)
Definition: pl_funcs.c:197
PLpgSQL_rec * rec
Definition: plpgsql.h:767
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:628
PLpgSQL_type * plpgsql_parse_cwordrowtype(List *idents)
Definition: pl_comp.c:1830
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:973
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:562
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:832
PLpgSQL_row * row
Definition: plpgsql.h:553
PLpgSQL_expr * argquery
Definition: plpgsql.h:585
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:922
PLpgSQL_trigtype
Definition: plpgsql.h:808
void plpgsql_exec_event_trigger(PLpgSQL_function *func, EventTriggerData *trigdata)
Definition: pl_exec.c:890
PLpgSQL_expr * upper
Definition: plpgsql.h:536
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:367
PLpgSQL_rec * plpgsql_build_record(const char *refname, int lineno, bool add2namespace)
Definition: pl_comp.c:1944
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:484
PLpgSQL_expr * query
Definition: plpgsql.h:569
int16 typlen
Definition: plpgsql.h:181
void plpgsql_xact_cb(XactEvent event, void *arg)
Definition: pl_exec.c:7086
char * exitlabel
Definition: plpgsql.h:896
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:700
PLpgSQL_expr * cond
Definition: plpgsql.h:737
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:754
MemoryContext plpgsql_compile_tmp_cxt
Definition: pl_comp.c:57
int plpgsql_add_initdatums(int **varnos)
Definition: pl_comp.c:2391
char name[FLEXIBLE_ARRAY_MEMBER]
Definition: plpgsql.h:359
int plpgsql_extra_errors
Definition: pl_handler.c:55
PLpgSQL_condition * plpgsql_parse_err_condition(char *condname)
Definition: pl_comp.c:2262
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:678
PLpgSQL_stmt_type cmd_type
Definition: plpgsql.h:639
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:609
int lineno
Definition: plpgsql.h:282
bool isnull
Definition: plpgsql.h:270
struct PLcword PLcword
bool returns_multiple_rows
Definition: plpgsql.h:648
Oid typoid
Definition: plpgsql.h:179
struct PLpgSQL_stmt_open PLpgSQL_stmt_open