pg 1.1.4 → 1.5.3

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 +137 -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 +876 -0
  16. data/Manifest.txt +3 -3
  17. data/README-Windows.rdoc +4 -4
  18. data/README.ja.md +276 -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 +76 -0
  26. data/ext/errorcodes.rb +0 -0
  27. data/ext/errorcodes.txt +21 -2
  28. data/ext/extconf.rb +101 -26
  29. data/ext/gvl_wrappers.c +4 -0
  30. data/ext/gvl_wrappers.h +23 -0
  31. data/ext/pg.c +203 -151
  32. data/ext/pg.h +48 -21
  33. data/ext/pg_binary_decoder.c +89 -10
  34. data/ext/pg_binary_encoder.c +238 -13
  35. data/ext/pg_coder.c +109 -34
  36. data/ext/pg_connection.c +1365 -976
  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 +436 -171
  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 +910 -0
  110. data/translation/po/ja.po +1047 -0
  111. data/translation/po4a.cfg +12 -0
  112. data.tar.gz.sig +0 -0
  113. metadata +151 -218
  114. metadata.gz.sig +0 -0
  115. data/ChangeLog +0 -6595
  116. data/History.rdoc +0 -492
  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 -380
  127. data/spec/pg/basic_type_mapping_spec.rb +0 -508
  128. data/spec/pg/connection_spec.rb +0 -1872
  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,492 +0,0 @@
