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