pg 0.21.0 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +5 -5
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/History.rdoc +98 -0
  5. data/Manifest.txt +5 -1
  6. data/README.rdoc +14 -4
  7. data/Rakefile +4 -5
  8. data/Rakefile.cross +17 -21
  9. data/ext/errorcodes.def +12 -0
  10. data/ext/errorcodes.rb +1 -1
  11. data/ext/errorcodes.txt +4 -1
  12. data/ext/extconf.rb +14 -32
  13. data/ext/gvl_wrappers.c +4 -0
  14. data/ext/gvl_wrappers.h +23 -39
  15. data/ext/pg.c +23 -50
  16. data/ext/pg.h +51 -81
  17. data/ext/pg_binary_decoder.c +73 -6
  18. data/ext/pg_coder.c +52 -3
  19. data/ext/pg_connection.c +369 -219
  20. data/ext/pg_copy_coder.c +10 -5
  21. data/ext/pg_result.c +343 -119
  22. data/ext/pg_text_decoder.c +597 -37
  23. data/ext/pg_text_encoder.c +6 -7
  24. data/ext/pg_tuple.c +541 -0
  25. data/ext/util.c +6 -6
  26. data/ext/util.h +2 -2
  27. data/lib/pg.rb +5 -7
  28. data/lib/pg/basic_type_mapping.rb +40 -7
  29. data/lib/pg/binary_decoder.rb +22 -0
  30. data/lib/pg/coder.rb +1 -1
  31. data/lib/pg/connection.rb +27 -3
  32. data/lib/pg/constants.rb +1 -1
  33. data/lib/pg/exceptions.rb +1 -1
  34. data/lib/pg/result.rb +1 -1
  35. data/lib/pg/text_decoder.rb +19 -23
  36. data/lib/pg/text_encoder.rb +35 -1
  37. data/lib/pg/tuple.rb +30 -0
  38. data/lib/pg/type_map_by_column.rb +1 -1
  39. data/spec/helpers.rb +49 -21
  40. data/spec/pg/basic_type_mapping_spec.rb +230 -27
  41. data/spec/pg/connection_spec.rb +473 -277
  42. data/spec/pg/connection_sync_spec.rb +41 -0
  43. data/spec/pg/result_spec.rb +48 -13
  44. data/spec/pg/tuple_spec.rb +280 -0
  45. data/spec/pg/type_map_by_class_spec.rb +1 -1
  46. data/spec/pg/type_map_by_column_spec.rb +1 -1
  47. data/spec/pg/type_map_by_mri_type_spec.rb +1 -1
  48. data/spec/pg/type_map_by_oid_spec.rb +1 -1
  49. data/spec/pg/type_map_in_ruby_spec.rb +1 -1
  50. data/spec/pg/type_map_spec.rb +1 -1
  51. data/spec/pg/type_spec.rb +184 -12
  52. data/spec/pg_spec.rb +2 -2
  53. metadata +37 -33
  54. metadata.gz.sig +0 -0
  55. data/lib/pg/deprecated_constants.rb +0 -21
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ # -*- rspec -*-
2
2
  # encoding: utf-8
3
3
 
4
4
  require_relative '../helpers'
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ # -*- rspec -*-
2
2
  # encoding: utf-8
3
3
 
4
4
  require_relative '../helpers'
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ # -*- rspec -*-
2
2
  # encoding: utf-8
3
3
 
4
4
  require_relative '../helpers'
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ # -*- rspec -*-
2
2
  # encoding: utf-8
3
3
 
4
4
  require_relative '../helpers'
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ # -*- rspec -*-
2
2
  # encoding: utf-8
3
3
 
4
4
  require_relative '../helpers'
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ # -*- rspec -*-
2
2
  # encoding: utf-8
3
3
 
4
4
  require_relative '../helpers'
@@ -1,7 +1,8 @@
1
- #!/usr/bin/env rspec
1
+ # -*- rspec -*-
2
2
  # encoding: utf-8
3
3
 
4
4
  require 'pg'
5
+ require 'time'
5
6
 
6
7
 
7
8
  describe "PG::Type derivations" do
@@ -15,6 +16,9 @@ describe "PG::Type derivations" do
15
16
  let!(:textdec_string) { PG::TextDecoder::String.new }
16
17
  let!(:textenc_timestamp) { PG::TextEncoder::TimestampWithoutTimeZone.new }
17
18
  let!(:textdec_timestamp) { PG::TextDecoder::TimestampWithoutTimeZone.new }
19
+ let!(:textenc_timestamputc) { PG::TextEncoder::TimestampUtc.new }
20
+ let!(:textdec_timestamputc) { PG::TextDecoder::TimestampUtc.new }
21
+ let!(:textdec_timestampul) { PG::TextDecoder::TimestampUtcToLocal.new }
18
22
  let!(:textenc_timestamptz) { PG::TextEncoder::TimestampWithTimeZone.new }
19
23
  let!(:textdec_timestamptz) { PG::TextDecoder::TimestampWithTimeZone.new }
20
24
  let!(:textenc_bytea) { PG::TextEncoder::Bytea.new }
@@ -75,7 +79,7 @@ describe "PG::Type derivations" do
75
79
  expect( intdec_incrementer.decode("3") ).to eq( 4 )
76
80
  end
77
81
 
78
- it "should decode integers of different lengths form text format" do
82
+ it "should decode integers of different lengths from text format" do
79
83
  30.times do |zeros|
80
84
  expect( textdec_int.decode("1" + "0"*zeros) ).to eq( 10 ** zeros )
81
85
  expect( textdec_int.decode(zeros==0 ? "0" : "9"*zeros) ).to eq( 10 ** zeros - 1 )
@@ -96,21 +100,41 @@ describe "PG::Type derivations" do
96
100
  end
97
101
 
98
102
  context 'timestamps' do
99
- it 'decodes timestamps without timezone' do
100
- expect( textdec_timestamp.decode('2016-01-02 23:23:59.123456') ).
101
- to be_within(0.000001).of( Time.new(2016,01,02, 23, 23, 59.123456) )
103
+ it 'decodes timestamps without timezone as local time' do
104
+ expect( textdec_timestamp.decode('2016-01-02 23:23:59.123456').iso8601(5) ).
105
+ to eq( Time.new(2016,1,2, 23,23,59.123456).iso8601(5) )
106
+ expect( textdec_timestamp.decode('2016-08-02 23:23:59.123456').iso8601(5) ).
107
+ to eq( Time.new(2016,8,2, 23,23,59.123456).iso8601(5) )
108
+ end
109
+ it 'decodes timestamps with UTC time and returns UTC timezone' do
110
+ expect( textdec_timestamputc.decode('2016-01-02 23:23:59.123456').iso8601(5) ).
111
+ to eq( Time.utc(2016,1,2, 23,23,59.123456).iso8601(5) )
112
+ expect( textdec_timestamputc.decode('2016-08-02 23:23:59.123456').iso8601(5) ).
113
+ to eq( Time.utc(2016,8,2, 23,23,59.123456).iso8601(5) )
114
+ end
115
+ it 'decodes timestamps with UTC time and returns local timezone' do
116
+ expect( textdec_timestampul.decode('2016-01-02 23:23:59.123456').iso8601(5) ).
117
+ to eq( Time.utc(2016,1,2, 23,23,59.123456).getlocal.iso8601(5) )
118
+ expect( textdec_timestampul.decode('2016-08-02 23:23:59.123456').iso8601(5) ).
119
+ to eq( Time.utc(2016,8,2, 23,23,59.123456).getlocal.iso8601(5) )
102
120
  end
103
121
  it 'decodes timestamps with hour timezone' do
104
- expect( textdec_timestamptz.decode('2015-01-26 17:26:42.691511-04') ).
105
- to be_within(0.000001).of( Time.new(2015,01,26, 17, 26, 42.691511, "-04:00") )
106
- expect( textdec_timestamptz.decode('2015-01-26 17:26:42.691511+10') ).
107
- to be_within(0.000001).of( Time.new(2015,01,26, 17, 26, 42.691511, "+10:00") )
122
+ expect( textdec_timestamptz.decode('2016-01-02 23:23:59.123456-04').iso8601(5) ).
123
+ to eq( Time.new(2016,1,2, 23,23,59.123456, "-04:00").iso8601(5) )
124
+ expect( textdec_timestamptz.decode('2016-08-02 23:23:59.123456+10').iso8601(5) ).
125
+ to eq( Time.new(2016,8,2, 23,23,59.123456, "+10:00").iso8601(5) )
126
+ expect( textdec_timestamptz.decode('1913-12-31 23:58:59.1231-03').iso8601(5) ).
127
+ to eq( Time.new(1913, 12, 31, 23, 58, 59.1231, "-03:00").iso8601(5) )
128
+ expect( textdec_timestamptz.decode('4714-11-24 23:58:59.1231-03 BC').iso8601(5) ).
129
+ to eq( Time.new(-4713, 11, 24, 23, 58, 59.1231, "-03:00").iso8601(5) )
130
+ expect( textdec_timestamptz.decode('294276-12-31 23:58:59.1231+03').iso8601(5) ).
131
+ to eq( Time.new(294276, 12, 31, 23, 58, 59.1231, "+03:00").iso8601(5) )
108
132
  end
