pg 1.1.3 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.appveyor.yml +42 -0
  4. data/.gems +6 -0
  5. data/.github/workflows/binary-gems.yml +117 -0
  6. data/.github/workflows/source-gem.yml +141 -0
  7. data/.gitignore +22 -0
  8. data/.hgsigs +34 -0
  9. data/.hgtags +41 -0
  10. data/.irbrc +23 -0
  11. data/.pryrc +23 -0
  12. data/.tm_properties +21 -0
  13. data/.travis.yml +49 -0
  14. data/Gemfile +14 -0
  15. data/History.md +884 -0
  16. data/Manifest.txt +3 -3
  17. data/README-Windows.rdoc +4 -4
  18. data/README.ja.md +300 -0
  19. data/README.md +286 -0
  20. data/Rakefile +37 -137
  21. data/Rakefile.cross +62 -62
  22. data/certs/ged.pem +24 -0
  23. data/certs/larskanis-2022.pem +26 -0
  24. data/certs/larskanis-2023.pem +24 -0
  25. data/ext/errorcodes.def +80 -0
  26. data/ext/errorcodes.rb +0 -0
  27. data/ext/errorcodes.txt +22 -2
  28. data/ext/extconf.rb +105 -26
  29. data/ext/gvl_wrappers.c +4 -0
  30. data/ext/gvl_wrappers.h +23 -0
  31. data/ext/pg.c +204 -152
  32. data/ext/pg.h +52 -21
  33. data/ext/pg_binary_decoder.c +100 -17
  34. data/ext/pg_binary_encoder.c +238 -13
  35. data/ext/pg_coder.c +109 -34
  36. data/ext/pg_connection.c +1383 -983
  37. data/ext/pg_copy_coder.c +356 -35
  38. data/ext/pg_errors.c +1 -1
  39. data/ext/pg_record_coder.c +522 -0
  40. data/ext/pg_result.c +439 -172
  41. data/ext/pg_text_decoder.c +42 -18
  42. data/ext/pg_text_encoder.c +201 -56
  43. data/ext/pg_tuple.c +97 -66
  44. data/ext/pg_type_map.c +45 -11
  45. data/ext/pg_type_map_all_strings.c +21 -7
  46. data/ext/pg_type_map_by_class.c +59 -27
  47. data/ext/pg_type_map_by_column.c +80 -37
  48. data/ext/pg_type_map_by_mri_type.c +49 -20
  49. data/ext/pg_type_map_by_oid.c +62 -29
  50. data/ext/pg_type_map_in_ruby.c +56 -22
  51. data/ext/{util.c → pg_util.c} +7 -7
  52. data/lib/pg/basic_type_map_based_on_result.rb +67 -0
  53. data/lib/pg/basic_type_map_for_queries.rb +198 -0
  54. data/lib/pg/basic_type_map_for_results.rb +104 -0
  55. data/lib/pg/basic_type_registry.rb +299 -0
  56. data/lib/pg/binary_decoder/date.rb +9 -0
  57. data/lib/pg/binary_decoder/timestamp.rb +26 -0
  58. data/lib/pg/binary_encoder/timestamp.rb +20 -0
  59. data/lib/pg/coder.rb +35 -12
  60. data/lib/pg/connection.rb +744 -84
  61. data/lib/pg/exceptions.rb +15 -1
  62. data/lib/pg/result.rb +13 -1
  63. data/lib/pg/text_decoder/date.rb +18 -0
  64. data/lib/pg/text_decoder/inet.rb +9 -0
  65. data/lib/pg/text_decoder/json.rb +14 -0
  66. data/lib/pg/text_decoder/numeric.rb +9 -0
  67. data/lib/pg/text_decoder/timestamp.rb +30 -0
  68. data/lib/pg/text_encoder/date.rb +12 -0
  69. data/lib/pg/text_encoder/inet.rb +28 -0
  70. data/lib/pg/text_encoder/json.rb +14 -0
  71. data/lib/pg/text_encoder/numeric.rb +9 -0
  72. data/lib/pg/text_encoder/timestamp.rb +24 -0
  73. data/lib/pg/type_map_by_column.rb +2 -1
  74. data/lib/pg/version.rb +4 -0
  75. data/lib/pg.rb +94 -39
  76. data/misc/openssl-pg-segfault.rb +31 -0
  77. data/misc/postgres/History.txt +9 -0
  78. data/misc/postgres/Manifest.txt +5 -0
  79. data/misc/postgres/README.txt +21 -0
  80. data/misc/postgres/Rakefile +21 -0
  81. data/misc/postgres/lib/postgres.rb +16 -0
  82. data/misc/ruby-pg/History.txt +9 -0
  83. data/misc/ruby-pg/Manifest.txt +5 -0
  84. data/misc/ruby-pg/README.txt +21 -0
  85. data/misc/ruby-pg/Rakefile +21 -0
  86. data/misc/ruby-pg/lib/ruby/pg.rb +16 -0
  87. data/pg.gemspec +34 -0
  88. data/rakelib/task_extension.rb +46 -0
  89. data/sample/array_insert.rb +20 -0
  90. data/sample/async_api.rb +102 -0
  91. data/sample/async_copyto.rb +39 -0
  92. data/sample/async_mixed.rb +56 -0
  93. data/sample/check_conn.rb +21 -0
  94. data/sample/copydata.rb +71 -0
  95. data/sample/copyfrom.rb +81 -0
  96. data/sample/copyto.rb +19 -0
  97. data/sample/cursor.rb +21 -0
  98. data/sample/disk_usage_report.rb +177 -0
  99. data/sample/issue-119.rb +94 -0
  100. data/sample/losample.rb +69 -0
  101. data/sample/minimal-testcase.rb +17 -0
  102. data/sample/notify_wait.rb +72 -0
  103. data/sample/pg_statistics.rb +285 -0
  104. data/sample/replication_monitor.rb +222 -0
  105. data/sample/test_binary_values.rb +33 -0
  106. data/sample/wal_shipper.rb +434 -0
  107. data/sample/warehouse_partitions.rb +311 -0
  108. data/translation/.po4a-version +7 -0
  109. data/translation/po/all.pot +936 -0
  110. data/translation/po/ja.po +1036 -0
  111. data/translation/po4a.cfg +12 -0
  112. data.tar.gz.sig +0 -0
  113. metadata +144 -222
  114. metadata.gz.sig +0 -0
  115. data/ChangeLog +0 -6595
  116. data/History.rdoc +0 -485
  117. data/README.ja.rdoc +0 -14
  118. data/README.rdoc +0 -178
  119. data/lib/pg/basic_type_mapping.rb +0 -459
  120. data/lib/pg/binary_decoder.rb +0 -22
  121. data/lib/pg/constants.rb +0 -11
  122. data/lib/pg/text_decoder.rb +0 -47
  123. data/lib/pg/text_encoder.rb +0 -69
  124. data/spec/data/expected_trace.out +0 -26
  125. data/spec/data/random_binary_data +0 -0
  126. data/spec/helpers.rb +0 -381
  127. data/spec/pg/basic_type_mapping_spec.rb +0 -508
  128. data/spec/pg/connection_spec.rb +0 -1849
  129. data/spec/pg/connection_sync_spec.rb +0 -41
  130. data/spec/pg/result_spec.rb +0 -491
  131. data/spec/pg/tuple_spec.rb +0 -280
  132. data/spec/pg/type_map_by_class_spec.rb +0 -138
  133. data/spec/pg/type_map_by_column_spec.rb +0 -222
  134. data/spec/pg/type_map_by_mri_type_spec.rb +0 -136
  135. data/spec/pg/type_map_by_oid_spec.rb +0 -149
  136. data/spec/pg/type_map_in_ruby_spec.rb +0 -164
  137. data/spec/pg/type_map_spec.rb +0 -22
  138. data/spec/pg/type_spec.rb +0 -949
  139. data/spec/pg_spec.rb +0 -50
  140. /data/ext/{util.h → pg_util.h} +0 -0
