prestogres 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ 2014-03-05 version 0.4.1:
3
+
4
+ * Send queries to Presto if they include Presto's SQL syntax extension
5
+ * Fixed build scripts
6
+
7
+
2
8
  2014-03-05 version 0.4.0:
3
9
 
4
10
  * Preserve OID of tables when clients SELECT from system catalogs
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
- * [Mac OS X](#mac-os-x)
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.0
1
+ 0.4.1
@@ -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(:SIGQUIT, pid)
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 */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prestogres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: