prestogres 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +6 -0
- data/README.md +3 -1
- data/VERSION +1 -1
- data/bin/prestogres +5 -2
- data/pgpool2/pool_query_context.c +13 -11
- metadata +1 -1
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -19,8 +19,10 @@ Prestogres also offers password-based authentication and SSL.
|
|
19
19
|
* [How it works?](#how-it-works)
|
20
20
|
* [Limitation](#limitation)
|
21
21
|
* [Installation](#installation)
|
22
|
+
* [1. Install PostgreSQL >= 9.3](#1-install-postgresql--93)
|
23
|
+
* [2. Install Prestogres](#2-install-prestogres)
|
22
24
|
* [Running servers](#running-servers)
|
23
|
-
* [
|
25
|
+
* [Setting shmem max parameter](#setting-shmem-max-parameter)
|
24
26
|
* [Configuration](#configuration)
|
25
27
|
* [pgpool.conf file](#pgpoolconf-file)
|
26
28
|
* [pool_hba.conf file](#pool_hbaconf-file)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/bin/prestogres
CHANGED
@@ -174,6 +174,9 @@ when :setup
|
|
174
174
|
|
175
175
|
# 2. postgres -D postgres_dir -c listen_addresses=
|
176
176
|
# start postgres without listening on TCP
|
177
|
+
pgsql_dir = File.expand_path File.join(File.dirname(__FILE__), "..", "pgsql")
|
178
|
+
ENV['PYTHONPATH'] = [pgsql_dir, ENV['PYTHONPATH']].compact.join(':')
|
179
|
+
|
177
180
|
postgres_cmd = "postgres -D #{se(postgres_dir)} -c listen_addresses="
|
178
181
|
puts "setup> #{postgres_cmd}"
|
179
182
|
pid = spawn postgres_cmd
|
@@ -185,11 +188,11 @@ when :setup
|
|
185
188
|
puts "initializing database..."
|
186
189
|
sleep 8
|
187
190
|
|
188
|
-
psql_cmd = "psql -h #{se(@config[:unix_socket_directory])} -p #{@config[:backend_port]} -U pg postgres"
|
191
|
+
psql_cmd = "psql -h #{se(@config[:unix_socket_directory])} -p #{@config[:backend_port]} -U pg postgres --set ON_ERROR_STOP=1"
|
189
192
|
setup_cmd "#{psql_cmd} < #{se(setup_sql_path)}"
|
190
193
|
ensure
|
191
194
|
# 4. shutdown postgres
|
192
|
-
Process.kill(:
|
195
|
+
Process.kill(:SIGTERM, pid)
|
193
196
|
end
|
194
197
|
Process.waitpid(pid)
|
195
198
|
|
@@ -717,6 +717,19 @@ void pool_where_to_send(POOL_QUERY_CONTEXT *query_context, char *query, Node *no
|
|
717
717
|
|
718
718
|
pool_debug("send_to_where: %d query: %s", dest, query);
|
719
719
|
|
720
|
+
/*
|
721
|
+
* If failed to parse the query, run it on Presto because
|
722
|
+
* it may include Presto's SQL syntax extensions.
|
723
|
+
*/
|
724
|
+
if (query_context->is_parse_error)
|
725
|
+
{
|
726
|
+
pool_debug("prestogres: send_to_where: parse-error");
|
727
|
+
pool_set_node_to_be_sent(query_context,
|
728
|
+
session_context->load_balance_node_id);
|
729
|
+
rewrite_mode = REWRITE_PRESTO;
|
730
|
+
}
|
731
|
+
else
|
732
|
+
|
720
733
|
/* Should be sent to primary only? */
|
721
734
|
if (dest == POOL_PRIMARY)
|
722
735
|
{
|
@@ -850,17 +863,6 @@ void pool_where_to_send(POOL_QUERY_CONTEXT *query_context, char *query, Node *no
|
|
850
863
|
static_error_message = "invalid session state";
|
851
864
|
}
|
852
865
|
}
|
853
|
-
else if (query_context->is_parse_error)
|
854
|
-
{
|
855
|
-
/*
|
856
|
-
* If failed to parse the query, run it on Presto because
|
857
|
-
* it may include Presto's SQL syntax extensions.
|
858
|
-
*/
|
859
|
-
pool_debug("prestogres: send_to_where: parse-error");
|
860
|
-
pool_set_node_to_be_sent(query_context,
|
861
|
-
session_context->load_balance_node_id);
|
862
|
-
rewrite_mode = REWRITE_PRESTO;
|
863
|
-
}
|
864
866
|
else
|
865
867
|
{
|
866
868
|
/* Send to the primary only */
|