data/History.rdoc DELETED
@@ -1,485 +0,0 @@
1
- == v1.1.3 [2018-09-06] Michael Granger <ged@FaerieMUD.org>
2
-
3
- - Revert opimization that was sometimes causing EBADF in rb_wait_for_single_fd().
4
-
5
-
6
- == v1.1.2 [2018-08-28] Michael Granger <ged@FaerieMUD.org>
7
-
8
- - Don't generate aliases for JOHAB encoding.
9
- This avoids linking to deprecated/private function rb_enc(db)_alias().
10
-
11
-
12
- == v1.1.1 [2018-08-27] Michael Granger <ged@FaerieMUD.org>
13
-
14
- - Reduce deprecation warnings to only one message per deprecation.
15
-
16
-
17
- == v1.1.0 [2018-08-24] Michael Granger <ged@FaerieMUD.org>
18
-
19
- Deprecated (disable warnings per PG_SKIP_DEPRECATION_WARNING=1):
20
- - Forwarding conn.exec to conn.exec_params is deprecated.
21
- - Forwarding conn.exec_params to conn.exec is deprecated.
22
- - Forwarding conn.async_exec to conn.async_exec_params.
23
- - Forwarding conn.send_query to conn.send_query_params is deprecated.
24
- - Forwarding conn.async_exec_params to conn.async_exec is deprecated.
25
-
26
- PG::Connection enhancements:
27
- - Provide PG::Connection#sync_* and PG::Connection#async_* query methods for explicit calling syncronous or asynchronous libpq API.
28
- - Make PG::Connection#exec and siblings switchable between sync and async API per PG::Connection.async_api= and change the default to async flavors.
29
- - Add async flavors of exec_params, prepare, exec_prepared, describe_prepared and describe_portal.
30
- They are identical to their syncronous counterpart, but make use of PostgreSQL's async API.
31
- - Replace `rb_thread_fd_select()` by faster `rb_wait_for_single_fd()` in `conn.block` and `conn.async_exec` .
32
- - Add PG::Connection#discard_results .
33
- - Raise an ArgumentError for strings containing zero bytes by #escape, #escape_literal, #escape_identifier, #quote_ident and PG::TextEncoder::Identifier. These methods previously truncated strings.
34
-
35
- Result retrieval enhancements:
36
- - Add PG::Result#tuple_values to retrieve all field values of a row as array.
37
- - Add PG::Tuple, PG::Result#tuple and PG::Result#stream_each_tuple .
38
- PG::Tuple offers a way to lazy cast result values.
39
- - Estimate PG::Result size allocated by libpq and notify the garbage collector about it when running on Ruby-2.4 or newer.
40
- - Make the estimated PG::Result size available to ObjectSpace.memsize_of(result) .
41
-
42
- Type cast enhancements:
43
- - Replace Ruby code by a faster C implementation of the SimpleDecoder's timestamp decode functions. github #20
44
- - Interpret years with up to 7 digists and BC dates by timestamp decoder.
45
- - Add text timestamp decoders for UTC vs. local timezone variations.
46
- - Add text timestamp encoders for UTC timezone.
47
- - Add decoders for binary timestamps: PG::BinaryDecoder::Timestamp and variations.
48
- - Add PG::Coder#flags accessor to allow modifications of de- respectively encoder behaviour.
49
- - Add a flag to raise TypeError for invalid input values to PG::TextDecoder::Array .
50
- - Add a text decoder for inet/cidr written in C.
51
- - Add a numeric decoder written in C.
52
- - Ensure input text is zero terminated for text format in PG::Coder#decode .
53
-
54
- Source code enhancements:
55
- - Fix headers and permission bits of various repository files.
56
-
57
- Bugfixes:
58
- - Properly decode array with prepended dimensions. #272
59
- For now dimension decorations are ignored, but a correct Array is returned.
60
- - Array-Decoder: Avoid leaking memory when an Exception is raised while parsing. Fixes #279
61
-
62
-
63
- == v1.0.0 [2018-01-10] Michael Granger <ged@FaerieMUD.org>
64
-
65
- Deprecated:
66
- - Deprecate Ruby older than 2.2.
67
- - Deprecate Connection#socket in favor of #socket_io.
68
-
69
- Removed:
70
- - Remove compatibility code for Ruby < 2.0 and PostgreSQL < 9.2.
71
- - Remove partial compatibility with Rubinius.
72
- - Remove top-level constants PGconn, PGresult, and PGError.
73
-
74
- Enhancements:
75
- - Update error codes to PostgreSQL-10
76
- - Update Windows binary gems to Ruby-2.5, PostgreSQL 10.1 and
77
- OpenSSL 1.1.0g.
78
-
79
- Bugfixes:
80
- - Fix URI detection for connection strings. #265 (thanks to jjoos)
81
- - MINGW: Workaround segfault due to GCC linker error in conjunction with MSVC.
82
- This happens when linking to PostgreSQL-10.0-x64 from EnterpriseDB.
83
-
84
- Documentation fixes:
85
- - Add PostgreSQL version since when the given function is supported. #263
86
- - Better documentation to `encoder` and `decoder` arguments of COPY related methods.
87
-
88
-
89
- == v0.21.0 [2017-06-12] Michael Granger <ged@FaerieMUD.org>
90
-
91
- Enhancements:
92
- - Move add_dll_directory to the Runtime namespace for newest versions
93
- of RubyInstaller.
94
- - Deprecate PGconn, PGresult, and PGError top-level constants; a warning
95
- will be output the first time one of them is used. They will be
96
- removed in the upcoming 1.0 release.
97
-
98
- Documentation fixes:
99
- - Update the docs for PG::Result#cmd_tuples
100
-
101
- New Samples:
102
- - Add an example of the nicer #copy_data way of doing `COPY`.
103
-
104
-
105
- == v0.20.0 [2017-03-10] Michael Granger <ged@FaerieMUD.org>
106
-
107
- Enhancements:
108
- - Update error codes to PostgreSQL-9.6
109
- - Update Windows binary gems to Ruby-2.4, PostgreSQL 9.6.1 and
110
- OpenSSL 1.0.2j.
111
- - Add support for RubyInstaller2 to Windows binary gems.
112
-
113
- Bugfixes:
114
- - Use secure JSON methods for JSON (de)serialisation. #248
115
- - Fix Result#inspect on a cleared result.
116
- - Fix test case that failed on Ruby-2.4. #255
117
-
118
- Documentation fixes:
119
- - Talk about Integer instead of Fixnum.
120
- - Fix method signature of Coder#encode.
121
-
122
-
123
- == v0.19.0 [2016-09-21] Michael Granger <ged@FaerieMUD.org>
124
-
125
- - Deprecate Ruby 1.9
126
-
127
- Enhancements:
128
- - Respect and convert character encoding of all strings sent
129
- to the server. #231
130
- - Add PostgreSQL-9.5 functions PQsslInUse(), PQsslAttribute()
131
- and PQsslAttributeNames().
132
- - Various documentation fixes and improvements.
133
- - Add mechanism to build without pg_config:
134
- gem install pg -- --with-pg-config=ignore
135
- - Update Windows binary gems to Ruby-2.3, PostgreSQL 9.5.4 and
136
- OpenSSL 1.0.2f.
137
- - Add JSON coders and add them to BasicTypeMapForResults and
138
- BasicTypeMapBasedOnResult
139
- - Allow build from git per bundler.
140
-
141
- Bugfixes:
142
- - Release GVL while calling PQsetClientEncoding(). #245
143
- - Add __EXTENSIONS__ to Solaris/SmartOS for Ruby >= 2.3.x. #236
144
- - Fix wrong exception when running SQL while in Connection#copy_data
145
- block for output
146
-
147
-
148
- == v0.18.4 [2015-11-13] Michael Granger <ged@FaerieMUD.org>
149
-
150
- Enhancements:
151
- - Fixing compilation problems with Microsoft Visual Studio 2008. GH #10
152
- - Avoid name clash with xcode and jemalloc. PR#22, PR#23
153
-
154
- Bugfixes:
155
- - Avoid segfault, when quote_ident or TextEncoder::Identifier
156
- is called with Array containing non-strings. #226
157
-
158
-
159
- == v0.18.3 [2015-09-03] Michael Granger <ged@FaerieMUD.org>
160
-
161
- Enhancements:
162
- - Use rake-compiler-dock to build windows gems easily.
163
- - Add CI-tests on appveyor and fix test cases accordingly.
164
-
165
- Bugfixes:
166
- - Fix data type resulting in wrong base64 encoding.
167
- - Change instance_of checks to kind_of for subclassing. #220
168
- - TextDecoder::Date returns an actual Ruby Date instead of a Time
169
- (thanks to Thomas Ramfjord)
170
-
171
-
172
- == v0.18.2 [2015-05-14] Michael Granger <ged@FaerieMUD.org>
173
-
174
- Enhancements:
175
-
176
- - Allow URI connection string (thanks to Chris Bandy)
177
- - Allow Array type parameter to conn.quote_ident
178
-
179
- Bugfixes:
180
-
181
- - Speedups and fixes for PG::TextDecoder::Identifier and quoting behavior
182
- - Revert addition of PG::Connection#hostaddr [#202].
183
- - Fix decoding of fractional timezones and timestamps [#203]
184
- - Fixes for non-C99 compilers
185
- - Avoid possible symbol name clash when linking againt static libpq.
186
-
187
-
188
- == v0.18.1 [2015-01-05] Michael Granger <ged@FaerieMUD.org>
189
-
190
- Correct the minimum compatible Ruby version to 1.9.3. #199
191
-
192
-
193
- == v0.18.0 [2015-01-01] Michael Granger <ged@FaerieMUD.org>
194
-
195
- Bugfixes:
196
- - Fix OID to Integer mapping (it is unsigned now). #187
197
- - Fix possible segfault in conjunction with notice receiver. #185
198
-
199
- Enhancements:
200
-
201
- - Add an extensible type cast system.
202
- - A lot of performance improvements.
203
- - Return frozen String objects for result field names.
204
- - Add PG::Result#stream_each and #stream_each_row as fast helpers for
205
- the single row mode.
206
- - Add Enumerator variant to PG::Result#each and #each_row.
207
- - Add PG::Connection#conninfo and #hostaddr.
208
- - Add PG.init_openssl and PG.init_ssl methods.
209
- - Add PG::Result.inspect
210
- - Force zero termination for all text strings that are given to libpq.
211
- It raises an ArgumentError if the string contains a null byte.
212
- - Update Windows cross build to PostgreSQL 9.3.
213
-
214
-
215
-
216
- == v0.17.1 [2013-12-18] Michael Granger <ged@FaerieMUD.org>
217
-
218
- Bugfixes:
219
-
220
- - Fix compatibility with signal handlers defined in Ruby. This reverts
221
- cancelation of queries running on top of the blocking libpq API (like
222
- Connection#exec) in case of signals. As an alternative the #async_exec
223
- can be used, which is reverted to use the non-blocking API, again.
224
- - Wrap PQcancel to be called without GVL. It internally waits for
225
- the canceling connection.
226
-
227
- Documentation fixes:
228
-
229
- - Fix documentation for PG::Connection::conndefaults.
230
-
231
-
232
- == v0.17.0 [2013-09-15] Michael Granger <ged@FaerieMUD.org>
233
-
234
- Bugfixes:
235
-
236
- - Fix crash by calling PQsend* and PQisBusy without GVL (#171).
237
-
238
- Enhancements:
239
-
240
- - Add method PG::Connection#copy_data.
241
- - Add a Gemfile to allow installation of dependencies with bundler.
242
- - Add compatibility with rake-compiler-dev-box.
243
- - Return self from PG::Result#check instead of nil. This allows
244
- to stack method calls.
245
-
246
-
247
- == v0.16.0 [2013-07-22] Michael Granger <ged@FaerieMUD.org>
248
-
249
- Bugfixes:
250
-
251
- - Avoid warnings about uninitialized instance variables.
252
- - Use a more standard method of adding library and include directories.
253
- This fixes build on AIX (Github #7) and Solaris (#164).
254
- - Cancel the running query, if a thread is about to be killed (e.g. by CTRL-C).
255
- - Fix GVL issue with wait_for_notify/notifies and notice callbacks.
256
- - Set proper encoding on the string returned by quote_ident, escape_literal
257
- and escape_identifier (#163).
258
- - Use nil as PG::Error#result in case of a NULL-result from libpq (#166).
259
- - Recalculate the timeout of conn#wait_for_notify and conn#block in case
260
- of socket events that require re-runs of select().
261
-
262
- Documentation fixes:
263
-
264
- - Fix non working example for PGresult#error_field.
265
-
266
- Enhancements:
267
-
268
- - Add unique exception classes for each PostgreSQL error type (#5).
269
- - Return result of the block in conn#transaction instead of nil (#158).
270
- - Allow 'rake compile' and 'rake gem' on non mercurial repos.
271
- - Add support for PG_DIAG_*_NAME error fields of PostgreSQL-9.3 (#161).
272
-
273
-
274
- == v0.15.1 [2013-04-08] Michael Granger <ged@FaerieMUD.org>
275
-
276
- Bugfixes:
277
-
278
- - Shorten application_name to avoid warnings about truncated identifier.
279
-
280
-
281
- == v0.15.0 [2013-03-03] Michael Granger <ged@FaerieMUD.org>
282
-
283
- Bugfixes:
284
-
285
- - Fix segfault in PG::Result#field_values when called with non String value.
286
- - Fix encoding of messages delivered by notice callbacks.
287
- - Fix text encoding for Connection#wait_for_notify and Connection#notifies.
288
- - Fix 'Bad file descriptor' problems under Windows: wrong behaviour of
289
- #wait_for_notify() and timeout handling of #block on Ruby 1.9.
290
-
291
- Documentation fixes:
292
-
293
- - conn#socket() can not be used with IO.for_fd() on Windows.
294
-
295
- Enhancements:
296
-
297
- - Tested under Ruby 2.0.0p0.
298
- - Add single row mode of PostgreSQL 9.2.
299
- - Set fallback_application_name to programm name $0. Thanks to Will Leinweber
300
- for the patch.
301
- - Release Ruby's GVL while calls to blocking libpq functions to allow better
302
- concurrency in threaded applications.
303
- - Refactor different variants of waiting for the connection socket.
304
- - Make use of rb_thread_fd_select() on Ruby 1.9 and avoid deprecated
305
- rb_thread_select().
306
- - Add an example of how to insert array data using a prepared statement (#145).
307
- - Add continous integration tests on travis-ci.org.
308
- - Add PG::Result#each_row for iterative over result sets by row. Thanks to
309
- Aaron Patterson for the patch.
310
- - Add a PG::Connection#socket_io method for fetching a (non-autoclosing) IO
311
- object for the connection's socket.
312
-
313
- Specs:
314
-
315
- - Fix various specs to run on older PostgreSQL and Ruby versions.
316
- - Avoid fork() in specs to allow usage on Windows and JRuby.
317
-
318
-
319
- == v0.14.1 [2012-09-02] Michael Granger <ged@FaerieMUD.org>
320
-
321
- Important bugfix:
322
-
323
- - Fix stack overflow bug in PG::Result#values and #column_values (#135). Thanks
324
- to everyone who reported the bug, and Lars Kanis especially for figuring out
325
- the problem.
326
-
327
- PostgreSQL 9.2 beta fixes:
328
-
329
- - Recognize PGRES_SINGLE_TUPLE as OK when checking PGresult (Jeremy Evans)
330
-
331
- Documentation fixes:
332
-
333
- - Add note about the usage scope of the result object received by the
334
- #set_notice_receiver block. (Lars Kanis)
335
- - Add PGRES_COPY_BOTH to documentation of PG::Result#result_status. (Lars Kanis)
336
- - Add some documentation to PG::Result#fnumber (fix for #139)
337
-
338
-
339
- == v0.14.0 [2012-06-17] Michael Granger <ged@FaerieMUD.org>
340
-
341
- Bugfixes:
342
- #47, #104
343
-
344
-
345
- New Methods for PostgreSQL 9 and async API support:
346
- PG
347
- - ::library_version
348
-
349
- PG::Connection
350
- - ::ping
351
- - #escape_literal
352
- - #escape_identifier
353
- - #set_default_encoding
354
-
355
- PG::Result
356
- - #check
357
-
358
-
359
- New Samples:
360
-
361
- This release also comes with a collection of contributed sample scripts for
362
- doing resource-utilization reports, graphing database statistics,
363
- monitoring for replication lag, shipping WAL files for replication,
364
- automated tablespace partitioning, etc. See the samples/ directory.
365
-
366
-
367
- == v0.13.2 [2012-02-22] Michael Granger <ged@FaerieMUD.org>
368
-
369
- - Make builds against PostgreSQL earlier than 8.3 fail with a descriptive
370
- message instead of a compile failure.
371
-
372
-
373
- == v0.13.1 [2012-02-12] Michael Granger <ged@FaerieMUD.org>
374
-
375
- - Made use of a finished PG::Connection raise a PG::Error instead of
376
- a fatal error (#110).
377
- - Added missing BSDL license file (#108)
378
-
379
-
380
- == v0.13.0 [2012-02-09] Michael Granger <ged@FaerieMUD.org>
381
-
382
- Reorganization of modules/classes to be better Ruby citizens (with backward-compatible aliases):
383
- - Created toplevel namespace 'PG' to correspond with the gem name.
384
- - Renamed PGconn to PG::Connection (with ::PGconn alias)
385
- - Renamed PGresult to PG::Result (with ::PGresult alias)
386
- - Renamed PGError to PG::Error (with ::PGError alias)
387
- - Declare all constants inside PG::Constants, then include them in
388
- PG::Connection and PG::Result for backward-compatibility, and
389
- in PG for convenience.
390
- - Split the extension source up by class/module.
391
- - Removed old compatibility code for PostgreSQL versions < 8.3
392
-
393
- Documentation:
394
- - Clarified licensing, updated to Ruby 1.9's license.
395
- - Merged authors list, added some missing people to the Contributor's
396
- list.
397
- - Cleaned up the sample/ directory
398
- - Making contact info a bit clearer, link to the Google+ page and
399
- the mailing list
400
-
401
- Enhancements:
402
- - Added a convenience method: PG.connect -> PG::Connection.new
403
-
404
- Bugfixes:
405
- - Fixed LATIN5-LATIN10 Postgres<->Ruby encoding conversions
406
-
407
-
408
-
409
- == v0.12.2 [2012-01-03] Michael Granger <ged@FaerieMUD.org>
410
-
411
- - Fix for the 1.8.7 breakage introduced by the st.h fix for alternative Ruby
412
- implementations (#97 and #98). Thanks to Lars Kanis for the patch.
413
- - Encode error messages with the connection's encoding under 1.9 (#96)
414
-
415
-
416
- == v0.12.1 [2011-12-14] Michael Granger <ged@FaerieMUD.org>
417
-
418
- - Made rake-compiler a dev dependency, as Rubygems doesn't use the Rakefile
419
- for compiling the extension. Thanks to eolamey@bitbucket and Jeremy Evans
420
- for pointing this out.
421
- - Added an explicit include for ruby/st.h for implementations that need it
422
- (fixes #95).
423
-
424
-
425
- == v0.12.0 [2011-12-07] Michael Granger <ged@FaerieMUD.org>
426
-
427
- - PGconn#wait_for_notify
428
- * send nil as the payload argument if the NOTIFY didn't have one.
429
- * accept a nil argument for no timeout (Sequel support)
430
- * Fixed API docs
431
- * Taint and encode event name and payload
432
- - Handle errors while rb_thread_select()ing in PGconn#block.
433
- (Brian Weaver).
434
- - Fixes for Win32 async queries (Rafał Bigaj)
435
- - Memory leak fixed: Closing opened WSA event. (rafal)
436
- - Fixes for #66 Win32 asynchronous queries hang on connection
437
- error. (rafal)
438
- - Fixed a typo in PGconn#error_message's documentation
439
- - fixing unused variable warnings for ruby 1.9.3 (Aaron Patterson)
440
- - Build system bugfixes
441
- - Converted to Hoe
442
- - Updates for the Win32 binary gem builds (Lars Kanis)
443
-
444
-
445
- == v0.11.0 [2011-02-09] Michael Granger <ged@FaerieMUD.org>
446
-
447
- Enhancements:
448
-
449
- * Added a PGresult#values method to fetch all result rows as an Array of
450
- Arrays. Thanks to Jason Yanowitz (JYanowitz at enovafinancial dot com) for
451
- the patch.
452
-
453
-
454
- == v0.10.1 [2011-01-19] Michael Granger <ged@FaerieMUD.org>
455
-
456
- Bugfixes:
457
-
458
- * Add an include guard for pg.h
459
- * Simplify the common case require of the ext
460
- * Include the extconf header
461
- * Fix compatibility with versions of PostgreSQL without PQgetCancel. (fixes #36)
462
- * Fix require for natively-compiled extension under Windows. (fixes #55)
463
- * Change rb_yield_splat() to rb_yield_values() for compatibility with Rubinius. (fixes #54)
464
-
465
-
466
- == v0.10.0 [2010-12-01] Michael Granger <ged@FaerieMUD.org>
467
-
468
- Enhancements:
469
-
470
- * Added support for the payload of NOTIFY events (w/Mahlon E. Smith)
471
- * Updated the build system with Rubygems suggestions from RubyConf 2010
472
-
473
- Bugfixes:
474
-
475
- * Fixed issue with PGconn#wait_for_notify that caused it to miss notifications that happened after
476
- the LISTEN but before the wait_for_notify.
477
-
478
- == v0.9.0 [2010-02-28] Michael Granger <ged@FaerieMUD.org>
479
-
480
- Bugfixes.
481
-
482
- == v0.8.0 [2009-03-28] Jeff Davis <davis.jeffrey@gmail.com>
483
-
484
- Bugfixes, better Windows support.
485
-
data/README.ja.rdoc DELETED
@@ -1,14 +0,0 @@
1
- = pg
2
-
3
- home :: https://bitbucket.org/ged/ruby-pg
4
- mirror :: https://github.com/ged/ruby-pg
5
- docs :: http://deveiate.org/code/pg
6
-
7
-
8
- == Description
9
-
10
- This file needs a translation of the English README. Pull requests, patches, or
11
- volunteers gladly accepted.
12
-
13
- Until such time, please accept my sincere apologies for not knowing Japanese.
14
-
data/README.rdoc DELETED
@@ -1,178 +0,0 @@
1
- = pg
2
-
3
- home :: https://bitbucket.org/ged/ruby-pg
4
- mirror :: https://github.com/ged/ruby-pg
5
- docs :: http://deveiate.org/code/pg
6
-
7
- {<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/ged/ruby-pg">}[https://gitter.im/ged/ruby-pg?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge]
8
-
9
-
10
- == Description
11
-
12
- Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/].
13
-
14
- It works with {PostgreSQL 9.2 and later}[http://www.postgresql.org/support/versioning/].
15
-
16
- A small example usage:
17
-
18
- #!/usr/bin/env ruby
19
-
20
- require 'pg'
21
-
22
- # Output a table of current connections to the DB
23
- conn = PG.connect( dbname: 'sales' )
24
- conn.exec( "SELECT * FROM pg_stat_activity" ) do |result|
25
- puts " PID | User | Query"
26
- result.each do |row|
27
- puts " %7d | %-16s | %s " %
28
- row.values_at('procpid', 'usename', 'current_query')
29
- end
30
- end
31
-
32
- == Build Status
33
-
34
- {<img src="https://travis-ci.org/ged/ruby-pg.svg?branch=master" alt="Build Status Travis-CI" />}[https://travis-ci.org/ged/ruby-pg]
35
- {<img src="https://ci.appveyor.com/api/projects/status/at4g4swb2cd4xji7/branch/master?svg=true" alt="Build Status Appveyor" />}[https://ci.appveyor.com/project/ged/ruby-pg]
36
-
37
-
38
- == Requirements
39
-
40
- * Ruby 2.2 or newer
41
- * PostgreSQL 9.2.x or later (with headers, -dev packages, etc).
42
-
43
- It usually work with earlier versions of Ruby/PostgreSQL as well, but those are
44
- not regularly tested.
45
-
46
-
47
- == Versioning
48
-
49
- We tag and release gems according to the {Semantic Versioning}[http://semver.org/] principle.
50
-
51
- As a result of this policy, you can (and should) specify a dependency on this gem using the {Pessimistic Version Constraint}[http://guides.rubygems.org/patterns/#pessimistic-version-constraint] with two digits of precision.
52
-
53
- For example:
54
-
55
- spec.add_dependency 'pg', '~> 1.0'
56
-
57
-
58
- == How To Install
59
-
60
- Install via RubyGems:
61
-
62
- gem install pg
63
-
64
- You may need to specify the path to the 'pg_config' program installed with
65
- Postgres:
66
-
67
- gem install pg -- --with-pg-config=<path to pg_config>
68
-
69
- If you're installing via Bundler, you can provide compile hints like so:
70
-
71
- bundle config build.pg --with-pg-config=<path to pg_config>
72
-
73
- See README-OS_X.rdoc for more information about installing under MacOS X, and
74
- README-Windows.rdoc for Windows build/installation instructions.
75
-
76
- There's also {a Google+ group}[http://goo.gl/TFy1U] and a
77
- {mailing list}[http://groups.google.com/group/ruby-pg] if you get stuck, or just
78
- want to chat about something.
79
-
80
- If you want to install as a signed gem, the public certs of the gem signers
81
- can be found in {the `certs` directory}[https://bitbucket.org/ged/ruby-pg/src/tip/certs/]
82
- of the repository.
83
-
84
-
85
- == Type Casts
86
-
87
- Pg can optionally type cast result values and query parameters in Ruby or
88
- native C code. This can speed up data transfers to and from the database,
89
- because String allocations are reduced and conversions in (slower) Ruby code
90
- can be omitted.
91
-
92
- Very basic type casting can be enabled by:
93
-
94
- conn.type_map_for_results = PG::BasicTypeMapForResults.new conn
95
- # ... this works for result value mapping:
96
- conn.exec("select 1, now(), '{2,3}'::int[]").values
97
- # => [[1, 2014-09-21 20:51:56 +0200, [2, 3]]]
98
-
99
- conn.type_map_for_queries = PG::BasicTypeMapForQueries.new conn
100
- # ... and this for param value mapping:
101
- conn.exec_params("SELECT $1::text, $2::text, $3::text", [1, 1.23, [2,3]]).values
102
- # => [["1", "1.2300000000000000E+00", "{2,3}"]]
103
-
104
- But Pg's type casting is highly customizable. That's why it's divided into
105
- 2 layers:
106
-
107
- === Encoders / Decoders (ext/pg_*coder.c, lib/pg/*coder.rb)
108
-
109
- This is the lower layer, containing encoding classes that convert Ruby
110
- objects for transmission to the DBMS and decoding classes to convert
111
- received data back to Ruby objects. The classes are namespaced according
112
- to their format and direction in PG::TextEncoder, PG::TextDecoder,
113
- PG::BinaryEncoder and PG::BinaryDecoder.
114
-
115
- It is possible to assign a type OID, format code (text or binary) and
116
- optionally a name to an encoder or decoder object. It's also possible
117
- to build composite types by assigning an element encoder/decoder.
118
- PG::Coder objects can be used to set up a PG::TypeMap or alternatively
119
- to convert single values to/from their string representation.
120
-
121
- === PG::TypeMap and derivations (ext/pg_type_map*.c, lib/pg/type_map*.rb)
122
-
123
- A TypeMap defines which value will be converted by which encoder/decoder.
124
- There are different type map strategies, implemented by several derivations
125
- of this class. They can be chosen and configured according to the particular
126
- needs for type casting. The default type map is PG::TypeMapAllStrings.
127
-
128
- A type map can be assigned per connection or per query respectively per
129
- result set. Type maps can also be used for COPY in and out data streaming.
130
- See PG::Connection#copy_data .
131
-
132
- == Contributing
133
-
134
- To report bugs, suggest features, or check out the source with Mercurial,
135
- {check out the project page}[http://bitbucket.org/ged/ruby-pg]. If you prefer
136
- Git, there's also a {Github mirror}[https://github.com/ged/ruby-pg].
137
-
138
- After checking out the source, run:
139
-
140
- $ rake newb
141
-
142
- This task will install any missing dependencies, run the tests/specs, and
143
- generate the API documentation.
144
-
145
- The current maintainers are Michael Granger <ged@FaerieMUD.org> and
146
- Lars Kanis <lars@greiz-reinsdorf.de>.
147
-
148
-
149
- == Copying
150
-
151
- Copyright (c) 1997-2016 by the authors.
152
-
153
- * Jeff Davis <ruby-pg@j-davis.com>
154
- * Guy Decoux (ts) <decoux@moulon.inra.fr>
155
- * Michael Granger <ged@FaerieMUD.org>
156
- * Lars Kanis <lars@greiz-reinsdorf.de>
157
- * Dave Lee
158
- * Eiji Matsumoto <usagi@ruby.club.or.jp>
159
- * Yukihiro Matsumoto <matz@ruby-lang.org>
160
- * Noboru Saitou <noborus@netlab.jp>
161
-
162
- You may redistribute this software under the same terms as Ruby itself; see
163
- https://www.ruby-lang.org/en/about/license.txt or the BSDL file in the source
164
- for details.
165
-
166
- Portions of the code are from the PostgreSQL project, and are distributed
167
- under the terms of the PostgreSQL license, included in the file POSTGRES.
168
-
169
- Portions copyright LAIKA, Inc.
170
-
171
-
172
- == Acknowledgments
173
-
174
- See Contributors.rdoc for the many additional fine people that have contributed
175
- to this library over the years.
176
-
177
- We are thankful to the people at the ruby-list and ruby-dev mailing lists.
178
- And to the people who developed PostgreSQL.