head	1.5;
access;
symbols
	release_4_2:1.5
	aix_ok:1.5
	Version_2_1:1.5
	Version_2:1.2;
locks; strict;
comment	@ * @;


1.5
date	91.01.17.18.57.41;	author sp;	state Exp;
branches;
next	1.4;

1.4
date	90.08.18.00.40.32;	author cimarron;	state Exp;
branches;
next	1.3;

1.3
date	90.08.17.08.52.59;	author cimarron;	state Exp;
branches;
next	1.2;

1.2
date	90.01.04.17.18.23;	author sp;	state Version_2;
branches;
next	1.1;

1.1
date	89.10.13.01.17.25;	author sp;	state Exp;
branches;
next	;


desc
@Header file for parameterized plans stuff. Maybe someday this
should be incorporated to execnodes.h or executor.h
@


1.5
log
@'id' is now AttributeNumber (used to be int32) and a new
attribute 'byval' has been introduced.
@
text
@/*
 * params.h
 * Declarations/definitions of stuff needed to handle parameterized plans.
 *
 * Identification:
 *     $Header: RCS/params.h,v 1.4 90/08/18 00:40:32 cimarron Exp $
 */

#ifndef ParamsIncluded
#define ParamsIncluded	1	/* Include this file only once */

#include "tmp/postgres.h"
#include "access/attnum.h"

/* ----------------------------------------------------------------
 *
 * The following are the possible values for the 'paramkind'
 * field of a Param node.
 *    
 * PARAM_NAMED: The parameter has a name, i.e. something
 *              like `$.salary' or `$.foobar'.
 *              In this case field `paramname' must be a valid Name.
 *              and field `paramid' must be == 0.
 *
 * PARAM_NUM:   The parameter has only a numeric identifier,
 *              i.e. something like `$1', `$2' etc.
 *              The number is contained in the `parmid' field.
 *
 * PARAM_NEW:   Used in PRS2 rule, similar to PARAM_NAMED.
 *              The `paramname' & `paramid' refer to the "NEW" tuple
 *		`paramname' is the attribute name and `paramid' its
 *		attribute number.
 *              
 * PARAM_OLD:   Same as PARAM_NEW, but in this case we refer to
 *		the "OLD" tuple.
 */

#define PARAM_NAMED	11
#define PARAM_NUM	12
#define PARAM_NEW	13
#define PARAM_OLD	14
#define PARAM_INVALID   100


/* ----------------------------------------------------------------
 *    ParamListInfo
 *
 *    Information needed in order for the executor to handle
 *    parameterized plans (you know,  $.salary, $.name etc. stuff...).
 *
 *    ParamListInfoData contains information needed when substituting a
 *    Param node with a Const node.
 *
 *	kind   : the kind of parameter.
 *      name   : the parameter name (valid if kind == PARAM_NAMED,
 *               PARAM_NEW or PARAM_OLD)
 *      id     : the parameter id (valid if kind == PARAM_NUM)
 *		 or the attrno (if kind == PARAM_NEW or PARAM_OLD)
 *      type   : PG_TYPE OID of the value
 *      length : length in bytes of the value
 *      isnull : true if & only if the value is null (if true then
 *               the fields 'length' and 'value' are undefined).
 *      value  : the value that has to be substituted in the place
 *               of the parameter.
 *
 *   ParamListInfo is to be used as an array of ParamListInfoData
 *   records. An 'InvalidName' in the name field of such a record
 *   indicates that this is the last record in the array.
 *
 * ----------------------------------------------------------------
 */

typedef struct ParamListInfoData {
    int			kind;
    Name		name;
    AttributeNumber	id;
    ObjectId		type;
    Size		length;
    bool		isnull;
    bool		byval;
    Datum		value;
} ParamListInfoData;

typedef ParamListInfoData *ParamListInfo;

#endif
@


1.4
log
@eliminated less significant .h files
@
text
@d6 1
a6 1
 *     $Header: RCS/params.h,v 1.3 90/08/17 08:52:59 cimarron Exp Locker: cimarron $
d13 1
d30 3
a32 1
 *              The `paramname' refers to the "NEW" tuple
d58 1
d74 8
a81 7
    int		kind;
    Name	name;
    int32	id;
    ObjectId	type;
    Size	length;
    bool	isnull;
    Datum	value;
@


1.3
log
@added pathnames to #include statements
@
text
@d6 1
a6 1
 *     $Header: RCS/params.h,v 1.2 90/01/04 17:18:23 sp Version_2 Locker: cimarron $
a12 2
#include "tmp/name.h"
#include "tmp/datum.h"
@


1.2
log
@Param nodes have now a new field, called 'paramkind'
(see comments in lib/H/primnodes.h)
@
text
@d6 1
a6 1
 *     $Header: RCS/params.h,v 1.1 89/10/13 01:17:25 sp Exp Locker: sp $
d12 3
a14 4
#include "c.h"
#include "name.h"
#include "oid.h"
#include "datum.h"
@


1.1
log
@Initial revision
@
text
@d6 1
a6 1
 *     $Header: $
d18 28
d54 4
a57 1
 *      name   : the parameter name
d73 1
d75 1
@
