diff options
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r-- | src/include/nodes/parsenodes.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 053f1b01213..6723f46f3f1 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -336,6 +336,26 @@ typedef struct FuncCall } FuncCall; /* + * TableSampleClause - a sampling method information + */ +typedef struct TableSampleClause +{ + NodeTag type; + Oid tsmid; + bool tsmseqscan; + bool tsmpagemode; + Oid tsminit; + Oid tsmnextblock; + Oid tsmnexttuple; + Oid tsmexaminetuple; + Oid tsmend; + Oid tsmreset; + Oid tsmcost; + Node *repeatable; + List *args; +} TableSampleClause; + +/* * A_Star - '*' representing all columns of a table or compound field * * This can appear within ColumnRef.fields, A_Indirection.indirection, and @@ -536,6 +556,22 @@ typedef struct RangeFunction } RangeFunction; /* + * RangeTableSample - represents <table> TABLESAMPLE <method> (<params>) REPEATABLE (<num>) + * + * SQL Standard specifies only one parameter which is percentage. But we allow + * custom tablesample methods which may need different input arguments so we + * accept list of arguments. + */ +typedef struct RangeTableSample +{ + NodeTag type; + RangeVar *relation; + char *method; /* sampling method */ + Node *repeatable; + List *args; /* arguments for sampling method */ +} RangeTableSample; + +/* * ColumnDef - column definition (used in various creates) * * If the column has a default value, we may have the value expression @@ -772,6 +808,7 @@ typedef struct RangeTblEntry */ Oid relid; /* OID of the relation */ char relkind; /* relation kind (see pg_class.relkind) */ + TableSampleClause *tablesample; /* sampling method and parameters */ /* * Fields valid for a subquery RTE (else NULL): |