|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "common/int.h"#include "common/jsonapi.h"#include "lib/stringinfo.h"#include "mb/pg_wchar.h"#include "nodes/miscnodes.h"#include "statistics/extended_stats_internal.h"#include "statistics/statistics_format.h"#include "utils/builtins.h"#include "utils/fmgrprotos.h"
Go to the source code of this file.
Data Structures | |
| struct | NDistinctParseState |
Enumerations | |
| enum | NDistinctSemanticState { NDIST_EXPECT_START = 0 , NDIST_EXPECT_ITEM , NDIST_EXPECT_KEY , NDIST_EXPECT_ATTNUM_LIST , NDIST_EXPECT_ATTNUM , NDIST_EXPECT_NDISTINCT , NDIST_EXPECT_COMPLETE } |
| Enumerator | |
|---|---|
| NDIST_EXPECT_START | |
| NDIST_EXPECT_ITEM | |
| NDIST_EXPECT_KEY | |
| NDIST_EXPECT_ATTNUM_LIST | |
| NDIST_EXPECT_ATTNUM | |
| NDIST_EXPECT_NDISTINCT | |
| NDIST_EXPECT_COMPLETE | |
Definition at line 28 of file pg_ndistinct.c.
|
static |
Definition at line 595 of file pg_ndistinct.c.
References MVNDistinctItem::attributes, elog, errcode(), errdetail(), errmsg(), ERROR, errsave, i, item_attnum_list(), item_attributes_eq(), item_is_attnum_subset(), MVNDistinct::items, items, j, list_length(), list_nth(), MVNDistinct::magic, MVNDistinctItem::nattributes, NDIST_EXPECT_COMPLETE, NDIST_EXPECT_START, MVNDistinctItem::ndistinct, MVNDistinct::nitems, nitems, palloc(), parse(), pfree(), PG_NDISTINCT_KEY_ATTRIBUTES, statext_ndistinct_serialize(), STATS_NDISTINCT_MAGIC, STATS_NDISTINCT_TYPE_BASIC, str, and MVNDistinct::type.
Referenced by pg_ndistinct_in().
|
static |
Definition at line 573 of file pg_ndistinct.c.
References appendStringInfo(), MVNDistinctItem::attributes, i, initStringInfo(), MVNDistinctItem::nattributes, and str.
Referenced by build_mvndistinct().
|
static |
Definition at line 522 of file pg_ndistinct.c.
Referenced by build_mvndistinct().
|
static |
Definition at line 541 of file pg_ndistinct.c.
References attnum, MVNDistinctItem::attributes, i, and MVNDistinctItem::nattributes.
Referenced by item_is_attnum_subset().
|
static |
Definition at line 556 of file pg_ndistinct.c.
References MVNDistinctItem::attributes, i, item_has_attnum(), and MVNDistinctItem::nattributes.
Referenced by build_mvndistinct().
|
static |
Definition at line 359 of file pg_ndistinct.c.
References errcode(), errdetail(), errmsg(), errsave, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, NDIST_EXPECT_ATTNUM, NDIST_EXPECT_ITEM, and parse().
Referenced by pg_ndistinct_in().
|
static |
Definition at line 245 of file pg_ndistinct.c.
References errcode(), errdetail(), errmsg(), errsave, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, list_length(), NDIST_EXPECT_ATTNUM, NDIST_EXPECT_COMPLETE, NDIST_EXPECT_ITEM, NDIST_EXPECT_KEY, parse(), and PG_NDISTINCT_KEY_ATTRIBUTES.
Referenced by pg_ndistinct_in().
|
static |
Definition at line 213 of file pg_ndistinct.c.
References errcode(), errdetail(), errmsg(), errsave, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, NDIST_EXPECT_ATTNUM, NDIST_EXPECT_ATTNUM_LIST, NDIST_EXPECT_ITEM, NDIST_EXPECT_START, and parse().
Referenced by pg_ndistinct_in().
|
static |
Definition at line 130 of file pg_ndistinct.c.
References MVNDistinctItem::attributes, errcode(), errdetail(), errmsg(), errsave, for(), i, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, lappend(), list_free(), list_length(), list_nth_int(), MVNDistinctItem::nattributes, NDIST_EXPECT_ITEM, NDIST_EXPECT_KEY, MVNDistinctItem::ndistinct, NIL, palloc(), palloc0(), parse(), PG_NDISTINCT_KEY_ATTRIBUTES, PG_NDISTINCT_KEY_NDISTINCT, and STATS_MAX_DIMENSIONS.
Referenced by pg_ndistinct_in().
|
static |
Definition at line 307 of file pg_ndistinct.c.
References errcode(), errdetail(), errmsg(), errsave, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, NDIST_EXPECT_ATTNUM_LIST, NDIST_EXPECT_NDISTINCT, parse(), PG_NDISTINCT_KEY_ATTRIBUTES, and PG_NDISTINCT_KEY_NDISTINCT.
Referenced by pg_ndistinct_in().
|
static |
Definition at line 60 of file pg_ndistinct.c.
References errcode(), errdetail(), errmsg(), errsave, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, NDIST_EXPECT_ATTNUM, NDIST_EXPECT_ATTNUM_LIST, NDIST_EXPECT_ITEM, NDIST_EXPECT_KEY, NDIST_EXPECT_NDISTINCT, NDIST_EXPECT_START, parse(), PG_NDISTINCT_KEY_ATTRIBUTES, and PG_NDISTINCT_KEY_NDISTINCT.
Referenced by pg_ndistinct_in().
|
static |
Definition at line 427 of file pg_ndistinct.c.
References attnum, errcode(), errdetail(), errmsg(), errsave, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, lappend_int(), list_length(), llast_int, NDIST_EXPECT_ATTNUM, NDIST_EXPECT_KEY, NDIST_EXPECT_NDISTINCT, parse(), PG_NDISTINCT_KEY_ATTRIBUTES, PG_NDISTINCT_KEY_NDISTINCT, pg_strtoint16_safe(), pg_strtoint32_safe(), SOFT_ERROR_OCCURRED, STATS_MAX_DIMENSIONS, and valid_subsequent_attnum().
Referenced by pg_ndistinct_in().
| Datum pg_ndistinct_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 734 of file pg_ndistinct.c.
References JsonSemAction::array_element_end, JsonSemAction::array_element_start, JsonSemAction::array_end, JsonSemAction::array_start, NDistinctParseState::attnum_list, build_mvndistinct(), NDistinctParseState::distinct_items, errcode(), errdetail(), errmsg(), errsave, NDistinctParseState::escontext, NDistinctParseState::found_attributes, NDistinctParseState::found_ndistinct, freeJsonLexContext(), JSON_SUCCESS, list_free(), list_free_deep(), makeJsonLexContextCstringLen(), NDIST_EXPECT_START, NDistinctParseState::ndistinct, ndistinct_array_element_start(), ndistinct_array_end(), ndistinct_array_start(), ndistinct_object_end(), ndistinct_object_field_start(), ndistinct_object_start(), ndistinct_scalar(), NIL, JsonSemAction::object_end, JsonSemAction::object_field_end, JsonSemAction::object_field_start, JsonSemAction::object_start, PG_GETARG_CSTRING, pg_parse_json(), PG_RETURN_BYTEA_P, PG_RETURN_NULL, PG_UTF8, JsonSemAction::scalar, JsonSemAction::semstate, SOFT_ERROR_OCCURRED, NDistinctParseState::state, NDistinctParseState::str, and str.
| Datum pg_ndistinct_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 799 of file pg_ndistinct.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), MVNDistinctItem::attributes, data, elog, ERROR, i, initStringInfo(), MVNDistinct::items, j, MVNDistinctItem::nattributes, MVNDistinctItem::ndistinct, MVNDistinct::nitems, PG_GETARG_BYTEA_PP, PG_NDISTINCT_KEY_ATTRIBUTES, PG_NDISTINCT_KEY_NDISTINCT, PG_RETURN_CSTRING, statext_ndistinct_deserialize(), and str.
| Datum pg_ndistinct_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 839 of file pg_ndistinct.c.
References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.
| Datum pg_ndistinct_send | ( | PG_FUNCTION_ARGS | ) |
|
static |
Definition at line 410 of file pg_ndistinct.c.
Referenced by ndistinct_scalar().