109
133
  it 'decodes timestamps with hour:minute timezone' do
110
134
  expect( textdec_timestamptz.decode('2015-01-26 17:26:42.691511-04:15') ).
111
135
  to be_within(0.000001).of( Time.new(2015,01,26, 17, 26, 42.691511, "-04:15") )
112
- expect( textdec_timestamptz.decode('2015-01-26 17:26:42.691511-0430') ).
113
- to be_within(0.000001).of( Time.new(2015,01,26, 17, 26, 42.691511, "-04:30") )
136
+ expect( textdec_timestamptz.decode('2015-07-26 17:26:42.691511-04:30') ).
137
+ to be_within(0.000001).of( Time.new(2015,07,26, 17, 26, 42.691511, "-04:30") )
114
138
  expect( textdec_timestamptz.decode('2015-01-26 17:26:42.691511+10:45') ).
115
139
  to be_within(0.000001).of( Time.new(2015,01,26, 17, 26, 42.691511, "+10:45") )
116
140
  end
@@ -121,6 +145,81 @@ describe "PG::Type derivations" do
121
145
  expect( textdec_timestamptz.decode('1916-01-01 00:00:00-00:25:21') ).
122
146
  to be_within(0.000001).of( Time.new(1916, 1, 1, 0, 0, 0, "-00:25:21") )
123
147
  end
