|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <math.h>#include "access/htup_details.h"#include "catalog/pg_type.h"#include "common/pg_prng.h"#include "executor/spi.h"#include "fmgr.h"#include "funcapi.h"#include "lib/stringinfo.h"#include "miscadmin.h"#include "utils/builtins.h"
Go to the source code of this file.
Data Structures | |
| struct | normal_rand_fctx |
| struct | crosstab_cat_desc |
| struct | crosstab_hashent |
Typedefs | |
| typedef struct crosstab_cat_desc | crosstab_cat_desc |
| typedef struct crosstab_hashent | crosstab_HashEnt |
| #define CONNECTBY_NCOLS 4 |
Definition at line 973 of file tablefunc.c.
| #define CONNECTBY_NCOLS_NOBRANCH 3 |
Definition at line 974 of file tablefunc.c.
Definition at line 145 of file tablefunc.c.
Definition at line 131 of file tablefunc.c.
| #define INIT_CATS 64 |
Definition at line 129 of file tablefunc.c.
| #define INT32_STRLEN 12 |
Definition at line 119 of file tablefunc.c.
| #define MAX_CATNAME_LEN NAMEDATALEN |
Definition at line 128 of file tablefunc.c.
Definition at line 106 of file tablefunc.c.
|
static |
Definition at line 1188 of file tablefunc.c.
References appendStringInfo(), appendStringInfoString(), build_tuplestore_recursively(), BuildTupleFromCStrings(), compatConnectbyTupleDescs(), CONNECTBY_NCOLS, CONNECTBY_NCOLS_NOBRANCH, StringInfoData::data, ereport, errcode(), errmsg(), ERROR, fb(), heap_freetuple(), i, initStringInfo(), INT32_STRLEN, palloc(), quote_literal_cstr(), relname, resetStringInfo(), SPI_execute(), SPI_getvalue(), SPI_OK_SELECT, SPI_processed, SPI_tuptable, sprintf, SPITupleTable::tupdesc, AttInMetadata::tupdesc, tuplestore_puttuple(), SPITupleTable::vals, values, and xpfree.
Referenced by build_tuplestore_recursively(), and connectby().
Definition at line 1467 of file tablefunc.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), format_type_with_typemod(), and TupleDescAttr().
Referenced by build_tuplestore_recursively().
Definition at line 1520 of file tablefunc.c.
References Assert, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), format_type_with_typemod(), i, TupleDescData::natts, and TupleDescAttr().
Referenced by crosstab().
|
static |
Definition at line 1137 of file tablefunc.c.
References build_tuplestore_recursively(), fb(), MemoryContextSwitchTo(), relname, SPI_connect(), SPI_finish(), tuplestore_begin_heap(), and work_mem.
Referenced by connectby_text(), and connectby_text_serial().
| Datum connectby_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 977 of file tablefunc.c.
References connectby(), CreateTupleDescCopy(), ereport, errcode(), errmsg(), ERROR, fb(), IsA, MemoryContextSwitchTo(), PG_GETARG_INT32, PG_GETARG_TEXT_PP, pstrdup(), relname, SFRM_Materialize, SFRM_Materialize_Random, text_to_cstring(), TupleDescGetAttInMetadata(), and validateConnectbyTupleDesc().
| Datum connectby_text_serial | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1055 of file tablefunc.c.
References connectby(), CreateTupleDescCopy(), ereport, errcode(), errmsg(), ERROR, fb(), IsA, MemoryContextSwitchTo(), PG_GETARG_INT32, PG_GETARG_TEXT_PP, pstrdup(), relname, SFRM_Materialize, SFRM_Materialize_Random, text_to_cstring(), TupleDescGetAttInMetadata(), and validateConnectbyTupleDesc().
| Datum crosstab | ( | PG_FUNCTION_ARGS | ) |
Definition at line 358 of file tablefunc.c.
References BuildTupleFromCStrings(), compatCrosstabTupleDescs(), CreateTupleDescCopy(), ereport, errcode(), errdetail(), errmsg(), ERROR, ExprEndResult, fb(), get_call_result_type(), heap_freetuple(), i, IsA, MemoryContextSwitchTo(), TupleDescData::natts, palloc0(), pfree(), PG_GETARG_TEXT_PP, PG_RETURN_NULL, SFRM_Materialize, SFRM_Materialize_Random, SPI_connect(), SPI_execute(), SPI_finish(), SPI_getvalue(), SPI_OK_SELECT, SPI_processed, SPI_tuptable, text_to_cstring(), SPITupleTable::tupdesc, TupleDescGetAttInMetadata(), tuplestore_begin_heap(), tuplestore_puttuple(), TYPEFUNC_COMPOSITE, TYPEFUNC_RECORD, values, work_mem, xpfree, xpstrdup, and xstreq.
| Datum crosstab_hash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 636 of file tablefunc.c.
References CreateTupleDescCopy(), crosstab_hash(), ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), get_crosstab_tuplestore(), IsA, load_categories_hash(), MemoryContextSwitchTo(), TupleDescData::natts, PG_GETARG_TEXT_PP, SFRM_Materialize, SFRM_Materialize_Random, and text_to_cstring().
Referenced by crosstab_hash(), get_crosstab_tuplestore(), and load_categories_hash().
|
static |
Definition at line 791 of file tablefunc.c.
References crosstab_cat_desc::attidx, BuildTupleFromCStrings(), crosstab_hash(), crosstab_HashTableLookup, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), hash_get_num_entries(), i, j, TupleDescData::natts, palloc0(), SPI_connect(), SPI_execute(), SPI_finish(), SPI_getvalue(), SPI_OK_FINISH, SPI_OK_SELECT, SPI_processed, SPI_tuptable, TupleDescGetAttInMetadata(), tuplestore_begin_heap(), tuplestore_puttuple(), values, work_mem, xpfree, xpstrdup, and xstreq.
Referenced by crosstab_hash().
Definition at line 287 of file tablefunc.c.
References fb(), pg_global_prng_state, and pg_prng_double().
Referenced by normal_rand().
|
static |
Definition at line 705 of file tablefunc.c.
References crosstab_cat_desc::attidx, crosstab_cat_desc::catname, crosstab_hash(), crosstab_HashTableInsert, ctl, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_STRINGS, i, INIT_CATS, MAX_CATNAME_LEN, MemoryContextSwitchTo(), palloc_object, SPI_connect(), SPI_execute(), SPI_finish(), SPI_getvalue(), SPI_OK_FINISH, SPI_OK_SELECT, SPI_processed, and SPI_tuptable.
Referenced by crosstab_hash().
| Datum normal_rand | ( | PG_FUNCTION_ARGS | ) |
Definition at line 176 of file tablefunc.c.
References ereport, errcode(), errmsg(), ERROR, fb(), Float8GetDatum(), get_normal_pair(), MemoryContextSwitchTo(), palloc_object, PG_GETARG_FLOAT8, PG_GETARG_INT32, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, and SRF_RETURN_NEXT.
| PG_FUNCTION_INFO_V1 | ( | connectby_text | ) |
| PG_FUNCTION_INFO_V1 | ( | connectby_text_serial | ) |
| PG_FUNCTION_INFO_V1 | ( | crosstab | ) |
| PG_FUNCTION_INFO_V1 | ( | crosstab_hash | ) |
| PG_FUNCTION_INFO_V1 | ( | normal_rand | ) |
| PG_MODULE_MAGIC_EXT | ( | . | name = "tablefunc", |
| . | version = PG_VERSION |
||
| ) |
Definition at line 1407 of file tablefunc.c.
References CONNECTBY_NCOLS, CONNECTBY_NCOLS_NOBRANCH, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), format_type_be(), TupleDescData::natts, and TupleDescAttr().
Referenced by connectby_text(), and connectby_text_serial().