pg 0.15.0.pre.454-x64-mingw32
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.
- data.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- data/BSDL +22 -0
- data/ChangeLog +2945 -0
- data/Contributors.rdoc +46 -0
- data/History.rdoc +205 -0
- data/LICENSE +56 -0
- data/Manifest.txt +53 -0
- data/POSTGRES +23 -0
- data/README-OS_X.rdoc +68 -0
- data/README-Windows.rdoc +67 -0
- data/README.ja.rdoc +14 -0
- data/README.rdoc +111 -0
- data/Rakefile +156 -0
- data/Rakefile.cross +271 -0
- data/ext/extconf.rb +91 -0
- data/ext/gvl_wrappers.c +13 -0
- data/ext/gvl_wrappers.h +185 -0
- data/ext/pg.c +525 -0
- data/ext/pg.h +126 -0
- data/ext/pg_connection.c +3600 -0
- data/ext/pg_result.c +939 -0
- data/ext/vc/pg.sln +26 -0
- data/ext/vc/pg_18/pg.vcproj +216 -0
- data/ext/vc/pg_19/pg_19.vcproj +209 -0
- data/lib/2.0/pg_ext.so +0 -0
- data/lib/pg.rb +52 -0
- data/lib/pg/connection.rb +71 -0
- data/lib/pg/constants.rb +11 -0
- data/lib/pg/exceptions.rb +11 -0
- data/lib/pg/result.rb +16 -0
- data/sample/array_insert.rb +20 -0
- data/sample/async_api.rb +106 -0
- data/sample/async_copyto.rb +39 -0
- data/sample/async_mixed.rb +56 -0
- data/sample/check_conn.rb +21 -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 +186 -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 +294 -0
- data/sample/replication_monitor.rb +231 -0
- data/sample/test_binary_values.rb +33 -0
- data/sample/wal_shipper.rb +434 -0
- data/sample/warehouse_partitions.rb +320 -0
- data/spec/data/expected_trace.out +26 -0
- data/spec/data/random_binary_data +0 -0
- data/spec/lib/helpers.rb +279 -0
- data/spec/pg/connection_spec.rb +1013 -0
- data/spec/pg/result_spec.rb +278 -0
- data/spec/pg_spec.rb +31 -0
- metadata +275 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,278 @@
|
|
1
|
+
#!/usr/bin/env rspec
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
BEGIN {
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
basedir = Pathname( __FILE__ ).dirname.parent.parent
|
8
|
+
libdir = basedir + 'lib'
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
|
11
|
+
$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
|
12
|
+
}
|
13
|
+
|
14
|
+
require 'rspec'
|
15
|
+
require 'spec/lib/helpers'
|
16
|
+
require 'pg'
|
17
|
+
|
18
|
+
describe PG::Result do
|
19
|
+
|
20
|
+
before( :all ) do
|
21
|
+
@conn = setup_testing_db( "PG_Result" )
|
22
|
+
end
|
23
|
+
|
24
|
+
before( :each ) do
|
25
|
+
@conn.exec( 'BEGIN' )
|
26
|
+
end
|
27
|
+
|
28
|
+
after( :each ) do
|
29
|
+
@conn.exec( 'ROLLBACK' )
|
30
|
+
end
|
31
|
+
|
32
|
+
after( :all ) do
|
33
|
+
teardown_testing_db( @conn )
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
#
|
38
|
+
# Examples
|
39
|
+
#
|
40
|
+
|
41
|
+
it "should act as an array of hashes" do
|
42
|
+
res = @conn.exec("SELECT 1 AS a, 2 AS b")
|
43
|
+
res[0]['a'].should== '1'
|
44
|
+
res[0]['b'].should== '2'
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should yield a row as an array" do
|
48
|
+
res = @conn.exec("SELECT 1 AS a, 2 AS b")
|
49
|
+
list = []
|
50
|
+
res.each_row { |r| list << r }
|
51
|
+
list.should eq [['1', '2']]
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should insert nil AS NULL and return NULL as nil" do
|
55
|
+
res = @conn.exec("SELECT $1::int AS n", [nil])
|
56
|
+
res[0]['n'].should be_nil()
|
57
|
+
end
|
58
|
+
|
59
|
+
it "encapsulates errors in a PGError object" do
|
60
|
+
exception = nil
|
61
|
+
begin
|
62
|
+
@conn.exec( "SELECT * FROM nonexistant_table" )
|
63
|
+
rescue PGError => err
|
64
|
+
exception = err
|
65
|
+
end
|
66
|
+
|
67
|
+
result = exception.result
|
68
|
+
|
69
|
+
result.should be_a( described_class() )
|
70
|
+
result.error_field( PG::PG_DIAG_SEVERITY ).should == 'ERROR'
|
71
|
+
result.error_field( PG::PG_DIAG_SQLSTATE ).should == '42P01'
|
72
|
+
result.error_field( PG::PG_DIAG_MESSAGE_PRIMARY ).
|
73
|
+
should == 'relation "nonexistant_table" does not exist'
|
74
|
+
result.error_field( PG::PG_DIAG_MESSAGE_DETAIL ).should be_nil()
|
75
|
+
result.error_field( PG::PG_DIAG_MESSAGE_HINT ).should be_nil()
|
76
|
+
statement_pos = RSpec.configuration.exclusion_filter[:postgresql_90] ? nil : '15'
|
77
|
+
result.error_field( PG::PG_DIAG_STATEMENT_POSITION ).should == statement_pos
|
78
|
+
result.error_field( PG::PG_DIAG_INTERNAL_POSITION ).should be_nil()
|
79
|
+
result.error_field( PG::PG_DIAG_INTERNAL_QUERY ).should be_nil()
|
80
|
+
result.error_field( PG::PG_DIAG_CONTEXT ).should be_nil()
|
81
|
+
result.error_field( PG::PG_DIAG_SOURCE_FILE ).should =~ /parse_relation\.c$|namespace\.c$/
|
82
|
+
result.error_field( PG::PG_DIAG_SOURCE_LINE ).should =~ /^\d+$/
|
83
|
+
result.error_field( PG::PG_DIAG_SOURCE_FUNCTION ).should =~ /^parserOpenTable$|^RangeVarGetRelid$/
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should detect division by zero as SQLSTATE 22012" do
|
88
|
+
sqlstate = nil
|
89
|
+
begin
|
90
|
+
res = @conn.exec("SELECT 1/0")
|
91
|
+
rescue PGError => e
|
92
|
+
sqlstate = e.result.result_error_field( PG::PG_DIAG_SQLSTATE ).to_i
|
93
|
+
end
|
94
|
+
sqlstate.should == 22012
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should return the same bytes in binary format that are sent in binary format" do
|
98
|
+
binary_file = File.join(Dir.pwd, 'spec/data', 'random_binary_data')
|
99
|
+
bytes = File.open(binary_file, 'rb').read
|
100
|
+
res = @conn.exec('VALUES ($1::bytea)',
|
101
|
+
[ { :value => bytes, :format => 1 } ], 1)
|
102
|
+
res[0]['column1'].should== bytes
|
103
|
+
res.getvalue(0,0).should == bytes
|
104
|
+
res.values[0][0].should == bytes
|
105
|
+
res.column_values(0)[0].should == bytes
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should return the same bytes in binary format that are sent as inline text" do
|
109
|
+
binary_file = File.join(Dir.pwd, 'spec/data', 'random_binary_data')
|
110
|
+
bytes = File.open(binary_file, 'rb').read
|
111
|
+
@conn.exec("SET standard_conforming_strings=on")
|
112
|
+
res = @conn.exec("VALUES ('#{PG::Connection.escape_bytea(bytes)}'::bytea)", [], 1)
|
113
|
+
res[0]['column1'].should == bytes
|
114
|
+
res.getvalue(0,0).should == bytes
|
115
|
+
res.values[0][0].should == bytes
|
116
|
+
res.column_values(0)[0].should == bytes
|
117
|
+
end
|
118
|
+
|
119
|
+
it "should return the same bytes in text format that are sent in binary format" do
|
120
|
+
binary_file = File.join(Dir.pwd, 'spec/data', 'random_binary_data')
|
121
|
+
bytes = File.open(binary_file, 'rb').read
|
122
|
+
res = @conn.exec('VALUES ($1::bytea)',
|
123
|
+
[ { :value => bytes, :format => 1 } ])
|
124
|
+
PG::Connection.unescape_bytea(res[0]['column1']).should== bytes
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should return the same bytes in text format that are sent as inline text" do
|
128
|
+
binary_file = File.join(Dir.pwd, 'spec/data', 'random_binary_data')
|
129
|
+
in_bytes = File.open(binary_file, 'rb').read
|
130
|
+
|
131
|
+
out_bytes = nil
|
132
|
+
@conn.exec("SET standard_conforming_strings=on")
|
133
|
+
res = @conn.exec("VALUES ('#{PG::Connection.escape_bytea(in_bytes)}'::bytea)", [], 0)
|
134
|
+
out_bytes = PG::Connection.unescape_bytea(res[0]['column1'])
|
135
|
+
out_bytes.should == in_bytes
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should return the parameter type of the specified prepared statement parameter", :postgresql_92 do
|
139
|
+
query = 'SELECT * FROM pg_stat_activity WHERE user = $1::name AND query = $2::text'
|
140
|
+
@conn.prepare( 'queryfinder', query )
|
141
|
+
res = @conn.describe_prepared( 'queryfinder' )
|
142
|
+
|
143
|
+
@conn.exec( 'SELECT format_type($1, -1)', [res.paramtype(0)] ).getvalue( 0, 0 ).
|
144
|
+
should == 'name'
|
145
|
+
@conn.exec( 'SELECT format_type($1, -1)', [res.paramtype(1)] ).getvalue( 0, 0 ).
|
146
|
+
should == 'text'
|
147
|
+
end
|
148
|
+
|
149
|
+
it "should raise an exception when a negative index is given to #fformat" do
|
150
|
+
res = @conn.exec('SELECT * FROM pg_stat_activity')
|
151
|
+
expect {
|
152
|
+
res.fformat( -1 )
|
153
|
+
}.to raise_error( ArgumentError, /column number/i )
|
154
|
+
end
|
155
|
+
|
156
|
+
it "should raise an exception when a negative index is given to #fmod" do
|
157
|
+
res = @conn.exec('SELECT * FROM pg_stat_activity')
|
158
|
+
expect {
|
159
|
+
res.fmod( -1 )
|
160
|
+
}.to raise_error( ArgumentError, /column number/i )
|
161
|
+
end
|
162
|
+
|
163
|
+
it "should raise an exception when a negative index is given to #[]" do
|
164
|
+
res = @conn.exec('SELECT * FROM pg_stat_activity')
|
165
|
+
expect {
|
166
|
+
res[ -1 ]
|
167
|
+
}.to raise_error( IndexError, /-1 is out of range/i )
|
168
|
+
end
|
169
|
+
|
170
|
+
it "should raise allow for conversion to an array of arrays" do
|
171
|
+
@conn.exec( 'CREATE TABLE valuestest ( foo varchar(33) )' )
|
172
|
+
@conn.exec( 'INSERT INTO valuestest ("foo") values (\'bar\')' )
|
173
|
+
@conn.exec( 'INSERT INTO valuestest ("foo") values (\'bar2\')' )
|
174
|
+
|
175
|
+
res = @conn.exec( 'SELECT * FROM valuestest' )
|
176
|
+
res.values.should == [ ["bar"], ["bar2"] ]
|
177
|
+
end
|
178
|
+
|
179
|
+
# PQfmod
|
180
|
+
it "can return the type modifier for a result column" do
|
181
|
+
@conn.exec( 'CREATE TABLE fmodtest ( foo varchar(33) )' )
|
182
|
+
res = @conn.exec( 'SELECT * FROM fmodtest' )
|
183
|
+
res.fmod( 0 ).should == 33 + 4 # Column length + varlena size (4)
|
184
|
+
end
|
185
|
+
|
186
|
+
it "should raise an exception when an invalid index is passed to PG::Result#fmod" do
|
187
|
+
@conn.exec( 'CREATE TABLE fmodtest ( foo varchar(33) )' )
|
188
|
+
res = @conn.exec( 'SELECT * FROM fmodtest' )
|
189
|
+
expect { res.fmod(1) }.to raise_error( ArgumentError )
|
190
|
+
end
|
191
|
+
|
192
|
+
it "should raise an exception when an invalid (negative) index is passed to PG::Result#fmod" do
|
193
|
+
@conn.exec( 'CREATE TABLE fmodtest ( foo varchar(33) )' )
|
194
|
+
res = @conn.exec( 'SELECT * FROM fmodtest' )
|
195
|
+
expect { res.fmod(-11) }.to raise_error( ArgumentError )
|
196
|
+
end
|
197
|
+
|
198
|
+
it "shouldn't raise an exception when a valid index is passed to PG::Result#fmod for a column with no typemod" do
|
199
|
+
@conn.exec( 'CREATE TABLE fmodtest ( foo text )' )
|
200
|
+
res = @conn.exec( 'SELECT * FROM fmodtest' )
|
201
|
+
res.fmod( 0 ).should == -1 # and it shouldn't raise an exception, either
|
202
|
+
end
|
203
|
+
|
204
|
+
# PQftable
|
205
|
+
it "can return the oid of the table from which a result column was fetched" do
|
206
|
+
@conn.exec( 'CREATE TABLE ftabletest ( foo text )' )
|
207
|
+
res = @conn.exec( 'SELECT * FROM ftabletest' )
|
208
|
+
|
209
|
+
res.ftable( 0 ).should == be_nonzero()
|
210
|
+
end
|
211
|
+
|
212
|
+
it "should raise an exception when an invalid index is passed to PG::Result#ftable" do
|
213
|
+
@conn.exec( 'CREATE TABLE ftabletest ( foo text )' )
|
214
|
+
res = @conn.exec( 'SELECT * FROM ftabletest' )
|
215
|
+
|
216
|
+
expect { res.ftable(18) }.to raise_error( ArgumentError )
|
217
|
+
end
|
218
|
+
|
219
|
+
it "should raise an exception when an invalid (negative) index is passed to PG::Result#ftable" do
|
220
|
+
@conn.exec( 'CREATE TABLE ftabletest ( foo text )' )
|
221
|
+
res = @conn.exec( 'SELECT * FROM ftabletest' )
|
222
|
+
|
223
|
+
expect { res.ftable(-2) }.to raise_error( ArgumentError )
|
224
|
+
end
|
225
|
+
|
226
|
+
it "shouldn't raise an exception when a valid index is passed to PG::Result#ftable for a " +
|
227
|
+
"column with no corresponding table" do
|
228
|
+
@conn.exec( 'CREATE TABLE ftabletest ( foo text )' )
|
229
|
+
res = @conn.exec( 'SELECT foo, LENGTH(foo) as length FROM ftabletest' )
|
230
|
+
res.ftable( 1 ).should == PG::INVALID_OID # and it shouldn't raise an exception, either
|
231
|
+
end
|
232
|
+
|
233
|
+
# PQftablecol
|
234
|
+
it "can return the column number (within its table) of a column in a result" do
|
235
|
+
@conn.exec( 'CREATE TABLE ftablecoltest ( foo text, bar numeric )' )
|
236
|
+
res = @conn.exec( 'SELECT * FROM ftablecoltest' )
|
237
|
+
|
238
|
+
res.ftablecol( 0 ).should == 1
|
239
|
+
res.ftablecol( 1 ).should == 2
|
240
|
+
end
|
241
|
+
|
242
|
+
it "should raise an exception when an invalid index is passed to PG::Result#ftablecol" do
|
243
|
+
@conn.exec( 'CREATE TABLE ftablecoltest ( foo text, bar numeric )' )
|
244
|
+
res = @conn.exec( 'SELECT * FROM ftablecoltest' )
|
245
|
+
|
246
|
+
expect { res.ftablecol(32) }.to raise_error( ArgumentError )
|
247
|
+
end
|
248
|
+
|
249
|
+
it "should raise an exception when an invalid (negative) index is passed to PG::Result#ftablecol" do
|
250
|
+
@conn.exec( 'CREATE TABLE ftablecoltest ( foo text, bar numeric )' )
|
251
|
+
res = @conn.exec( 'SELECT * FROM ftablecoltest' )
|
252
|
+
|
253
|
+
expect { res.ftablecol(-1) }.to raise_error( ArgumentError )
|
254
|
+
end
|
255
|
+
|
256
|
+
it "shouldn't raise an exception when a valid index is passed to PG::Result#ftablecol for a " +
|
257
|
+
"column with no corresponding table" do
|
258
|
+
@conn.exec( 'CREATE TABLE ftablecoltest ( foo text )' )
|
259
|
+
res = @conn.exec( 'SELECT foo, LENGTH(foo) as length FROM ftablecoltest' )
|
260
|
+
res.ftablecol(1).should == 0 # and it shouldn't raise an exception, either
|
261
|
+
end
|
262
|
+
|
263
|
+
it "can be manually checked for failed result status (async API)" do
|
264
|
+
@conn.send_query( "SELECT * FROM nonexistant_table" )
|
265
|
+
res = @conn.get_result
|
266
|
+
expect {
|
267
|
+
res.check
|
268
|
+
}.to raise_error( PG::Error, /relation "nonexistant_table" does not exist/ )
|
269
|
+
end
|
270
|
+
|
271
|
+
it "can return the values of a single field" do
|
272
|
+
res = @conn.exec( "SELECT 1 AS x, 'a' AS y UNION ALL SELECT 2, 'b'" )
|
273
|
+
res.field_values( 'x' ).should == ['1', '2']
|
274
|
+
res.field_values( 'y' ).should == ['a', 'b']
|
275
|
+
expect{ res.field_values( '' ) }.to raise_error(IndexError)
|
276
|
+
expect{ res.field_values( :x ) }.to raise_error(TypeError)
|
277
|
+
end
|
278
|
+
end
|
data/spec/pg_spec.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env rspec
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
BEGIN {
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
basedir = Pathname( __FILE__ ).dirname.parent
|
8
|
+
libdir = basedir + 'lib'
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
|
11
|
+
$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
|
12
|
+
}
|
13
|
+
|
14
|
+
require 'rspec'
|
15
|
+
require 'spec/lib/helpers'
|
16
|
+
require 'pg'
|
17
|
+
|
18
|
+
describe PG do
|
19
|
+
|
20
|
+
it "knows what version of the libpq library is loaded", :postgresql_91 do
|
21
|
+
PG.library_version.should be_an( Integer )
|
22
|
+
PG.library_version.should >= 90100
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
it "knows whether or not the library is threadsafe" do
|
27
|
+
PG.should be_threadsafe()
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
metadata
ADDED
@@ -0,0 +1,275 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pg
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3700714167
|
5
|
+
prerelease: 7
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 15
|
9
|
+
- 0
|
10
|
+
- pre
|
11
|
+
- 454
|
12
|
+
version: 0.15.0.pre.454
|
13
|
+
platform: x64-mingw32
|
14
|
+
authors:
|
15
|
+
- Michael Granger
|
16
|
+
autorequire:
|
17
|
+
bindir: bin
|
18
|
+
cert_chain:
|
19
|
+
- |
|
20
|
+
-----BEGIN CERTIFICATE-----
|
21
|
+
MIIDPDCCAiSgAwIBAgIBADANBgkqhkiG9w0BAQUFADBEMQ0wCwYDVQQDDARsYXJz
|
22
|
+
MR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZImiZPyLGQB
|
23
|
+
GRYCZGUwHhcNMTMwMzExMjAyMjIyWhcNMTQwMzExMjAyMjIyWjBEMQ0wCwYDVQQD
|
24
|
+
DARsYXJzMR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZIm
|
25
|
+
iZPyLGQBGRYCZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb4Uv
|
26
|
+
RFJfRu/VEWiy3psh2jinETjiuBrL0NeRFGf8H7iU9+gx/DI/FFhfHGLrDeIskrJx
|
27
|
+
YIWDMmEjVO10UUdj7wu4ZhmU++0Cd7Kq9/TyP/shIP3IjqHjVLCnJ3P6f1cl5rxZ
|
28
|
+
gqo+d3BAoDrmPk0rtaf6QopwUw9RBiF8V4HqvpiY+ruJotP5UQDP4/lVOKvA8PI9
|
29
|
+
P0GmVbFBrbc7Zt5h78N3UyOK0u+nvOC23BvyHXzCtcFsXCoEkt+Wwh0RFqVZdnjM
|
30
|
+
LMO2vULHKKHDdX54K/sbVCj9pN9h1aotNzrEyo55zxn0G9PHg/G3P8nMvAXPkUTe
|
31
|
+
brhXrfCwWRvOXA4TAgMBAAGjOTA3MAsGA1UdDwQEAwIEsDAJBgNVHRMEAjAAMB0G
|
32
|
+
A1UdDgQWBBRAHK81igrXodaDj8a8/BIKsaZrETANBgkqhkiG9w0BAQUFAAOCAQEA
|
33
|
+
Iswhcol3ytXthaUH3k5LopZ09viZrZHzAw0QleI3Opl/9QEGJ2BPV9+93iC0OrNL
|
34
|
+
hmnxig6vKK1EeJ5PHXJ8hOI3nTZBrOmQcEXNBqyToP1FHMWZqwZ8wiBPXtiCqDBR
|
35
|
+
ePQ25J9xFNzQ1ItgzNSpx5cs67QNKrx5woocoBHD6kStFbshZPJx4axl3GbUFQd5
|
36
|
+
H//3YdPQOH3jaVeUXhS+pz/gfbx8fhFAtsQ+855A3HO7g2ZRIg/atAp/0MFyn5s5
|
37
|
+
0rq+VHOIPyvxF5khT0mYAcNmZTC8z1yPsqdgwfYNDjsSWwiIRSPUSmJRvfjM8hsW
|
38
|
+
mMFp4kPUHbWOqCp2mz9gCA==
|
39
|
+
-----END CERTIFICATE-----
|
40
|
+
|
41
|
+
date: 2013-03-15 00:00:00 Z
|
42
|
+
dependencies:
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: hoe-mercurial
|
45
|
+
prerelease: false
|
46
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ~>
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
hash: 7
|
52
|
+
segments:
|
53
|
+
- 1
|
54
|
+
- 4
|
55
|
+
- 0
|
56
|
+
version: 1.4.0
|
57
|
+
type: :development
|
58
|
+
version_requirements: *id001
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: hoe-highline
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
hash: 27
|
68
|
+
segments:
|
69
|
+
- 0
|
70
|
+
- 1
|
71
|
+
- 0
|
72
|
+
version: 0.1.0
|
73
|
+
type: :development
|
74
|
+
version_requirements: *id002
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rdoc
|
77
|
+
prerelease: false
|
78
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
hash: 19
|
84
|
+
segments:
|
85
|
+
- 3
|
86
|
+
- 10
|
87
|
+
version: "3.10"
|
88
|
+
type: :development
|
89
|
+
version_requirements: *id003
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: rake-compiler
|
92
|
+
prerelease: false
|
93
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ~>
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
hash: 27
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
- 8
|
102
|
+
version: "0.8"
|
103
|
+
type: :development
|
104
|
+
version_requirements: *id004
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
name: hoe-deveiate
|
107
|
+
prerelease: false
|
108
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - ~>
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
hash: 15
|
114
|
+
segments:
|
115
|
+
- 0
|
116
|
+
- 2
|
117
|
+
version: "0.2"
|
118
|
+
type: :development
|
119
|
+
version_requirements: *id005
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
name: hoe
|
122
|
+
prerelease: false
|
123
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ~>
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: 7
|
129
|
+
segments:
|
130
|
+
- 3
|
131
|
+
- 0
|
132
|
+
version: "3.0"
|
133
|
+
type: :development
|
134
|
+
version_requirements: *id006
|
135
|
+
description: |-
|
136
|
+
Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/].
|
137
|
+
|
138
|
+
It works with {PostgreSQL 8.3 and later}[http://bit.ly/6AfPhm].
|
139
|
+
|
140
|
+
A small example usage:
|
141
|
+
|
142
|
+
#!/usr/bin/env ruby
|
143
|
+
|
144
|
+
require 'pg'
|
145
|
+
|
146
|
+
# Output a table of current connections to the DB
|
147
|
+
conn = PG.connect( dbname: 'sales' )
|
148
|
+
conn.exec( "SELECT * FROM pg_stat_activity" ) do |result|
|
149
|
+
puts " PID | User | Query"
|
150
|
+
result.each do |row|
|
151
|
+
puts " %7d | %-16s | %s " %
|
152
|
+
row.values_at('procpid', 'usename', 'current_query')
|
153
|
+
end
|
154
|
+
end
|
155
|
+
email:
|
156
|
+
- ged@FaerieMUD.org
|
157
|
+
executables: []
|
158
|
+
|
159
|
+
extensions: []
|
160
|
+
|
161
|
+
extra_rdoc_files:
|
162
|
+
- Contributors.rdoc
|
163
|
+
- History.rdoc
|
164
|
+
- Manifest.txt
|
165
|
+
- README-OS_X.rdoc
|
166
|
+
- README-Windows.rdoc
|
167
|
+
- README.ja.rdoc
|
168
|
+
- README.rdoc
|
169
|
+
- POSTGRES
|
170
|
+
- LICENSE
|
171
|
+
- ext/pg_connection.c
|
172
|
+
- ext/pg.c
|
173
|
+
- ext/gvl_wrappers.c
|
174
|
+
- ext/pg_result.c
|
175
|
+
files:
|
176
|
+
- .gemtest
|
177
|
+
- BSDL
|
178
|
+
- ChangeLog
|
179
|
+
- Contributors.rdoc
|
180
|
+
- History.rdoc
|
181
|
+
- LICENSE
|
182
|
+
- Manifest.txt
|
183
|
+
- POSTGRES
|
184
|
+
- README-OS_X.rdoc
|
185
|
+
- README-Windows.rdoc
|
186
|
+
- README.ja.rdoc
|
187
|
+
- README.rdoc
|
188
|
+
- Rakefile
|
189
|
+
- Rakefile.cross
|
190
|
+
- ext/extconf.rb
|
191
|
+
- ext/gvl_wrappers.c
|
192
|
+
- ext/gvl_wrappers.h
|
193
|
+
- ext/pg.c
|
194
|
+
- ext/pg.h
|
195
|
+
- ext/pg_connection.c
|
196
|
+
- ext/pg_result.c
|
197
|
+
- ext/vc/pg.sln
|
198
|
+
- ext/vc/pg_18/pg.vcproj
|
199
|
+
- ext/vc/pg_19/pg_19.vcproj
|
200
|
+
- lib/pg.rb
|
201
|
+
- lib/pg/connection.rb
|
202
|
+
- lib/pg/constants.rb
|
203
|
+
- lib/pg/exceptions.rb
|
204
|
+
- lib/pg/result.rb
|
205
|
+
- sample/array_insert.rb
|
206
|
+
- sample/async_api.rb
|
207
|
+
- sample/async_copyto.rb
|
208
|
+
- sample/async_mixed.rb
|
209
|
+
- sample/check_conn.rb
|
210
|
+
- sample/copyfrom.rb
|
211
|
+
- sample/copyto.rb
|
212
|
+
- sample/cursor.rb
|
213
|
+
- sample/disk_usage_report.rb
|
214
|
+
- sample/issue-119.rb
|
215
|
+
- sample/losample.rb
|
216
|
+
- sample/minimal-testcase.rb
|
217
|
+
- sample/notify_wait.rb
|
218
|
+
- sample/pg_statistics.rb
|
219
|
+
- sample/replication_monitor.rb
|
220
|
+
- sample/test_binary_values.rb
|
221
|
+
- sample/wal_shipper.rb
|
222
|
+
- sample/warehouse_partitions.rb
|
223
|
+
- spec/data/expected_trace.out
|
224
|
+
- spec/data/random_binary_data
|
225
|
+
- spec/lib/helpers.rb
|
226
|
+
- spec/pg/connection_spec.rb
|
227
|
+
- spec/pg/result_spec.rb
|
228
|
+
- spec/pg_spec.rb
|
229
|
+
- lib/2.0/pg_ext.so
|
230
|
+
homepage: https://bitbucket.org/ged/ruby-pg
|
231
|
+
licenses:
|
232
|
+
- BSD
|
233
|
+
- Ruby
|
234
|
+
- GPL
|
235
|
+
post_install_message:
|
236
|
+
rdoc_options:
|
237
|
+
- -f
|
238
|
+
- fivefish
|
239
|
+
- -t
|
240
|
+
- "pg: The Ruby Interface to PostgreSQL"
|
241
|
+
- -m
|
242
|
+
- README.rdoc
|
243
|
+
require_paths:
|
244
|
+
- lib
|
245
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
246
|
+
none: false
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
hash: 57
|
251
|
+
segments:
|
252
|
+
- 1
|
253
|
+
- 8
|
254
|
+
- 7
|
255
|
+
version: 1.8.7
|
256
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
|
+
none: false
|
258
|
+
requirements:
|
259
|
+
- - ">"
|
260
|
+
- !ruby/object:Gem::Version
|
261
|
+
hash: 25
|
262
|
+
segments:
|
263
|
+
- 1
|
264
|
+
- 3
|
265
|
+
- 1
|
266
|
+
version: 1.3.1
|
267
|
+
requirements: []
|
268
|
+
|
269
|
+
rubyforge_project: pg
|
270
|
+
rubygems_version: 1.8.17
|
271
|
+
signing_key:
|
272
|
+
specification_version: 3
|
273
|
+
summary: Pg is the Ruby interface to the {PostgreSQL RDBMS}[http://www.postgresql.org/]
|
274
|
+
test_files: []
|
275
|
+
|