Definition at line 104 of file crosstabview.c.
105{
106 bool retval = false;
118
121
123 {
124 pg_log_error(
"\\crosstabview: statement did not return a result set");
126 }
127
129 {
130 pg_log_error(
"\\crosstabview: query must return at least three columns");
132 }
133
134
137 else
138 {
142 }
143
144
147 else
148 {
152 }
153
154
156 {
157 pg_log_error(
"\\crosstabview: vertical and horizontal headers must be different columns");
159 }
160
161
163 {
165
166
167
168
169
170
172 {
173 pg_log_error(
"\\crosstabview: data column must be specified when query returns more than three columns");
175 }
176
179 {
181 {
183 break;
184 }
185 }
187 }
188 else
189 {
193 }
194
195
198 else
199 {
203 }
204
205
206
207
208
209
210
212 {
215
216
220
224
226
228 {
229 pg_log_error(
"\\crosstabview: maximum number of columns (%d) exceeded",
232 }
233
234
237
239 }
240
241
242
243
244
247
250
253
256
257
258
259
260
263
264
265
266
271
277
278 return retval;
279}
#define Assert(condition)
static int avlCollectFields(avl_tree *tree, avl_node *node, pivot_field *fields, int idx)
static void avlFree(avl_tree *tree, avl_node *node)
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 rankSort(int num_columns, pivot_field *piv_columns)
static int indexOfColumn(char *arg, const PGresult *res)
static void avlInit(avl_tree *tree)
static void avlMergeValue(avl_tree *tree, char *name, char *sort_value)
#define CROSSTABVIEW_MAX_COLUMNS
void * pg_malloc(size_t size)
#define pg_log_error(...)
References Assert, avlCollectFields(), avlFree(), avlInit(), avlMergeValue(), CROSSTABVIEW_MAX_COLUMNS, _psqlSettings::ctv_args, fb(), i, indexOfColumn(), pg_free(), pg_log_error, pg_malloc(), PGRES_TUPLES_OK, PQgetisnull, PQgetvalue, PQnfields, PQntuples, PQresultStatus, printCrosstab(), pset, rankSort(), and val.
Referenced by PrintQueryResult().