148
+ it 'decodes timestamps with date before 1823' do
149
+ expect( textdec_timestamp.decode('1822-01-02 23:23:59.123456').iso8601(5) ).
150
+ to eq( Time.new(1822,01,02, 23, 23, 59.123456).iso8601(5) )
151
+ expect( textdec_timestamputc.decode('1822-01-02 23:23:59.123456').iso8601(5) ).
152
+ to eq( Time.utc(1822,01,02, 23, 23, 59.123456).iso8601(5) )
153
+ expect( textdec_timestampul.decode('1822-01-02 23:23:59.123456').iso8601(5) ).
154
+ to eq( Time.utc(1822,01,02, 23, 23, 59.123456).getlocal.iso8601(5) )
155
+ expect( textdec_timestamptz.decode('1822-01-02 23:23:59.123456+04').iso8601(5) ).
156
+ to eq( Time.new(1822,01,02, 23, 23, 59.123456, "+04:00").iso8601(5) )
157
+ end
158
+ it 'decodes timestamps with date after 2116' do
159
+ expect( textdec_timestamp.decode('2117-01-02 23:23:59.123456').iso8601(5) ).
160
+ to eq( Time.new(2117,01,02, 23, 23, 59.123456).iso8601(5) )
161
+ expect( textdec_timestamputc.decode('2117-01-02 23:23:59.123456').iso8601(5) ).
162
+ to eq( Time.utc(2117,01,02, 23, 23, 59.123456).iso8601(5) )
163
+ expect( textdec_timestampul.decode('2117-01-02 23:23:59.123456').iso8601(5) ).
164
+ to eq( Time.utc(2117,01,02, 23, 23, 59.123456).getlocal.iso8601(5) )
165
+ expect( textdec_timestamptz.decode('2117-01-02 23:23:59.123456+04').iso8601(5) ).
166
+ to eq( Time.new(2117,01,02, 23, 23, 59.123456, "+04:00").iso8601(5) )
167
+ end
168
+ it 'decodes timestamps with variable number of digits for the useconds part' do
169
+ sec = "59.12345678912345"
170
+ (4..sec.length).each do |i|
171
+ expect( textdec_timestamp.decode("2016-01-02 23:23:#{sec[0,i]}") ).
172
+ to be_within(0.000001).of( Time.new(2016,01,02, 23, 23, sec[0,i].to_f) )
173
+ end
174
+ end
175
+ it 'decodes timestamps with leap-second' do
176
+ expect( textdec_timestamp.decode('1998-12-31 23:59:60.1234') ).
177
+ to be_within(0.000001).of( Time.new(1998,12,31, 23, 59, 60.1234) )
178
+ end
179
+
180
+ def textdec_timestamptz_decode_should_fail(str)
181
+ expect(textdec_timestamptz.decode(str)).to eq(str)
182
+ end
183
+
184
+ it 'fails when the timestamp is an empty string' do
185
+ textdec_timestamptz_decode_should_fail('')
186
+ end
187
+ it 'fails when the timestamp contains values with less digits than expected' do
188
+ textdec_timestamptz_decode_should_fail('2016-0-02 23:23:59.123456+00:25:21')
189
+ textdec_timestamptz_decode_should_fail('2016-01-0 23:23:59.123456+00:25:21')
190
+ textdec_timestamptz_decode_should_fail('2016-01-02 2:23:59.123456+00:25:21')
191
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:2:59.123456+00:25:21')
192
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:5.123456+00:25:21')
193
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.+00:25:21')
194
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+0:25:21')
195
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+00:2:21')
196
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+00:25:2')
197
+ end
198
+ it 'fails when the timestamp contains values with more digits than expected' do
199
+ textdec_timestamptz_decode_should_fail('2016-011-02 23:23:59.123456+00:25:21')
200
+ textdec_timestamptz_decode_should_fail('2016-01-022 23:23:59.123456+00:25:21')
201
+ textdec_timestamptz_decode_should_fail('2016-01-02 233:23:59.123456+00:25:21')
202
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:233:59.123456+00:25:21')
203
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:599.123456+00:25:21')
204
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+000:25:21')
205
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+00:255:21')
206
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456+00:25:211')
207
+ end
208
+ it 'fails when the timestamp contains values with invalid characters' do
209
+ str = '2013-01-02 23:23:59.123456+00:25:21'
210
+ str.length.times do |i|
211
+ textdec_timestamptz_decode_should_fail(str[0,i] + "x" + str[i+1..-1])
212
+ end
213
+ end
214
+ it 'fails when the timestamp contains leading characters' do
215
+ textdec_timestamptz_decode_should_fail(' 2016-01-02 23:23:59.123456')
216
+ end
217
+ it 'fails when the timestamp contains trailing characters' do
218
+ textdec_timestamptz_decode_should_fail('2016-01-02 23:23:59.123456 ')
219
+ end
220
+ it 'fails when the timestamp contains non ASCII character' do
221
+ textdec_timestamptz_decode_should_fail('2016-01ª02 23:23:59.123456')
222
+ end
124
223
  end
125
224
 
126
225
  context 'identifier quotation' do
@@ -215,6 +314,27 @@ describe "PG::Type derivations" do
215
314
  expect( textenc_bytea.encode("\x00\x01\x02\x03\xef".b) ).to eq( "\\x00010203ef" )
216
315
  end
217
316
 
317
+ context 'timestamps' do
318
+ it 'encodes timestamps without timezone' do
319
+ expect( textenc_timestamp.encode(Time.new(2016,1,2, 23, 23, 59.123456, 3*60*60)) ).
320
+ to match( /^2016-01-02 23:23:59.12345\d+$/ )
321
+ expect( textenc_timestamp.encode(Time.new(2016,8,2, 23, 23, 59.123456, 3*60*60)) ).
322
+ to match( /^2016-08-02 23:23:59.12345\d+$/ )
323
+ end
324
+ it 'encodes timestamps with UTC timezone' do
325
+ expect( textenc_timestamputc.encode(Time.new(2016,1,2, 23, 23, 59.123456, 3*60*60)) ).
326
+ to match( /^2016-01-02 20:23:59.12345\d+$/ )
327
+ expect( textenc_timestamputc.encode(Time.new(2016,8,2, 23, 23, 59.123456, 3*60*60)) ).
328
+ to match( /^2016-08-02 20:23:59.12345\d+$/ )
329
+ end
330
+ it 'encodes timestamps with hour timezone' do
331
+ expect( textenc_timestamptz.encode(Time.new(2016,1,02, 23, 23, 59.123456, -4*60*60)) ).
332
+ to match( /^2016-01-02 23:23:59.12345\d+ \-04:00$/ )
333
+ expect( textenc_timestamptz.encode(Time.new(2016,8,02, 23, 23, 59.123456, 10*60*60)) ).
334
+ to match( /^2016-08-02 23:23:59.12345\d+ \+10:00$/ )
335
+ end
336
+ end
337
+
218
338
  context 'identifier quotation' do
219
339
  it 'should quote and escape identifier' do
220
340
  quoted_type = PG::TextEncoder::Identifier.new
@@ -303,6 +423,7 @@ describe "PG::Type derivations" do
303
423
  describe "Array types" do
304
424
  let!(:textenc_string_array) { PG::TextEncoder::Array.new elements_type: textenc_string }
305
425
  let!(:textdec_string_array) { PG::TextDecoder::Array.new elements_type: textdec_string }
426
+ let!(:textdec_string_array_raise) { PG::TextDecoder::Array.new elements_type: textdec_string, flags: PG::Coder:: FORMAT_ERROR_TO_RAISE }
306
427
  let!(:textenc_int_array) { PG::TextEncoder::Array.new elements_type: textenc_int, needs_quotation: false }
307
428
  let!(:textdec_int_array) { PG::TextDecoder::Array.new elements_type: textdec_int, needs_quotation: false }
308
429
  let!(:textenc_float_array) { PG::TextEncoder::Array.new elements_type: textenc_float, needs_quotation: false }
@@ -368,6 +489,57 @@ describe "PG::Type derivations" do
368
489
  it 'respects a different delimiter' do
369
490
  expect( textdec_string_array_with_delimiter.decode(%[{1;2;3}]) ).to eq( ['1','2','3'] )
370
491
  end
492
+
493
+ it 'ignores array dimensions' do
494
+ expect( textdec_string_array.decode(%[[2:4]={1,2,3}]) ).to eq( ['1','2','3'] )
495
+ expect( textdec_string_array.decode(%[[]={1,2,3}]) ).to eq( ['1','2','3'] )
496
+ expect( textdec_string_array.decode(%[ [-1:+2]= {4,3,2,1}]) ).to eq( ['4','3','2','1'] )
497
+ end
498
+
499
+ it 'ignores spaces after array' do
500
+ expect( textdec_string_array.decode(%[[2:4]={1,2,3} ]) ).to eq( ['1','2','3'] )
501
+ expect( textdec_string_array.decode(%[{1,2,3} ]) ).to eq( ['1','2','3'] )
502
+ end
503
+
504
+ describe "with malformed syntax are deprecated" do
505
+ it 'accepts broken array dimensions' do
506
+ expect( textdec_string_array.decode(%([2:4={1,2,3})) ).to eq([['1','2','3']])
507
+ expect( textdec_string_array.decode(%(2:4]={1,2,3})) ).to eq([['1','2','3']])
508
+ expect( textdec_string_array.decode(%(={1,2,3})) ).to eq([['1','2','3']])
509
+ expect( textdec_string_array.decode(%([x]={1,2,3})) ).to eq([['1','2','3']])
510
+ expect( textdec_string_array.decode(%([]{1,2,3})) ).to eq([['1','2','3']])
511
+ expect( textdec_string_array.decode(%(1,2,3)) ).to eq(['','2'])
512
+ end
513
+
514
+ it 'accepts malformed arrays' do
515
+ expect( textdec_string_array.decode(%({1,2,3)) ).to eq(['1','2'])
516
+ expect( textdec_string_array.decode(%({1,2,3}})) ).to eq(['1','2','3'])
517
+ expect( textdec_string_array.decode(%({1,2,3}x)) ).to eq(['1','2','3'])
518
+ expect( textdec_string_array.decode(%({{1,2},{2,3})) ).to eq([['1','2'],['2','3']])
519
+ expect( textdec_string_array.decode(%({{1,2},{2,3}}x)) ).to eq([['1','2'],['2','3']])
520
+ expect( textdec_string_array.decode(%({[1,2},{2,3}}})) ).to eq(['[1','2'])
521
+ end
522
+ end
523
+
524
+ describe "with malformed syntax are raised with pg-2.0+" do
525
+ it 'complains about broken array dimensions' do
526
+ expect{ textdec_string_array_raise.decode(%([2:4={1,2,3})) }.to raise_error(TypeError)
527
+ expect{ textdec_string_array_raise.decode(%(2:4]={1,2,3})) }.to raise_error(TypeError)
528
+ expect{ textdec_string_array_raise.decode(%(={1,2,3})) }.to raise_error(TypeError)
529
+ expect{ textdec_string_array_raise.decode(%([x]={1,2,3})) }.to raise_error(TypeError)
530
+ expect{ textdec_string_array_raise.decode(%([]{1,2,3})) }.to raise_error(TypeError)
531
+ expect{ textdec_string_array_raise.decode(%(1,2,3)) }.to raise_error(TypeError)
532
+ end
533
+
534
+ it 'complains about malformed array' do
535
+ expect{ textdec_string_array_raise.decode(%({1,2,3)) }.to raise_error(TypeError)
536
+ expect{ textdec_string_array_raise.decode(%({1,2,3}})) }.to raise_error(TypeError)
537
+ expect{ textdec_string_array_raise.decode(%({1,2,3}x)) }.to raise_error(TypeError)
538
+ expect{ textdec_string_array_raise.decode(%({{1,2},{2,3})) }.to raise_error(TypeError)
539
+ expect{ textdec_string_array_raise.decode(%({{1,2},{2,3}}x)) }.to raise_error(TypeError)
540
+ expect{ textdec_string_array_raise.decode(%({[1,2},{2,3}}})) }.to raise_error(TypeError)
541
+ end
542
+ end
371
543
  end
372
544
 
373
545
  context 'bytea' do
@@ -746,7 +918,7 @@ describe "PG::Type derivations" do
746
918
  end
747
919
 
748
920
  describe '#decode' do
749
- it "should decode different types of Ruby objects" do
921
+ it "should decode COPY text format to array of strings" do
750
922
  expect( decoder.decode("123\t \0#\t#\n#\r#\\ \t234\t#\x01#\002\n".gsub("#", "\\"))).to eq( ["123", " \0\t\n\r\\ ", "234", "\x01\x02"] )
751
923
  end
752
924
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env rspec
1
+ # -*- rspec -*-
2
2
  # encoding: utf-8
3
3
 
4
4
  require_relative 'helpers'
@@ -7,7 +7,7 @@ require 'pg'
7
7
 
8
8
  describe PG do
9
9
 
10
- it "knows what version of the libpq library is loaded", :postgresql_91 do
10
+ it "knows what version of the libpq library is loaded" do
11
11
  expect( PG.library_version ).to be_an( Integer )
12
12
  expect( PG.library_version ).to be >= 90100
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -11,32 +11,31 @@ bindir: bin
11
11
  cert_chain:
12
12
  - |
13
13
  -----BEGIN CERTIFICATE-----
14
- MIIEbDCCAtSgAwIBAgIBATANBgkqhkiG9w0BAQsFADA+MQwwCgYDVQQDDANnZWQx
15
- GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
16
- HhcNMTYwODIwMTgxNzQyWhcNMTcwODIwMTgxNzQyWjA+MQwwCgYDVQQDDANnZWQx
17
- GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
18
- ggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC/JWGRHO+USzR97vXjkFgt
19
- 83qeNf2KHkcvrRTSnR64i6um/ziin0I0oX23H7VYrDJC9A/uoUa5nGRJS5Zw/+wW
20
- ENcvWVZS4iUzi4dsYJGY6yEOsXh2CcF46+QevV8iE+UmbkU75V7Dy1JCaUOyizEt
21
- TH5UHsOtUU7k9TYARt/TgYZKuaoAMZZd5qyVqhF1vV+7/Qzmp89NGflXf2xYP26a
22
- 4MAX2qqKX/FKXqmFO+AGsbwYTEds1mksBF3fGsFgsQWxftG8GfZQ9+Cyu2+l1eOw
23
- cZ+lPcg834G9DrqW2zhqUoLr1MTly4pqxYGb7XoDhoR7dd1kFE2a067+DzWC/ADt
24
- +QkcqWUm5oh1fN0eqr7NsZlVJDulFgdiiYPQiIN7UNsii4Wc9aZqBoGcYfBeQNPZ
25
- soo/6za/bWajOKUmDhpqvaiRv9EDp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OlU
33
+ tkSyLrfZ+RZcH535Hyvif7ZxB0v5OxXXoec+N2vrUsEUMRDL9dg4/WFdN8hIOixF
34
+ 3IPKpZ1ho0Ya5q7yhygtBK9/NBFHw+nbJjcltfPDBXleRe8u73gnQo8AZIhStYSP
35
+ v4qqqa27Bs468d6SoPxjSm8a2mM9HZ4OdWhq4tFsbTeXDVquCfi64OTEaTt2xQdR
36
+ JnC4lpJfCP6aCXa5h2XAQfPSH636cQap
38
37
  -----END CERTIFICATE-----
