File: pool_select_walker.h

package info (click to toggle)
pgpool2 3.3.4-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 9,196 kB
  • sloc: ansic: 59,850; sh: 12,893; yacc: 10,787; lex: 4,637; sql: 743; makefile: 481; java: 469; php: 125; ruby: 98; asm: 5
file content (68 lines) | stat: -rw-r--r-- 2,876 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* -*-pgsql-c-*- */
/*
 *
 * $Header$
 *
 * pgpool: a language independent connection pool server for PostgreSQL 
 * written by Tatsuo Ishii
 *
 * Copyright (c) 2003-2012	PgPool Global Development Group
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation for any purpose and without fee is hereby
 * granted, provided that the above copyright notice appear in all
 * copies and that both that copyright notice and this permission
 * notice appear in supporting documentation, and that the name of the
 * author not be used in advertising or publicity pertaining to
 * distribution of the software without specific, written prior
 * permission. The author makes no representations about the
 * suitability of this software for any purpose.  It is provided "as
 * is" without express or implied warranty.
 *
 * pool_select_walker.h.: Walker functions for SELECT
 *
 */

#ifndef POOL_SELECT_WALKER_H
#define POOL_SELECT_WALKER_H

#include "pool.h"
#include "parser/nodes.h"
#include "parser/primnodes.h"
#include "parser/makefuncs.h"

#define POOL_MAX_SELECT_OIDS 128
#define POOL_NAMEDATALEN 64 /* from NAMEDATALEN of PostgreSQL */

typedef struct {
	bool    has_system_catalog;     /* True if system catalog table is used */
	bool    has_temp_table;     /* True if temporary table is used */
	bool    has_unlogged_table; /* True if unlogged table is used */
	bool    has_view; /* True if view is used */
	bool    has_function_call;  /* True if write function call is used */
	bool    has_non_immutable_function_call;    /* True if non immutable functions are used */
	bool    has_insertinto_or_locking_clause;   /* True if it has SELECT INTO or FOR SHARE/UPDATE */
	int     num_oids;   /* number of oids */
	int     table_oids[POOL_MAX_SELECT_OIDS];   /* table oids */
	char    table_names[POOL_MAX_SELECT_OIDS][POOL_NAMEDATALEN];  /* table names */
} SelectContext;

extern bool pool_has_function_call(Node *node);
extern bool pool_has_non_immutable_function_call(Node *node);
extern bool pool_has_system_catalog(Node *node);
extern bool pool_has_temp_table(Node *node);
extern void discard_temp_table_relcache(void);
extern bool pool_has_unlogged_table(Node *node);
extern bool pool_has_view(Node *node);
extern bool pool_has_insertinto_or_locking_clause(Node *node);
extern bool pool_has_pgpool_regclass(void);
extern bool pool_has_to_regclass(void);
extern bool raw_expression_tree_walker(Node *node, bool (*walker) (), void *context);
extern int pool_table_name_to_oid(char *table_name);
extern int pool_extract_table_oids_from_select_stmt(Node *node, SelectContext *ctx);
extern RangeVar *makeRangeVarFromNameList(List *names);
extern int pattern_compare(char *str, const int type, const char *param_name);
extern bool is_unlogged_table(char *table_name);
extern bool is_view(char *table_name);

#endif /* POOL_SELECT_WALKER_H */