pltcl-karl-try3-1-of-3-pgindent.patch

application/octet-stream

Filename: pltcl-karl-try3-1-of-3-pgindent.patch
Type: application/octet-stream
Part: 0
Message: Re: Revised patches to add table function support to PL/Tcl (TODO item)

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/pl/tcl/pltcl.c 0 0
src/tools/pgindent/typedefs.list 0 0
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index 6e8c5c0..7b952b2 100644
*** a/src/pl/tcl/pltcl.c
--- b/src/pl/tcl/pltcl.c
*************** PG_MODULE_MAGIC;
*** 95,103 ****
   **********************************************************************/
  typedef struct pltcl_interp_desc
  {
! 	Oid			user_id;				/* Hash key (must be first!) */
! 	Tcl_Interp *interp;					/* The interpreter */
! 	Tcl_HashTable query_hash;			/* pltcl_query_desc structs */
  } pltcl_interp_desc;
  
  
--- 95,103 ----
   **********************************************************************/
  typedef struct pltcl_interp_desc
  {
! 	Oid			user_id;		/* Hash key (must be first!) */
! 	Tcl_Interp *interp;			/* The interpreter */
! 	Tcl_HashTable query_hash;	/* pltcl_query_desc structs */
  } pltcl_interp_desc;
  
  
*************** typedef struct pltcl_query_desc
*** 148,165 ****
   **********************************************************************/
  typedef struct pltcl_proc_key
  {
! 	Oid			proc_id;				/* Function OID */
  	/*
  	 * is_trigger is really a bool, but declare as Oid to ensure this struct
  	 * contains no padding
  	 */
! 	Oid			is_trigger;				/* is it a trigger function? */
! 	Oid			user_id;				/* User calling the function, or 0 */
  } pltcl_proc_key;
  
  typedef struct pltcl_proc_ptr
  {
! 	pltcl_proc_key proc_key;			/* Hash key (must be first!) */
  	pltcl_proc_desc *proc_ptr;
  } pltcl_proc_ptr;
  
--- 148,166 ----
   **********************************************************************/
  typedef struct pltcl_proc_key
  {
! 	Oid			proc_id;		/* Function OID */
! 
  	/*
  	 * is_trigger is really a bool, but declare as Oid to ensure this struct
  	 * contains no padding
  	 */
! 	Oid			is_trigger;		/* is it a trigger function? */
! 	Oid			user_id;		/* User calling the function, or 0 */
  } pltcl_proc_key;
  
  typedef struct pltcl_proc_ptr
  {
! 	pltcl_proc_key proc_key;	/* Hash key (must be first!) */
  	pltcl_proc_desc *proc_ptr;
  } pltcl_proc_ptr;
  
*************** static HeapTuple pltcl_trigger_handler(P
*** 196,202 ****
  static void throw_tcl_error(Tcl_Interp *interp, const char *proname);
  
  static pltcl_proc_desc *compile_pltcl_function(Oid fn_oid, Oid tgreloid,
! 											   bool pltrusted);
  
  static int pltcl_elog(ClientData cdata, Tcl_Interp *interp,
  		   int argc, CONST84 char *argv[]);
--- 197,203 ----
  static void throw_tcl_error(Tcl_Interp *interp, const char *proname);
  
  static pltcl_proc_desc *compile_pltcl_function(Oid fn_oid, Oid tgreloid,
! 					   bool pltrusted);
  
  static int pltcl_elog(ClientData cdata, Tcl_Interp *interp,
  		   int argc, CONST84 char *argv[]);
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 7b3787a..ec99f8e 100644
*** a/src/tools/pgindent/typedefs.list
--- b/src/tools/pgindent/typedefs.list
*************** plperl_proc_entry
*** 1972,1978 ****
--- 1972,1981 ----
  plperl_query_desc
  plperl_query_entry
  plpgsql_HashEnt
+ pltcl_interp_desc
  pltcl_proc_desc
+ pltcl_proc_key
+ pltcl_proc_ptr
  pltcl_query_desc
  pqbool
  pqsigfunc