1
- == v1.1.4 [2019-01-08] Michael Granger <ged@FaerieMUD.org>
2
-
3
- - Fix PG::BinaryDecoder::Timestamp on 32 bit systems. # 284
4
- - Add new error-codes of PostgreSQL-11.
5
- - Add ruby-2.6 support for Windows fat binary gems and remove ruby-2.0 and 2.1.
6
-
7
-
8
- == v1.1.3 [2018-09-06] Michael Granger <ged@FaerieMUD.org>
9
-
10
- - Revert opimization that was sometimes causing EBADF in rb_wait_for_single_fd().
11
-
12
-
13
- == v1.1.2 [2018-08-28] Michael Granger <ged@FaerieMUD.org>
14
-
15
- - Don't generate aliases for JOHAB encoding.
16
- This avoids linking to deprecated/private function rb_enc(db)_alias().
17
-
18
-
19
- == v1.1.1 [2018-08-27] Michael Granger <ged@FaerieMUD.org>
20
-
21
- - Reduce deprecation warnings to only one message per deprecation.
22
-
23
-
24
- == v1.1.0 [2018-08-24] Michael Granger <ged@FaerieMUD.org>
25
-
26
- Deprecated (disable warnings per PG_SKIP_DEPRECATION_WARNING=1):
27
- - Forwarding conn.exec to conn.exec_params is deprecated.
28
- - Forwarding conn.exec_params to conn.exec is deprecated.
29
- - Forwarding conn.async_exec to conn.async_exec_params.
30
- - Forwarding conn.send_query to conn.send_query_params is deprecated.
31
- - Forwarding conn.async_exec_params to conn.async_exec is deprecated.
32
-
33
- PG::Connection enhancements:
34
- - Provide PG::Connection#sync_* and PG::Connection#async_* query methods for explicit calling syncronous or asynchronous libpq API.
35
- - Make PG::Connection#exec and siblings switchable between sync and async API per PG::Connection.async_api= and change the default to async flavors.
36
- - Add async flavors of exec_params, prepare, exec_prepared, describe_prepared and describe_portal.
37
- They are identical to their syncronous counterpart, but make use of PostgreSQL's async API.
38
- - Replace `rb_thread_fd_select()` by faster `rb_wait_for_single_fd()` in `conn.block` and `conn.async_exec` .
39
- - Add PG::Connection#discard_results .
40
- - 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.
41
-
42
- Result retrieval enhancements:
43
- - Add PG::Result#tuple_values to retrieve all field values of a row as array.
44
- - Add PG::Tuple, PG::Result#tuple and PG::Result#stream_each_tuple .
45
- PG::Tuple offers a way to lazy cast result values.
46
- - Estimate PG::Result size allocated by libpq and notify the garbage collector about it when running on Ruby-2.4 or newer.
47
- - Make the estimated PG::Result size available to ObjectSpace.memsize_of(result) .
48
-
49
- Type cast enhancements:
50
- - Replace Ruby code by a faster C implementation of the SimpleDecoder's timestamp decode functions. github #20
51
- - Interpret years with up to 7 digists and BC dates by timestamp decoder.
52
- - Add text timestamp decoders for UTC vs. local timezone variations.
53
- - Add text timestamp encoders for UTC timezone.
54
- - Add decoders for binary timestamps: PG::BinaryDecoder::Timestamp and variations.
55
- - Add PG::Coder#flags accessor to allow modifications of de- respectively encoder behaviour.
56
- - Add a flag to raise TypeError for invalid input values to PG::TextDecoder::Array .
57
- - Add a text decoder for inet/cidr written in C.
58
- - Add a numeric decoder written in C.
59
- - Ensure input text is zero terminated for text format in PG::Coder#decode .
60
-
61
- Source code enhancements:
62
- - Fix headers and permission bits of various repository files.
63
-
64
- Bugfixes:
65
- - Properly decode array with prepended dimensions. #272
66
- For now dimension decorations are ignored, but a correct Array is returned.
67
- - Array-Decoder: Avoid leaking memory when an Exception is raised while parsing. Fixes #279
68
-
69
-
70
- == v1.0.0 [2018-01-10] Michael Granger <ged@FaerieMUD.org>
71
-
72
- Deprecated:
73
- - Deprecate Ruby older than 2.2.
74
- - Deprecate Connection#socket in favor of #socket_io.
75
-
76
- Removed:
77
- - Remove compatibility code for Ruby < 2.0 and PostgreSQL < 9.2.
78
- - Remove partial compatibility with Rubinius.
79
- - Remove top-level constants PGconn, PGresult, and PGError.
80
-
81
- Enhancements:
82
- - Update error codes to PostgreSQL-10
83
- - Update Windows binary gems to Ruby-2.5, PostgreSQL 10.1 and
84
- OpenSSL 1.1.0g.
85
-
86
- Bugfixes:
87
- - Fix URI detection for connection strings. #265 (thanks to jjoos)
88
- - MINGW: Workaround segfault due to GCC linker error in conjunction with MSVC.
89
- This happens when linking to PostgreSQL-10.0-x64 from EnterpriseDB.
90
-
91
- Documentation fixes:
92
- - Add PostgreSQL version since when the given function is supported. #263
93
- - Better documentation to `encoder` and `decoder` arguments of COPY related methods.
94
-
95
-
96
- == v0.21.0 [2017-06-12] Michael Granger <ged@FaerieMUD.org>
97
-
98
- Enhancements:
99
- - Move add_dll_directory to the Runtime namespace for newest versions
100
- of RubyInstaller.
101
- - Deprecate PGconn, PGresult, and PGError top-level constants; a warning
102
- will be output the first time one of them is used. They will be
103
- removed in the upcoming 1.0 release.
104
-
105
- Documentation fixes:
106
- - Update the docs for PG::Result#cmd_tuples
107
-
108
- New Samples:
109
- - Add an example of the nicer #copy_data way of doing `COPY`.
110
-
111
-
112
- == v0.20.0 [2017-03-10] Michael Granger <ged@FaerieMUD.org>
113
-
114
- Enhancements:
115
- - Update error codes to PostgreSQL-9.6
116
- - Update Windows binary gems to Ruby-2.4, PostgreSQL 9.6.1 and
117
- OpenSSL 1.0.2j.
118
- - Add support for RubyInstaller2 to Windows binary gems.
119
-
120
- Bugfixes:
121
- - Use secure JSON methods for JSON (de)serialisation. #248
122
- - Fix Result#inspect on a cleared result.
123
- - Fix test case that failed on Ruby-2.4. #255
124
-
125
- Documentation fixes:
126
- - Talk about Integer instead of Fixnum.
127
- - Fix method signature of Coder#encode.
128
-
129
-
130
- == v0.19.0 [2016-09-21] Michael Granger <ged@FaerieMUD.org>
131
-
132
- - Deprecate Ruby 1.9
133
-
134
- Enhancements:
135
- - Respect and convert character encoding of all strings sent
136
- to the server. #231
137
- - Add PostgreSQL-9.5 functions PQsslInUse(), PQsslAttribute()
138
- and PQsslAttributeNames().
139
- - Various documentation fixes and improvements.
140
- - Add mechanism to build without pg_config:
141
- gem install pg -- --with-pg-config=ignore
142
- - Update Windows binary gems to Ruby-2.3, PostgreSQL 9.5.4 and
143
- OpenSSL 1.0.2f.
144
- - Add JSON coders and add them to BasicTypeMapForResults and
145
- BasicTypeMapBasedOnResult
146
- - Allow build from git per bundler.
147
-
148
- Bugfixes:
149
- - Release GVL while calling PQsetClientEncoding(). #245
150
- - Add __EXTENSIONS__ to Solaris/SmartOS for Ruby >= 2.3.x. #236
151
- - Fix wrong exception when running SQL while in Connection#copy_data
152
- block for output
153
-
154
-
155
- == v0.18.4 [2015-11-13] Michael Granger <ged@FaerieMUD.org>
156
-
157
- Enhancements:
158
- - Fixing compilation problems with Microsoft Visual Studio 2008. GH #10
159
- - Avoid name clash with xcode and jemalloc. PR#22, PR#23
160
-
161
- Bugfixes:
162
- - Avoid segfault, when quote_ident or TextEncoder::Identifier
163
- is called with Array containing non-strings. #226
164
-
165
-
166
- == v0.18.3 [2015-09-03] Michael Granger <ged@FaerieMUD.org>
167
-
168
- Enhancements:
169
- - Use rake-compiler-dock to build windows gems easily.
170
- - Add CI-tests on appveyor and fix test cases accordingly.
171
-
172
- Bugfixes:
173
- - Fix data type resulting in wrong base64 encoding.
174
- - Change instance_of checks to kind_of for subclassing. #220
175
- - TextDecoder::Date returns an actual Ruby Date instead of a Time
176
- (thanks to Thomas Ramfjord)
177
-
178
-
179
- == v0.18.2 [2015-05-14] Michael Granger <ged@FaerieMUD.org>
180
-
181
- Enhancements:
182
-
183
- - Allow URI connection string (thanks to Chris Bandy)
184
- - Allow Array type parameter to conn.quote_ident
185
-
186
- Bugfixes:
187
-
188
- - Speedups and fixes for PG::TextDecoder::Identifier and quoting behavior
189
- - Revert addition of PG::Connection#hostaddr [#202].
190
- - Fix decoding of fractional timezones and timestamps [#203]
191
- - Fixes for non-C99 compilers
192
- - Avoid possible symbol name clash when linking againt static libpq.
193
-
194
-
195
- == v0.18.1 [2015-01-05] Michael Granger <ged@FaerieMUD.org>
196
-
197
- Correct the minimum compatible Ruby version to 1.9.3. #199
198
-
199
-
200
- == v0.18.0 [2015-01-01] Michael Granger <ged@FaerieMUD.org>
201
-
202
- Bugfixes:
203
- - Fix OID to Integer mapping (it is unsigned now). #187
204
- - Fix possible segfault in conjunction with notice receiver. #185
205
-
206
- Enhancements:
207
-
208
- - Add an extensible type cast system.
209
- - A lot of performance improvements.
210
- - Return frozen String objects for result field names.
211
- - Add PG::Result#stream_each and #stream_each_row as fast helpers for
212
- the single row mode.
213
- - Add Enumerator variant to PG::Result#each and #each_row.
214
- - Add PG::Connection#conninfo and #hostaddr.
215
- - Add PG.init_openssl and PG.init_ssl methods.
216
- - Add PG::Result.inspect
217
- - Force zero termination for all text strings that are given to libpq.
218
- It raises an ArgumentError if the string contains a null byte.
219
- - Update Windows cross build to PostgreSQL 9.3.
220
-
221
-
222
-
223
- == v0.17.1 [2013-12-18] Michael Granger <ged@FaerieMUD.org>
224
-
225
- Bugfixes:
226
-
227
- - Fix compatibility with signal handlers defined in Ruby. This reverts
228
- cancelation of queries running on top of the blocking libpq API (like
229
- Connection#exec) in case of signals. As an alternative the #async_exec
230
- can be used, which is reverted to use the non-blocking API, again.
231
- - Wrap PQcancel to be called without GVL. It internally waits for
232
- the canceling connection.
233
-
234
- Documentation fixes:
235
-
236
- - Fix documentation for PG::Connection::conndefaults.
237
-
238
-
239
- == v0.17.0 [2013-09-15] Michael Granger <ged@FaerieMUD.org>
240
-
241
- Bugfixes:
242
-
243
- - Fix crash by calling PQsend* and PQisBusy without GVL (#171).
244
-
245
- Enhancements:
246
-
247
- - Add method PG::Connection#copy_data.
248
- - Add a Gemfile to allow installation of dependencies with bundler.
249
- - Add compatibility with rake-compiler-dev-box.
250
- - Return self from PG::Result#check instead of nil. This allows
251
- to stack method calls.
252
-
253
-
254
- == v0.16.0 [2013-07-22] Michael Granger <ged@FaerieMUD.org>
255
-
256
- Bugfixes:
257
-
258
- - Avoid warnings about uninitialized instance variables.
259
- - Use a more standard method of adding library and include directories.
260
- This fixes build on AIX (Github #7) and Solaris (#164).
261
- - Cancel the running query, if a thread is about to be killed (e.g. by CTRL-C).
262
- - Fix GVL issue with wait_for_notify/notifies and notice callbacks.
263
- - Set proper encoding on the string returned by quote_ident, escape_literal
264
- and escape_identifier (#163).
265
- - Use nil as PG::Error#result in case of a NULL-result from libpq (#166).
266
- - Recalculate the timeout of conn#wait_for_notify and conn#block in case
267
- of socket events that require re-runs of select().
268
-
269
- Documentation fixes:
270
-
271
- - Fix non working example for PGresult#error_field.
272
-
273
- Enhancements:
274
-
275
- - Add unique exception classes for each PostgreSQL error type (#5).
276
- - Return result of the block in conn#transaction instead of nil (#158).
277
- - Allow 'rake compile' and 'rake gem' on non mercurial repos.
278
- - Add support for PG_DIAG_*_NAME error fields of PostgreSQL-9.3 (#161).
279
-
280
-
281
- == v0.15.1 [2013-04-08] Michael Granger <ged@FaerieMUD.org>
282
-
283
- Bugfixes:
284
-
285
- - Shorten application_name to avoid warnings about truncated identifier.
286
-
287
-
288
- == v0.15.0 [2013-03-03] Michael Granger <ged@FaerieMUD.org>
289
-
290
- Bugfixes:
291
-
292
- - Fix segfault in PG::Result#field_values when called with non String value.
293
- - Fix encoding of messages delivered by notice callbacks.
294
- - Fix text encoding for Connection#wait_for_notify and Connection#notifies.
295
- - Fix 'Bad file descriptor' problems under Windows: wrong behaviour of
296
- #wait_for_notify() and timeout handling of #block on Ruby 1.9.
297
-
298
- Documentation fixes:
299
-
300
- - conn#socket() can not be used with IO.for_fd() on Windows.
301
-
302
- Enhancements:
303
-
304
- - Tested under Ruby 2.0.0p0.
305
- - Add single row mode of PostgreSQL 9.2.
306
- - Set fallback_application_name to programm name $0. Thanks to Will Leinweber
307
- for the patch.
308
- - Release Ruby's GVL while calls to blocking libpq functions to allow better
309
- concurrency in threaded applications.
310
- - Refactor different variants of waiting for the connection socket.
311
- - Make use of rb_thread_fd_select() on Ruby 1.9 and avoid deprecated
312
- rb_thread_select().
313
- - Add an example of how to insert array data using a prepared statement (#145).
314
- - Add continous integration tests on travis-ci.org.
315
- - Add PG::Result#each_row for iterative over result sets by row. Thanks to
316
- Aaron Patterson for the patch.
317
- - Add a PG::Connection#socket_io method for fetching a (non-autoclosing) IO
318
- object for the connection's socket.
319
-
320
- Specs:
321
-
322
- - Fix various specs to run on older PostgreSQL and Ruby versions.
323
- - Avoid fork() in specs to allow usage on Windows and JRuby.
324
-
325
-
326
- == v0.14.1 [2012-09-02] Michael Granger <ged@FaerieMUD.org>
327
-
328
- Important bugfix:
329
-
330
- - Fix stack overflow bug in PG::Result#values and #column_values (#135). Thanks
331
- to everyone who reported the bug, and Lars Kanis especially for figuring out
332
- the problem.
333
-
334
- PostgreSQL 9.2 beta fixes:
335
-
336
- - Recognize PGRES_SINGLE_TUPLE as OK when checking PGresult (Jeremy Evans)
337
-
338
- Documentation fixes:
339
-
340
- - Add note about the usage scope of the result object received by the
341
- #set_notice_receiver block. (Lars Kanis)
342
- - Add PGRES_COPY_BOTH to documentation of PG::Result#result_status. (Lars Kanis)
343
- - Add some documentation to PG::Result#fnumber (fix for #139)
344
-
345
-
346
- == v0.14.0 [2012-06-17] Michael Granger <ged@FaerieMUD.org>
347
-
348
- Bugfixes:
349
- #47, #104
350
-
351
-
352
- New Methods for PostgreSQL 9 and async API support:
353
- PG
354
- - ::library_version
355
-
356
- PG::Connection
357
- - ::ping
358
- - #escape_literal
359
- - #escape_identifier
360
- - #set_default_encoding
361
-
362
- PG::Result
363
- - #check
364
-
365
-
366
- New Samples:
367
-
368
- This release also comes with a collection of contributed sample scripts for
369
- doing resource-utilization reports, graphing database statistics,
370
- monitoring for replication lag, shipping WAL files for replication,
371
- automated tablespace partitioning, etc. See the samples/ directory.
372
-
373
-
374
- == v0.13.2 [2012-02-22] Michael Granger <ged@FaerieMUD.org>
375
-
376
- - Make builds against PostgreSQL earlier than 8.3 fail with a descriptive
377
- message instead of a compile failure.
378
-
379
-
380
- == v0.13.1 [2012-02-12] Michael Granger <ged@FaerieMUD.org>
381
-
382
- - Made use of a finished PG::Connection raise a PG::Error instead of
383
- a fatal error (#110).
384
- - Added missing BSDL license file (#108)
385
-
386
-
387
- == v0.13.0 [2012-02-09] Michael Granger <ged@FaerieMUD.org>
388
-
389
- Reorganization of modules/classes to be better Ruby citizens (with backward-compatible aliases):
390
- - Created toplevel namespace 'PG' to correspond with the gem name.
391
- - Renamed PGconn to PG::Connection (with ::PGconn alias)
392
- - Renamed PGresult to PG::Result (with ::PGresult alias)
393
- - Renamed PGError to PG::Error (with ::PGError alias)
394
- - Declare all constants inside PG::Constants, then include them in
395
- PG::Connection and PG::Result for backward-compatibility, and
396
- in PG for convenience.
397
- - Split the extension source up by class/module.
398
- - Removed old compatibility code for PostgreSQL versions < 8.3
399
-
400
- Documentation:
401
- - Clarified licensing, updated to Ruby 1.9's license.
402
- - Merged authors list, added some missing people to the Contributor's
403
- list.
404
- - Cleaned up the sample/ directory
405
- - Making contact info a bit clearer, link to the Google+ page and
406
- the mailing list
407
-
408
- Enhancements:
409
- - Added a convenience method: PG.connect -> PG::Connection.new
410
-
411
- Bugfixes:
412
- - Fixed LATIN5-LATIN10 Postgres<->Ruby encoding conversions
413
-
414
-
415
-
416
- == v0.12.2 [2012-01-03] Michael Granger <ged@FaerieMUD.org>
417
-
418
- - Fix for the 1.8.7 breakage introduced by the st.h fix for alternative Ruby
419
- implementations (#97 and #98). Thanks to Lars Kanis for the patch.
420
- - Encode error messages with the connection's encoding under 1.9 (#96)
421
-
422
-
423
- == v0.12.1 [2011-12-14] Michael Granger <ged@FaerieMUD.org>
424
-
425
- - Made rake-compiler a dev dependency, as Rubygems doesn't use the Rakefile
426
- for compiling the extension. Thanks to eolamey@bitbucket and Jeremy Evans
427
- for pointing this out.
428
- - Added an explicit include for ruby/st.h for implementations that need it
429
- (fixes #95).
430
-
431
-
432
- == v0.12.0 [2011-12-07] Michael Granger <ged@FaerieMUD.org>
433
-
434
- - PGconn#wait_for_notify
435
- * send nil as the payload argument if the NOTIFY didn't have one.
436
- * accept a nil argument for no timeout (Sequel support)
437
- * Fixed API docs
438
- * Taint and encode event name and payload
439
- - Handle errors while rb_thread_select()ing in PGconn#block.
440
- (Brian Weaver).
441
- - Fixes for Win32 async queries (Rafał Bigaj)
442
- - Memory leak fixed: Closing opened WSA event. (rafal)
443
- - Fixes for #66 Win32 asynchronous queries hang on connection
444
- error. (rafal)
445
- - Fixed a typo in PGconn#error_message's documentation
446
- - fixing unused variable warnings for ruby 1.9.3 (Aaron Patterson)
447
- - Build system bugfixes
448
- - Converted to Hoe
449
- - Updates for the Win32 binary gem builds (Lars Kanis)
450
-
451
-
452
- == v0.11.0 [2011-02-09] Michael Granger <ged@FaerieMUD.org>
453
-
454
- Enhancements:
455
-
456
- * Added a PGresult#values method to fetch all result rows as an Array of
457
- Arrays. Thanks to Jason Yanowitz (JYanowitz at enovafinancial dot com) for
458
- the patch.
459
-
460
-
461
- == v0.10.1 [2011-01-19] Michael Granger <ged@FaerieMUD.org>
462
-
463
- Bugfixes:
464
-
465
- * Add an include guard for pg.h
466
- * Simplify the common case require of the ext
467
- * Include the extconf header
468
- * Fix compatibility with versions of PostgreSQL without PQgetCancel. (fixes #36)
469
- * Fix require for natively-compiled extension under Windows. (fixes #55)
470
- * Change rb_yield_splat() to rb_yield_values() for compatibility with Rubinius. (fixes #54)
471
-
472
-
473
- == v0.10.0 [2010-12-01] Michael Granger <ged@FaerieMUD.org>
474
-
475
- Enhancements:
476
-
477
- * Added support for the payload of NOTIFY events (w/Mahlon E. Smith)
478
- * Updated the build system with Rubygems suggestions from RubyConf 2010
479
-
480
- Bugfixes:
481
-
482
- * Fixed issue with PGconn#wait_for_notify that caused it to miss notifications that happened after
483
- the LISTEN but before the wait_for_notify.
484
-
485
- == v0.9.0 [2010-02-28] Michael Granger <ged@FaerieMUD.org>
486
-
487
- Bugfixes.
488
-
489
- == v0.8.0 [2009-03-28] Jeff Davis <davis.jeffrey@gmail.com>
490
-
491
- Bugfixes, better Windows support.
492
-
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.