39
- date: 2017-06-12 00:00:00.000000000 Z
38
+ date: 2019-01-09 00:00:00.000000000 Z
40
39
  dependencies:
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: hoe-mercurial
@@ -58,14 +57,14 @@ dependencies:
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '0.9'
60
+ version: '0.10'
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: '0.9'
67
+ version: '0.10'
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: hoe-highline
71
70
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +99,14 @@ dependencies:
100
99
  requirements:
101
100
  - - "~>"
102
101
  - !ruby/object:Gem::Version
103
- version: '0.6'
102
+ version: 0.7.0
104
103
  type: :development
105
104
  prerelease: false
106
105
  version_requirements: !ruby/object:Gem::Requirement
107
106
  requirements:
108
107
  - - "~>"
109
108
  - !ruby/object:Gem::Version
110
- version: '0.6'
109
+ version: 0.7.0
111
110
  - !ruby/object:Gem::Dependency
112
111
  name: hoe-bundler
113
112
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +166,7 @@ dependencies:
167
166
  description: |-
168
167
  Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/].
169
168
 
170
- It works with {PostgreSQL 9.1 and later}[http://www.postgresql.org/support/versioning/].
169
+ It works with {PostgreSQL 9.2 and later}[http://www.postgresql.org/support/versioning/].
171
170
 
172
171
  A small example usage:
173
172
 
@@ -212,6 +211,7 @@ extra_rdoc_files:
212
211
  - ext/pg_result.c
213
212
  - ext/pg_text_decoder.c
214
213
  - ext/pg_text_encoder.c
214
+ - ext/pg_tuple.c
215
215
  - ext/pg_type_map.c
216
216
  - ext/pg_type_map_all_strings.c
217
217
  - ext/pg_type_map_by_class.c
@@ -252,6 +252,7 @@ files:
252
252
  - ext/pg_result.c
253
253
  - ext/pg_text_decoder.c
254
254
  - ext/pg_text_encoder.c
255
+ - ext/pg_tuple.c
255
256
  - ext/pg_type_map.c
256
257
  - ext/pg_type_map_all_strings.c
257
258
  - ext/pg_type_map_by_class.c
@@ -266,21 +267,24 @@ files:
266
267
  - ext/vc/pg_19/pg_19.vcproj
267
268
  - lib/pg.rb
268
269
  - lib/pg/basic_type_mapping.rb
270
+ - lib/pg/binary_decoder.rb
269
271
  - lib/pg/coder.rb
270
272
  - lib/pg/connection.rb
271
273
  - lib/pg/constants.rb
272
- - lib/pg/deprecated_constants.rb
273
274
  - lib/pg/exceptions.rb
274
275
  - lib/pg/result.rb
275
276
  - lib/pg/text_decoder.rb
276
277
  - lib/pg/text_encoder.rb
278
+ - lib/pg/tuple.rb
277
279
  - lib/pg/type_map_by_column.rb
278
280
  - spec/data/expected_trace.out
279
281
  - spec/data/random_binary_data
280
282
  - spec/helpers.rb
281
283
  - spec/pg/basic_type_mapping_spec.rb
282
284
  - spec/pg/connection_spec.rb
285
+ - spec/pg/connection_sync_spec.rb
283
286
  - spec/pg/result_spec.rb
287
+ - spec/pg/tuple_spec.rb
284
288
  - spec/pg/type_map_by_class_spec.rb
285
289
  - spec/pg/type_map_by_column_spec.rb
286
290
  - spec/pg/type_map_by_mri_type_spec.rb
@@ -311,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
315
  version: '0'
312
316
  requirements: []
313
317
  rubyforge_project:
314
- rubygems_version: 2.6.12
318
+ rubygems_version: 2.7.8
315
319
  signing_key:
316
320
  specification_version: 4
317
321
  summary: Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/]