+2006-XX-XX
+ * Version 3.1
+ * Improve documentation. patches contributed by Mark Stosberg
+ * Fix "kind is 0!" error in Execute(). Reads messages until
+ receiving CommandComplete, EmptyQuery, ErrorResponse or
+ PortalSuspend in Execute() (Yoshiyuki)
+ * Add log_statement option. patches contributed by Thomas E
+ Lackey, modifications and documents by Tatsuo
+
2006-05-17 <ishii@sraoss.co.jp>
* Version 3.0.2
* pgpool does not exit even if pgpool.conf contents is wrong(Tatsuo)
balnced. This is usefull for certain APIs such as DBI/DBD which is
know as adding an extra leading white space.
+ log_statement
+
+ If true, print all statements to the log. Like the log_statement option
+ to PostgreSQL, this allows for observing queries without engaging in full
+ debugging.
+
7. Starting pgpool
The simplist way to start pgpool is:
¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤òÄɲ乤ë¤è¤¦¤ÊAPI¤ò»È¤¤¡¢¥í¡¼¥É¥Ð¥é¥ó¥¹¤·¤¿¤¤¤È¤¤Ë
͸ú¤Ç¤¹¡£
+ log_statement
+
+ true¤Ê¤é¤ÐSQLʸ¤ò¥í¥°½ÐÎϤ·¤Þ¤¹¡¥¤³¤ÎÌòÌܤÏPostgreSQL¤Î
+ log_statement¥ª¥×¥·¥ç¥ó¤È»÷¤Æ¤¤¤Æ¡¤¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤¬¤Ê¤¤¤È¤¤Ç¤â
+ Ì䤤¹ç¤ï¤»¤ò¥í¥°½ÐÎϤ·¤ÆÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤¤ë¤Î¤ÇÊØÍø¤Ç¤¹¡¥
+
7. pgpool¤Îµ¯Æ°
pgpool¤òµ¯Æ°¤¹¤ë¤â¤Ã¤È¤â´Êñ¤ÊÊýË¡¤Ï¡¤
# is useful for certain APIs such as DBI/DBD which is known to adding an
# extra leading white space.
ignore_leading_white_space = false
+
+# If true, print all statements to the log. Like the log_statement option
+# to PostgreSQL, this allows for observing queries without engaging in full
+# debugging.
+log_statement = false
int num_reset_queries; /* number of queries in reset_query_list */
int num_servers; /* number of PostgreSQL servers */
int server_status[MAX_CONNECTION_SLOTS]; /* server status 0:unused, 1:up, 2:down */
+ int log_statement; /* 0:false, 1: true - logs all SQL statements */
} POOL_CONFIG;
#define MAX_PASSWORD_SIZE 1024
pool_config.health_check_user = "nobody";
pool_config.insert_lock = 0;
pool_config.num_servers = 0;
+ pool_config.log_statement = 0;
#define PARSE_ERROR() pool_error("pool_config: parse error at line %d '%s'", Lineno, yytext)
/* open config file */
}
pool_config.ignore_leading_white_space = v;
}
+ else if (!strcmp(key, "log_statement"))
+ {
+ int v = eval_logical(yytext);
+
+ if (v < 0)
+ {
+ pool_error("pool_config: invalid value %s for %s", yytext, key);
+ return(-1);
+ }
+ pool_config.log_statement = v;
+ }
}
if (pool_config.backend_port)
pool_config.health_check_user = "nobody";
pool_config.insert_lock = 0;
pool_config.num_servers = 0;
+ pool_config.log_statement = 0;
#define PARSE_ERROR() pool_error("pool_config: parse error at line %d '%s'", Lineno, yytext)
/* open config file */
}
pool_config.ignore_leading_white_space = v;
}
+ else if (!strcmp(key, "log_statement"))
+ {
+ int v = eval_logical(yytext);
+
+ if (v < 0)
+ {
+ pool_error("pool_config: invalid value %s for %s", yytext, key);
+ return(-1);
+ }
+ pool_config.log_statement = v;
+ }
}
if (pool_config.backend_port)
string = query;
}
- pool_debug("Query: %s", string);
+ /* log query to log file if neccessary */
+ if (pool_config.log_statement)
+ {
+ pool_log("statement: %s", string);
+ }
+ else
+ {
+ pool_debug("statement: %s", string);
+ }
/*
* if this is DROP DATABASE command, send HUP signal to parent and