PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include "common.h"
#include "common/int.h"
#include "common/logging.h"
#include "crosstabview.h"
#include "pqexpbuffer.h"
#include "psqlscanslash.h"
#include "settings.h"
Go to the source code of this file.
Data Structures | |
struct | _pivot_field |
struct | _avl_node |
struct | _avl_tree |
Typedefs | |
typedef struct _pivot_field | pivot_field |
typedef struct _avl_node | avl_node |
typedef struct _avl_tree | avl_tree |
Functions | |
static bool | printCrosstab (const PGresult *result, int num_columns, pivot_field *piv_columns, int field_for_columns, int num_rows, pivot_field *piv_rows, int field_for_rows, int field_for_data) |
static void | avlInit (avl_tree *tree) |
static void | avlMergeValue (avl_tree *tree, char *name, char *sort_value) |
static int | avlCollectFields (avl_tree *tree, avl_node *node, pivot_field *fields, int idx) |
static void | avlFree (avl_tree *tree, avl_node *node) |
static void | rankSort (int num_columns, pivot_field *piv_columns) |
static int | indexOfColumn (char *arg, const PGresult *res) |
static int | pivotFieldCompare (const void *a, const void *b) |
static int | rankCompare (const void *a, const void *b) |
bool | PrintResultInCrosstab (const PGresult *res) |
static void | avlUpdateHeight (avl_node *n) |
static avl_node * | avlRotate (avl_node **current, int dir) |
static int | avlBalance (avl_node *n) |
static void | avlAdjustBalance (avl_tree *tree, avl_node **node) |
static void | avlInsertNode (avl_tree *tree, avl_node **node, pivot_field field) |
typedef struct _pivot_field pivot_field |
Definition at line 506 of file crosstabview.c.
References avlBalance(), avlRotate(), avlUpdateHeight(), b, _avl_node::children, and tree.
Referenced by avlInsertNode().
|
static |
Definition at line 495 of file crosstabview.c.
References _avl_node::children, and _avl_node::height.
Referenced by avlAdjustBalance().
|
static |
Definition at line 577 of file crosstabview.c.
References _avl_node::children, _avl_node::field, idx(), and tree.
Referenced by PrintResultInCrosstab().
Definition at line 448 of file crosstabview.c.
References _avl_node::children, pg_free(), and tree.
Referenced by PrintResultInCrosstab().
|
static |
Definition at line 438 of file crosstabview.c.
References pg_malloc0(), and tree.
Referenced by PrintResultInCrosstab().
|
static |
Definition at line 529 of file crosstabview.c.
References avlAdjustBalance(), _avl_node::children, cmp(), _avl_node::field, _avl_node::height, pg_malloc(), pivotFieldCompare(), and tree.
Referenced by avlMergeValue().
|
static |
Definition at line 560 of file crosstabview.c.
References avlInsertNode(), name, _pivot_field::name, _pivot_field::rank, _pivot_field::sort_value, and tree.
Referenced by PrintResultInCrosstab().
Definition at line 481 of file crosstabview.c.
References avlUpdateHeight(), before(), and _avl_node::children.
Referenced by avlAdjustBalance().
|
static |
Definition at line 472 of file crosstabview.c.
References _avl_node::children, and _avl_node::height.
Referenced by avlAdjustBalance(), and avlRotate().
|
static |
Definition at line 636 of file crosstabview.c.
References arg, dequote_downcase_identifier(), _psqlSettings::encoding, i, idx(), pg_log_error, PQfname(), PQnfields(), pset, and res.
Referenced by PrintResultInCrosstab().
|
static |
Definition at line 695 of file crosstabview.c.
References a, b, and _pivot_field::name.
Referenced by avlInsertNode(), and printCrosstab().
|
static |
Definition at line 286 of file crosstabview.c.
References Assert, printTableContent::cells, printTableContent::cellsadded, column_type_alignment(), error(), i, idx(), _psqlSettings::logfile, name, _pivot_field::name, printQueryOpt::nullPrint, pg_free(), pg_log_error, pg_malloc(), pivotFieldCompare(), _psqlSettings::popt, PQfname(), PQftype(), PQgetisnull(), PQgetvalue(), PQntuples(), printTable(), printTableAddHeader(), printTableCleanup(), printTableInit(), pset, _psqlSettings::queryFout, _pivot_field::rank, printQueryOpt::title, and printQueryOpt::topt.
Referenced by PrintResultInCrosstab().
Definition at line 104 of file crosstabview.c.
References Assert, avlCollectFields(), avlFree(), avlInit(), avlMergeValue(), _avl_tree::count, CROSSTABVIEW_MAX_COLUMNS, _psqlSettings::ctv_args, i, indexOfColumn(), pg_free(), pg_log_error, pg_malloc(), PGRES_TUPLES_OK, PQgetisnull(), PQgetvalue(), PQnfields(), PQntuples(), PQresultStatus(), printCrosstab(), pset, rankSort(), res, _avl_tree::root, and val.
Referenced by PrintQueryResult().
|
static |
Definition at line 711 of file crosstabview.c.
References a, b, and pg_cmp_s32().
Referenced by rankSort().
|
static |
Definition at line 588 of file crosstabview.c.
References i, pg_free(), pg_malloc(), qsort, _pivot_field::rank, rankCompare(), _pivot_field::sort_value, and val.
Referenced by PrintResultInCrosstab().