pg 0.8.0 → 0.9.0.pre156

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile DELETED
@@ -1,103 +0,0 @@
1
-
2
- require 'rubygems'
3
- require 'rake/clean'
4
- require 'rake/gempackagetask'
5
- require 'spec/rake/spectask'
6
- require 'rake/rdoctask'
7
- require 'ext_helper'
8
- require 'date'
9
-
10
- # House-keeping
11
- CLEAN.include '**/*.o', 'ext/*.so', '**/*.bundle', '**/*.a',
12
- '**/*.log', "{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}",
13
- "ext/Makefile", 'lib', '**/*.db'
14
-
15
- FILES = FileList[
16
- 'Rakefile',
17
- 'README',
18
- 'LICENSE',
19
- 'COPYING.txt',
20
- 'ChangeLog',
21
- 'Contributors',
22
- 'GPL',
23
- 'BSD',
24
- 'doc/**/*',
25
- 'ext/*',
26
- 'ext/mingw/Rakefile',
27
- 'ext/mingw/build.rake',
28
- 'ext/vc/*.sln',
29
- 'ext/vc/*.vcproj',
30
- 'lib/**/*',
31
- 'sample/**/*',
32
- 'spec/**/*'
33
- ]
34
-
35
- spec = Gem::Specification.new do |s|
36
- s.name = 'pg'
37
- s.platform = Gem::Platform::RUBY
38
- s.require_path = "lib"
39
- s.rubyforge_project = 'ruby-pg'
40
- s.version = "0.8.0"
41
- s.date = DateTime.now
42
- s.summary = 'Ruby extension library providing an API to PostgreSQL'
43
- s.authors = [
44
- 'Yukihiro Matsumoto',
45
- 'Eiji Matsumoto',
46
- 'Noboru Saitou',
47
- 'Dave Lee',
48
- 'Jeff Davis']
49
- s.email = 'ruby-pg@j-davis.com'
50
- s.homepage = 'http://rubyforge.org/projects/ruby-pg'
51
- s.requirements = 'PostgreSQL libpq library and headers'
52
- s.has_rdoc = true
53
- s.extra_rdoc_files = ['ext/pg.c']
54
- s.extensions = [ 'ext/extconf.rb' ]
55
- s.required_ruby_version = '>= 1.8.4'
56
- s.files = FILES.to_a.reject { |x| CLEAN.include?(x) }
57
- end
58
-
59
- Rake::GemPackageTask.new(spec) do |pkg|
60
- pkg.gem_spec = spec
61
- pkg.need_tar = true
62
- end
63
-
64
- # ------- Windows Package ----------
65
- if RUBY_PLATFORM.match(/win32/)
66
- binaries = (FileList['ext/mingw/*.so',
67
- 'ext/mingw/*.dll*'])
68
-
69
- # Windows specification
70
- win_spec = spec.clone
71
- win_spec.extensions = ['ext/mingw/Rakefile']
72
- win_spec.platform = Gem::Platform::CURRENT
73
- win_spec.files += binaries.to_a
74
-
75
- # Rake task to build the windows package
76
- Rake::GemPackageTask.new(win_spec) do |pkg|
77
- end
78
- end
79
-
80
- # --------- RDoc Documentation ---------
81
- desc "Generate rdoc documentation"
82
- Rake::RDocTask.new("rdoc") do |rdoc|
83
- rdoc.rdoc_dir = 'doc/rdoc'
84
- rdoc.title = "pg"
85
- # Show source inline with line numbers
86
- rdoc.options << "--line-numbers"
87
- # Make the readme file the start page for the generated html
88
- rdoc.options << '--main' << 'README'
89
- rdoc.rdoc_files.include('ext/**/*.c',
90
- 'ChangeLog',
91
- 'README*',
92
- 'LICENSE')
93
- end
94
-
95
-
96
- setup_extension 'pg', spec
97
-
98
- desc "Run all specs in spec directory"
99
- Spec::Rake::SpecTask.new("spec") do |t|
100
- t.spec_opts = ["--format", "specdoc", "--colour"]
101
- t.spec_files = FileList["spec/**/*_spec.rb"]
102
- end
103
- task :spec => [:compile]
@@ -1,278 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
- "http://www.w3.org/TR/html4/strict.dtd">
3
- <html lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
- <meta http-equiv="Content-Style-Type" content="text/css">
7
- <meta name="Keywords" lang="en" content="Ruby PostgreSQL">
8
- <link rev="made" href="mailto:noborus@netlab.jp">
9
- <style type="text/css">
10
- <!--
11
- body {
12
- background-color: white;
13
- color: black;
14
- }
15
- address { text-align: right }
16
- div.lastmodifed { text-align: right }
17
- div.language { text-align: right }
18
- pre {
19
- white-space: pre;
20
- background-color: antiquewhite;
21
- border: inset thin;
22
- }
23
- -->
24
- </style>
25
- <title>Postgres reference</title>
26
- </head>
27
- <body>
28
- <div class = "language">
29
- [English | <a href="postgres.jp.html">Japanese</a>]
30
- </div>
31
- <h1><a name="reference">Postgres reference</a></h1>
32
- <div class = "lastmodifed">
33
- Last update: Sun, 4 Mar 2001 15:40:08 +0000
34
- </div>
35
- <hr>
36
- <div>
37
- <h2><a name="PGconn">PGconn</a></h2>
38
- <p>
39
- The class to access PostgreSQL database. All other functionality of libpq
40
- save the large object to a file.
41
- </p>
42
- <p>
43
- For example, to send query to the database on the localhost.
44
- </p>
45
- <pre>
46
- require &quot;postgres&quot;
47
- conn = PGconn.connect("localhost", 5432, &quot;&quot;, &quot;&quot;, &quot;test1&quot;)
48
- # or: conn = PGconn.open('dbname=test1')
49
- res = conn.exec(&quot;select * from a;&quot;)
50
- </pre>
51
- <h3>super class:</h3>
52
- <code>Object</code>
53
- <h3>class methods:</h3>
54
- <p>
55
- <a name="PGconn.connect"><code>connect(<var>pghost</var>,
56
- <var>pgport</var>, <var>pgoptions</var>,
57
- <var>pgtty</var>, <var>dbname</var>, <var>login</var>,
58
- <var>passwd</var>)</code></a>
59
- <a name="PGconn.new"><code>new(<var>pghost</var>,
60
- <var>pgport</var>, <var>pgoptions</var>,
61
- <var>pgtty</var>, <var>dbname</var>, <var>login</var>,
62
- <var>passwd</var>)</code></a>
63
- <a name="PGconn.open"><code>open(<var>string</var>)</code></a>
64
- </p>
65
- <dl>
66
- <dt>Connect to the PostgreSQL server. Options are:</dt>
67
- <dd><var>pghost</var> : Server hostname(string)
68
- <dd><var>pgport</var> : Server port number(integer)
69
- <dd><var>pgoptions</var> : backend options(string)
70
- <dd><var>pgtty</var> : tty to print backend debug message(string)
71
- <dd><var>dbname</var> : connecting database name(string)
72
- <dd><var>login</var> : login user name(string)
73
- <dd><var>passwd</var> : login password(string)
74
- <dt>Options in string format (separated by whitespace) are:</dt>
75
- <dd><var>host=name</var> : Server hostname(string) (defaults to localhost)
76
- <dd><var>hostaddr=addr</var> : Server host IP address(string)
77
- <dd><var>port=number</var> : Server port number(integer) (default: 5432)
78
- <dd><var>options=string</var> : backend options(string) (sent to server, not well explained)
79
- <dd><var>tty=anything</var> : ignored, used to be debug TTY(string)
80
- <dd><var>dbname=name</var> : connecting database name(string) (default: your username)
81
- <dd><var>user=username</var> : login user name(string) (default: your username)
82
- <dd><var>password=censored</var> : login password(string)
83
- <dd><var>sslmode=mode</var> : how to treat SSL(string) (one of disable, allow, prefer, require)
84
- <dd><var>service=name</var> : service name in pg_service.conf(string)
85
- <dd><var>connect_timeout=seconds</var> : how long to wait for a connection(integer) (0 means forever)
86
- </dl>
87
- <p>On failure, it raises <code>PGError</code> exception.</p>
88
- <h3>methods:</h3>
89
- <dl>
90
- <dt><a name="db"><code>db</code></a>
91
- <dd>Returns the connected database name.
92
- <dt><a name="host"><code>host</code></a>
93
- <dd>Returns the connected server name.
94
- <dt><a name="user"><code>user</code></a>
95
- <dd>Returns the authenticated user name.
96
- <dt><a name="options"><code>options</code></a>
97
- <dd>Returns backend option string.
98
- <dt><a name="port"><code>port</code></a>
99
- <dd>Returns the connected server port number.
100
- <dt><a name="tty"><code>tty</code></a>
101
- <dd>Returns the connected pgtty.
102
- <dt><a name="error"><code>error</code></a>
103
- <dd>Returns the error message about connection.
104
- <dt> <a name="finish"><code>finish</code></a>
105
- <dt> <a name="close"><code>close</code></a>
106
- <dd>Closes the backend connection.
107
- <dt><a name="reset"><code>reset</code></a>
108
- <dd>Resets the backend connection. This method closes the backend
109
- connection and tries to re-connect.
110
- <dt><a name="trace"><code>trace(<var>port</var>)</code></a>
111
- <dd>Enables tracing message passing between backend. The trace
112
- message will be written to the port object, which is the
113
- instance of the class File.
114
- <dt><a name="untrace"><code>untrace</code></a>
115
- <dd>Disables the message tracing.
116
- <dt><a name="exec"><code>exec(<var>sql</var>)</code></a>
117
- <dd>Sends SQL query request specified by <var>sql</var> to the
118
- PostgreSQL. Returns the <a href="#PGresult">PGresult</a>
119
- instance on success. On failure, it raises <code>PGError</code>
120
- exception.
121
- <dt><a name="query"><code>query(<var>sql</var>)</code></a>
122
- <dd>Sends SQL query request specified by <var>sql</var> to the
123
- PostgreSQL.Returns an Array as the resulting tuple on success.
124
- On failure, it returns nil, and error detail can be obtained
125
- by error.
126
- <dt><a name="async_exec"><code>async_exec(<var>sql</var>)</code></a>
127
- <dd>Sends SQL asynchronous query request specified by <var>sql</var>
128
- to the PostgreSQL. Returns the <a href="#PGresult">PGresult</a>
129
- instance on success. On failure, it raises <code>PGError</code>
130
- exception.
131
- <dt><a name="async_query"><code>async_query(<var>sql</var>)</code></a>
132
- <dd>Sends SQL asynchronous query request specified by <var>sql</var>
133
- to the PostgreSQL.Returns an Array as the resulting tuple on
134
- success. On failure, it returns nil, and error detail can be
135
- obtained by error.
136
- <dt><a name="get_notify"><code>get_notify</code></a>
137
- <dd>Returns the array of the unprocessed notifiers.
138
- If there is no unprocessed notifier, it returns nil.
139
- <dt><a name="insert_table"><code>insert_table(<var>table</var>,
140
- <var>array</var>)</code></a>
141
- <dd>Inserts contents of the <var>array</var> into the
142
- <var>table</var>.
143
- <dt><a name="getline"><code>getline</code></a>
144
- <dd>Reads a line from the backend server into internal buffer.
145
- Returns nil for EOF, 0 for success, 1 for buffer overflowed.
146
- You need to ensure single &quot;.&quot; from backend to confirm
147
- transmission completion. The sample program <a href="../sample/psql.rb">psql.rb</a>
148
- treats this copy protocol right.
149
- <dt><a name="putline"><code>putline(<var>string</var>)</code></a>
150
- <dd>Sends the <var>string</var> to the backend server.
151
- Users must send a single &quot;.&quot; to denote the end of data transmission.
152
- <dt><a name="endcopy"><code>endcopy</code></a>
153
- <dd>Waits until the backend completes the copying. You should call
154
- this method after putline, or getline.Returns nil on success,
155
- raises an exception otherwise.
156
- <dt><a name="set_client_encoding"><code>set_client_encoding</code></a>
157
- <dd>Set client encoding(String).
158
- <dt><a name="client_encoding"><code>client_encoding</code></a>
159
- <dd>Returns client encoding(String).
160
- <dt><a name="set_notice_processor"><code>set_notice_processor(proc)</code></a>
161
- <dd>Control reporting of notice and warning messages generated by the
162
- backend server (with Proc or anything else responding to :call).
163
- Pass nil to disable processing of the messages.
164
-
165
- <dt><a name="lo_import"><code>lo_import(<var>file</var>)</code></a>
166
- <dd>Import a <var>file</var> to a large object. Return the <a href="#PGlarge">PGlarge</a> instance on success. On failure, it raises <code>PGError</code> exception.
167
- <dt><a name="lo_export"><code>lo_export(<var>oid</var>, <var>file</var>)</code></a>
168
- <dd>Save a large object of oid to a <var>file</var>.
169
- <dt><a name="lo_create"><code>lo_create([<var>mode</var>])</code></a>
170
- <dd>Return the <a href="#PGlarge">PGlarge</a> instance on success. On failure, it raises <code>PGError</code> exception.
171
- <dt><a name="lo_open"><code>lo_open(<var>oid</var>, [<var>mode</var>])</code></a>
172
- <dd>Open a large object of oid. Return the <a href="#PGlarge">PGlarge</a> instance on success. The mode argument specifies the mode for the opened large object, which is either <var>&quot;INV_READ&quot;</var>, or <var>&quot;INV_WRITE&quot;</var>. If mode On failure, it raises <code>PGError</code> exception. If mode omitted, the default is <var>&quot;INV_READ&quot;</var>
173
- <dt><a name="lo_unlink"><code>lo_unlink(<var>oid</var>)</code></a>
174
- <dd>Unlink (deletes) the postgres large object of oid.
175
- </dl>
176
- </div>
177
- <hr>
178
- <div>
179
- <h2><a name="PGresult">PGresult</a></h2>
180
- <P>
181
- The class to represent the query result tuples. The object of this
182
- class is created as the result of every query. You may need to invoke
183
- clear method for the finished object for better memory performance.
184
- </P>
185
- <h3>super class:</h3>
186
- <p>
187
- <code>Object</code>
188
- </p>
189
- <h2>methods:</h2>
190
- <dl>
191
- <dt><a name="status"><code>status</code></a>
192
- <dd><dl>
193
- <dt>Returns the status of the query. The status value is
194
- either:
195
- <dd>EMPTY_QUERY
196
- <dd>COMMAND_OK
197
- <dd>TUPLES_OK
198
- <dd>COPY_OUT
199
- <dd>COPY_IN
200
- </dl>
201
- <dt><a name="result"><code>result</code></a>
202
- <dd>Returns the query result tuple in the array.
203
- <dt><a name="fields"><code>fields</code></a>
204
- <dd>Returns the array of the fields of the query result.
205
- <dt><a name="num_tuples"><code>num_tuples</code></a>
206
- <dd>Returns the number of tuples of the query result.
207
- <dt><a name="num_fields"><code>num_fields</code></a>
208
- <dd>Returns the number of fields of the query result.
209
- <dt><a name="fieldname"><code>fieldname(<var>index</var>)</code></a>
210
- <dd>Returns the field name corresponding field index.
211
- <dt><a name="fieldnum"><code>fieldnum(<var>name</var>)</code></a>
212
- <dd>Returns the index of the <var>name</var>ed field.
213
- <dt><a name="type"><code>type(<var>index</var>)</code></a>
214
- <dd>Returns the integer corresponding the type of the field.
215
- The field indicator starts from zero.
216
- <dt><a name="size"><code>size(<var>index</var>)</code></a>
217
- <dd>Returns the size of the field in bytes.
218
- Returns <code>-1</code> if the field is variable sized.
219
- <dt><a name="getvalue"><code>getvalue(<var>tup_num, field_num</var>)
220
- </code></a>
221
- <dd>Returns the field value.
222
- <dt><a name="getlength"><code>getlength(<var>tup_num, field_num</var>)
223
- </code></a>
224
- <dd>Returns the length of the field in bytes.
225
- <dt><a name="cmdstatus"><code>cmdtuples</code></a>
226
- <dd>the number of tuples (rows) affected by the SQL command.
227
- <dt><a name="cmdstatus"><code>cmdstatus</code></a>
228
- <dd>Returns the status string of the last query command.
229
- <dt><a name="oid"><code>oid</code></a>
230
- <dd>Returns the oid of the inserted row, or <code>nil</code> if
231
- the last statement was not an <code>INSERT</code>
232
- <dt><a name="clear"><code>clear</code></a>
233
- <dd>Clears the <a href="#PGresult">PGresult</a> object as the result
234
- of the query.
235
- </dl>
236
- </div>
237
- <hr>
238
- <div>
239
- <h2><a name="PGlarge">PGlarge</a></h2>
240
- <P>
241
- The class to access large objects. The object of this class is created as the
242
- result of <a href="#lo_import">lo_import</a>, <a href="#lo_create">lo_create</a>, and <a href="#lo_open">lo_open</a>.
243
- </P>
244
- <h3>super class:</h3>
245
- <p>
246
- <code>Object</code>
247
- </p>
248
- <h2>methods:</h2>
249
- <dl>
250
- <dt><a name="open"><code>open([<var>mode</var>])</code></a>
251
- <dd>Open a large object. The mode argument specifies the mode for the opened large object, which is either <var>&quot;INV_READ&quot;</var>,<var>&quot;INV_READ&quot;</var>.
252
- <dt><a name="close"><code>close</code></a>
253
- <dd>Close a large object. Closed when they are garbage-collected.
254
- <dt><a name="read"><code>read([<var>length</var>])</code></a>
255
- <dd>Attempts to read <var>length</var> bytes from large object. If no <var>length</var> given, reads all data.
256
- <dt><a name="write"><code>write(<var>str</var>)</code></a>
257
- <dd>Write the string to the large object. Return the number of bytes written.
258
- <dt><a name="seek"><code>seek(<var>offset</var>, <var>whence</var>)</code></a>
259
- <dd>Move the large object pointer to the <var>offset</var>. The value for <var>whence</var> are SEEK_SET, SEEK_CUR, and SEEK_END.Or it is 0,1,2.
260
- <dt><a name="tell"><code>tell</code></a>
261
- <dd>Return the current position of the large object pointer.
262
- <dt><a name="unlink"><code>unlink</code></a>
263
- <dd>Delete large object.
264
- <dt><a name="oid"><code>oid</code></a>
265
- <dd>Return the large object oid.
266
- <dt><a name="size"><code>size</code></a>
267
- <dd>Return the size of large object.
268
- <dt><a name="export"><code>export(<var>file</var>)</code></a>
269
- <dd>Save a large object of oid to a <var>file</var>.
270
- </dl>
271
- </div>
272
- <hr>
273
- <address>
274
- mailto:
275
- <a href="mailto:noborus@netlab.jp">Noboru Saitou</a>
276
- </address>
277
- </body>
278
- </html>
@@ -1,256 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
- "http://www.w3.org/TR/html4/strict.dtd">
3
- <html lang="ja">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
6
- <meta http-equiv="Content-Style-Type" content="text/css">
7
- <meta name="Keywords" lang="en" content="Ruby PostgreSQL">
8
- <link rev="made" href="mailto:noborus@netlab.jp">
9
- <link rel="contents" href="./index.html">
10
- <style type="text/css">
11
- <!--
12
- body {
13
- background-color: white;
14
- color: black;
15
- }
16
- address { text-align: right }
17
- div.lastmodifed { text-align: right }
18
- div.language { text-align: right }
19
- pre {
20
- white-space: pre;
21
- background-color: antiquewhite;
22
- border: inset thin;
23
- }
24
- -->
25
- </style>
26
- <title>Postgres reference</title>
27
- </head>
28
- <body>
29
- <div class = "language">
30
- [<a href="postgres.html">English</a> | Japanese]
31
- </div>
32
- <h1><a name="reference">Postgres reference</a></h1>
33
- <div class = "lastmodifed">
34
- Last update: Mon, 5 Mar 2001 00:34:55 +0900
35
- </div>
36
- <hr>
37
- <div>
38
- <h2><a name="PGconn">PGconn</a></h2>
39
- <p>
40
- PostgreSQL$B$K%"%/%;%9$9$k$?$a$N%/%i%9!#$=$NB>$N%a%=%C%I$O(Blibpq$B$H$[$\F1$8%$%s%?%U%'!<%9$GDs6!$5$l$^$9!#(B
41
- </p>
42
- <p>
43
- $BNc$($P!"(Blocalhost $B>e$N(B PostgreSQL $B$K@\B3$7!"(Bquery $B$r=P$9$?$a$K$O0J2<$N$h$&$K$7$F9T$$$^$9!#(B
44
- </p>
45
- <pre>
46
- require &quot;postgres&quot;
47
- conn = PGconn.connect("localhost", 5432, &quot;&quot;, &quot;&quot;, &quot;test1&quot;)
48
- res = conn.exec(&quot;select * from a;&quot;)
49
- </pre>
50
- <h3>$B%9!<%P!<%/%i%9(B:</h3>
51
- <code>Object</code>
52
- <h3>$B%/%i%9%a%=%C%I(B:</h3>
53
- <p>
54
- <a name="PGconn.connect"><code>connect(<var>pghost</var>,
55
- <var>pgport</var>, <var>pgoptions</var>,
56
- <var>pgtty</var>, <var>dbname</var>, <var>login</var>,
57
- <var>passwd</var>)</code></a>
58
- <a name="PGconn.new"><code>new(<var>pghost</var>,
59
- <var>pgport</var>, <var>pgoptions</var>,
60
- <var>pgtty</var>, <var>dbname</var>, <var>login</var>,
61
- <var>passwd</var>)</code></a>
62
- <a name="PGconn.open"><code>open(<var>string</var>)</code></a>
63
- </p>
64
- <dl>
65
- <dt>PostgreSQL$B%5!<%P$H@\B3$7$^$9!#%*%W%7%g%s$N0UL#$O0J2<$NDL$j$G$9!#(B</dt>
66
- <dd><var>pghost</var> : $B%5!<%P$N%[%9%HL>(B($BJ8;zNs(B)
67
- <dd><var>pgport</var> : $B%5!<%P$,(Blisten$B$7$F$$$k%]!<%HHV9f(B($B@0?t(B)
68
- <dd><var>pgoptions</var> : backend$B$r5/F0$9$k:]$N%*%W%7%g%s(B($BJ8;zNs(B)
69
- <dd><var>pgtty</var> : backend$B$,%G%P%C%0%a%C%;!<%8$rI=<($9$k(Btty($BJ8;zNs(B)
70
- <dd><var>dbname</var> : $B@\B3$9$k%G!<%?%Y!<%9L>(B($BJ8;zNs(B)
71
- <dd><var>login</var> : $B%f!<%6L>(B($BJ8;zNs(B)
72
- <dd><var>passwd</var> : $B%Q%9%o!<%I(B($BJ8;zNs(B)
73
- <dt>$B%*%W%7%g%s$rJ8;zNs$GEO$9>l9g$N%U%)!<%^%C%H$G$9!#(B</dt>
74
- <dd><var>host=name</var> : $B%5!<%P$N%[%9%HL>(B($BJ8;zNs(B)
75
- <dd><var>hostaddr=addr</var> : $B%5!<%P$N(BIP$B%"%I%l%9(B($BJ8;zNs(B)
76
- <dd><var>port=number</var> $B%5!<%P$,(Blisten$B$7$F$$$k%]!<%HHV9f(B($B@0?t(B)
77
- <dd><var>options=string</var> : backend$B$r5/F0$9$k:]$N%*%W%7%g%s(B($BJ8;zNs(B)
78
- <dd><var>tty=anything</var> : backend$B$,%G%P%C%0%a%C%;!<%8$rI=<($9$k(Btty($BJ8;zNs(B)
79
- <dd><var>dbname=name</var> : $B@\B3$9$k%G!<%?%Y!<%9L>(B($BJ8;zNs(B)
80
- <dd><var>user=username</var> : $B%f!<%6L>(B($BJ8;zNs(B)
81
- <dd><var>password=censored</var> : $B%Q%9%o!<%I(B($BJ8;zNs(B)
82
- <dd><var>sslmode=mode</var> : SSL$B%b!<%I$N;XDj(B($BJ8;zNs(B) (disable, allow, prefer, require)
83
- <dd><var>service=name</var> : $BB>$N%Q%i%a!<%?MQ$K;HMQ$5$l$k%5!<%S%9L>(B($BJ8;zNs(B)
84
- <dd><var>connect_timeout=seconds</var> : $B@\B3%?%$%`%"%&%H;~4V(B($B@0?t(B)
85
- </dl>
86
- <p>$B<:GT$7$?>l9g$O(B <code>PGError</code> $BNc30$,H/@8$7$^$9!#(B</p>
87
- <h3>methods:</h3>
88
- <dl>
89
- <dt><a name="db"><code>db</code></a>
90
- <dd>$B@\B3$7$?%G!<%?%Y!<%9L>$rJV$7$^$9!#(B
91
- <dt><a name="host"><code>host</code></a>
92
- <dd>$B@\B3$7$?%5!<%PL>$rJV$7$^$9!#(B
93
- <dt><a name="user"><code>user</code></a>
94
- <dd>$B%5!<%P$X@\B3;~$KG'>Z$7$?%f!<%6L>$rJV$7$^$9!#(B
95
- <dt><a name="options"><code>options</code></a>
96
- <dd>backend$B$r5/F0$9$k:]$K;XDj$7$?(Boption$B$rJV$7$^$9!#(B
97
- <dt><a name="port"><code>port</code></a>
98
- <dd>$B%5!<%P$X@\B3$9$k:]$K;HMQ$7$?%]!<%HHV9f$rJV$7$^$9!#(B
99
- <dt><a name="tty"><code>tty</code></a>
100
- <dd>$B@\B3$7$F$$$k(Bpgtty$B$rJV$7$^$9!#(B
101
- <dt><a name="error"><code>error</code></a>
102
- <dd>$B@\B3$K4X$9$k%(%i!<%a%C%;!<%8$rJV$7$^$9!#(B
103
- <dt> <a name="finish"><code>finish</code></a>
104
- <dt> <a name="close"><code>close</code></a>
105
- <dd>$B%P%C%/%(%s%I$H$N@\B3$r=*N;$7$^$9!#(B
106
- <dt><a name="reset"><code>reset</code></a>
107
- <dd>$B%P%C%/%(%s%I$H$NDL?.%]!<%H$r%j%;%C%H$7$^$9!#$3$N4X?t$O%P%C%/%(%s%I$H$N%=%1%C%H@\B3$r=*N;$7!"$$$:$l$+$N%P%C%/%(%s%I$H$N?7$7$$@\B3$N:F3NN)$r;n$_$^$9!#(B
108
- <dt><a name="trace"><code>trace(<var>port</var>)</code></a>
109
- <dd>$B%P%C%/%(%s%I$H$N%a%C%;!<%8$N<uEO$7$N%H%l!<%9$rM-8z$K$7$^$9!#%a%C%;!<%8$O(B<var>port</var>$B$G;XDj$5$l$?(B File $B%/%i%9$N%$%s%9%?%s%9$X=q$-=P$5$l$^$9!#(B
110
- <dt><a name="untrace"><code>untrace</code></a>
111
- <dd>$B%P%C%/%(%s%I$H$N%a%C%;!<%8$N<uEO$7$N%H%l!<%9$rL58z$K$7$^$9!#(B
112
- <dt><a name="exec"><code>exec(<var>sql</var>)</code></a>
113
- <dd><var>sql</var>$B$G;XDj$5$l$?(BSQL$BLd$$9g$o$;J8$r(BPostgreSQL$B$XAw$j$^$9!#(B
114
- $BLd$$9g$o$;$,@.8y$7$?>l9g$K$O!"7k2L$,(B<a href="#PGresult">PGresult</a>$B%/%i%9$N(B
115
- $B%$%s%9%?%s%9$H$7$FJV$5$l!"$=$&$G$J$$>l9g$ONc30$,H/@8$7$^$9!#(B
116
- <dt><a name="query"><code>query(<var>sql</var>)</code></a>
117
- <dd><var>sql</var>$B$G;XDj$5$l$?(BSQL$BLd$$9g$o$;J8$r(BPostgreSQL$B$XAw$j$^$9!#(B
118
- $BLd$$9g$o$;$,@.8y$7$?>l9g$K$O!"7k2L$,(B Array $B%/%i%9$N(B
119
- $B%$%s%9%?%s%9$H$7$FJV$5$l!"$=$&$G$J$$>l9g$O(B nil $B$,JV$5$l$^$9!#(B
120
- <dt><a name="async_exec"><code>async_exec(<var>sql</var>)</code></a>
121
- <dd><var>sql</var>$B$G;XDj$5$l$?(BSQL$BLd$$9g$o$;J8$r(BPostgreSQL$B$X(B
122
- $BHsF14|$G(B $BAw$j$^$9!#Ld$$9g$o$;$,@.8y$7$?>l9g$K$O!"(B
123
- $B7k2L$,(B<a href="#PGresult">PGresult</a>$B%/%i%9$N(B
124
- $B%$%s%9%?%s%9$H$7$FJV$5$l!"$=$&$G$J$$>l9g$ONc30$,H/@8$7$^$9!#(B
125
- <dt><a name="async_query"><code>async_query(<var>sql</var>)</code></a>
126
- <dd><var>sql</var>$B$G;XDj$5$l$?(BSQL$BLd$$9g$o$;J8$r(BPostgreSQL$B$X(B
127
- $BHsF14|$G(B $BAw$j$^$9!#Ld$$9g$o$;$,@.8y$7$?>l9g$K$O!"7k2L$,(B Array $B%/%i%9$N(B
128
- $B%$%s%9%?%s%9$H$7$FJV$5$l!"$=$&$G$J$$>l9g$O(B nil $B$,JV$5$l$^$9!#(B
129
- <dt><a name="get_notify"><code>get_notify</code></a>
130
- <dd>$B%P%C%/%(%s%I$+$iL$=hM}$NDLCN%j%9%H$rF@$F!"(BArray $B%/%i%9$N%$%s%9%?%s%9$H$7$FJV$7$^$9!#%P%C%/%(%s%I$+$i$NL$=hM}$NDLCN$,$J$$>l9g$K$O!"(Bnil $B$,JV$5$l$^$9!#(B
131
- <dt><a name="insert_table"><code>insert_table(<var>table</var>,
132
- <var>array</var>)</code></a>
133
- <dd><var>table</var>$B$G;XDj$5$l$?%F!<%V%k$KBP$7!"(B<var>array</var>$B$NFbMF$rA^F~$7$^$9!#(B<var>array</var>$B$O(B Array $B%/%i%9$N%$%s%9%?%s%9$G$J$1$l$P$J$j$^$;$s!#(B
134
- <dt><a name="getline"><code>getline</code></a>
135
- <dd>$B%P%C%/%(%s%I%5!<%P$+$i2~9T%3!<%I$G=*$k9T$rFI$_<h$j$^$9!#(B<code>fgets(3)</code>$B$HF1MM$K!"$3$N%a%=%C%I$O(B<code>get(3)</code>$B$HF1MM$K=*C<9T$r%L%k$KJQ49$7$^$9!#(Bgetline$B$O(BEOF$B$N>l9g$O!"(Bnil $B$r!"9TA4BN$rFI$_<h$C$?>l9g$O(B0$B$r!"$^$@2~9T%3!<%I$rFI$_<h$C$F$$$J$$>l9g$O(B1$B$rJV$7$^$9!#$3$N%a%=%C%I$r;HMQ$9$k;~$NCm0UE@$O!"%P%C%/%(%s%I%5!<%P$,7k2L$NAw?.$r40N;$7$?$3$H$r<($9C10lJ8;z(B&quot;.&quot;$B$r?75,9T$KAw?.$7$?$3$H$r3NG'$7$J$1$l$P$J$i$J$$$3$H$G$9!#(B<br>
136
- $B%5%s%W%k%3!<%I(B<a href="../sample/psql.rb">psql.rb</a>$B$O!"(Bcopy$B%W%m%H%3%k$r@5$7$/07$&%=!<%9$r4^$s$G$$$^$9!#(B
137
- <dt><a name="putline"><code>putline(<var>string</var>)</code></a>
138
- <dd><var>string</var>$B$G;XDj$5$l$?J8;zNs$r%P%C%/%(%s%I!<%5!<%P$XAw?.$7$^$9!#;HMQ<T$O%G!<%?$NAw?.$,40N;$7$?$3$H$r%P%C%/%(%s%I$K<($9$?$a$K!"C10lJ8;z(B&quot;.&quot;$B$rL@<(E*$KAw?.$7$J$1$l$P$J$j$^$;$s!#(B
139
- <dt><a name="endcopy"><code>endcopy</code></a>
140
- <dd>$B%P%C%/%(%s%I$HF14|$r$H$j$^$9!#$3$N%a%=%C%I$O%P%C%/%(%s%I$,(Bcopy$B$r40N;$9$k$^$GBT$A$^$9!#(B<a href="#putline">putline</a>$B$d(B<a href="#getline">getline</a>$B$r;HMQ$7$?>l9g$K;HMQ$9$Y$-%a%=%C%I$G$9!#(Bcopy$B$,$&$^$/40N;$7$?>l9g$K$O(B nil $B$,JV$j!"$=$&$G$J$$>l9g$ONc30$,H/@8$7$^$9!#(B
141
- <dt><a name="set_client_encoding"><code>set_client_encoding</code></a>
142
- <dd>$B%/%i%$%"%s%H$NJ8;z%3!<%I$r;XDj$7$^$9(B($BJ8;zNs(B)$B!#(B
143
- <dt><a name="client_encoding"><code>client_encoding</code></a>
144
- <dd>$B%/%i%$%"%s%H$NJ8;z%3!<%I$rJV$7$^$9(B($BJ8;zNs(B)$B!#(B
145
-
146
- <dt><a name="lo_import"><code>lo_import(<var>file</var>)</code></a>
147
- <dd><var>file</var>$B$r%i!<%8%*%V%8%'%/%H$K%$%s%]!<%H$7$^$9!#@.8y$9$k$H(B<a href="#PGlarge">PGlarge</a>$B%/%i%9$N%$%s%9%?%s%9$,JV$5$l$^$9!#<:GT$9$k$H(B <code>PGError</code> $BNc30$,H/@8$7$^$9!#(B
148
- <dt><a name="lo_export"><code>lo_export(<var>oid</var>, <var>file</var>)</code></a>
149
- <dd>$B%i!<%8%*%V%8%'%/%H$r(B <var>file</var> $B$KJ]B8$7$^$9!#(B
150
- <dt><a name="lo_create"><code>lo_create([<var>mode</var>])</code></a>
151
- <dd>$B?7$7$/%i!<%8%*%V%8%'%/%H$r$D$/$j$^$9!#@.8y$9$k$H(B<a href="#PGlarge">PGlarge</a> $B%/%i%9$N%$%s%9%?%s%9$,JV$5$l$^$9!#<:GT$9$k$H(B <code>PGError</code> $BNc30$,H/@8$7$^$9!#(B
152
- <dt><a name="lo_open"><code>lo_open(<var>oid</var>, [<var>mode</var>])</code></a>
153
- <dd>oid $B$N%i!<%8%*%V%8%'%/%H$r3+$-$^$9!#@.8y$9$k$H(B<a href="#PGlarge">PGlarge</a> $B%/%i%9$N%$%s%9%?%s%9$,JV$5$l$^$9!#<:GT$9$k$H(B <code>PGError</code> $BNc30$,H/@8$7$^$9!#(B<var>&quot;INV_READ&quot;</var>,<var>&quot;INV_WRITE&quot;</var>$B$N$I$A$i$+$N%b!<%I$r;XDj$7$^$9!#<:GT$9$k$H(B <code>PGError</code> $BNc30$,H/@8$7$^$9!#%b!<%I$r>JN,$7$?>l9g$O(B<var>&quot;INV_READ&quot;</var>$B$G$9!#(B
154
- <dt><a name="lo_unlink"><code>lo_unlink(<var>oid</var>)</code></a>
155
- <dd><var>oid</var>$B$N%i!<%8%*%V%8%'%/%H$r:o=|$7$^$9!#(B
156
- </dl>
157
- </div>
158
- <hr>
159
- <div>
160
- <h2><a name="PGresult">PGresult</a></h2>
161
- <P>
162
- Query$B$N7k2L$H$7$FF@$i$l$?%?%C%W%k$r(Bwrap$B$9$k%/%i%9!%$3$N%/%i%9(B
163
- $B$N%$%s%9%?%s%9$O!"(Bquery$B$r9T$&$?$S$K@8@.$5$l$^$9!#8N$KF@$i$l$?(B
164
- $B7k2L$,ITMW$K$J$C$?>l9g$K$O!"(Bclear$B$r8F$S=P$7$F%a%b%j$r2rJ|$9$k(B
165
- $B$h$&$K$7$F2<$5$$!#(B
166
- </P>
167
- <h3>$B%9!<%Q!<%/%i%9(B:</h3>
168
- <p>
169
- <code>Object</code>
170
- </p>
171
- <h2>$B%a%=%C%I(B:</h2>
172
- <dl>
173
- <dt><a name="status"><code>status</code></a>
174
- <dd><dl>
175
- <dt>$BLd$$9g$o$;7k2L$N%9%F!<%?%9$rJV$7$^$9!#%9%F!<%?%9$O0J2<$NCM$N$&$A$N$$$:$l$+0l$D$rJV$7$^$9!#(B
176
- <dd>EMPTY_QUERY
177
- <dd>COMMAND_OK
178
- <dd>TUPLES_OK
179
- <dd>COPY_OUT
180
- <dd>COPY_IN
181
- </dl>
182
- <dt><a name="result"><code>result</code></a>
183
- <dd>$BLd$$9g$o$;7k2L$N%?%C%W%k(B($B%$%s%9%?%s%9(B)$B$r!"G[Ns$GJV$7$^$9!#(B
184
- <dt><a name="fields"><code>fields</code></a>
185
- <dd>$BLd$$9g$o$;$N7k2L$N%U%#!<%k%I(B($BB0@-(B)$B$r!"G[Ns$GJV$7$^$9!#(B
186
- <dt><a name="num_tuples"><code>num_tuples</code></a>
187
- <dd>$BLd$$9g$o$;7k2L$N%?%C%W%k(B($B%$%s%9%?%s%9(B)$B$N?t$rJV$7$^$9!#(B
188
- <dt><a name="num_fields"><code>num_fields</code></a>
189
- <dd>$BLd$$9g$o$;$N7k2L$N%U%#!<%k%I(B($BB0@-(B)$B$N?t$rJV$7$^$9!#(B
190
- <dt><a name="fieldname"><code>fieldname(<var>index</var>)</code></a>
191
- <dd>$BM?$($i$l$?%U%#!<%k%I(B($BB0@-(B)$B$N:w0z(B(field index)$B$KBP1~$9$k%U%#!<%k%I(B($BB0@-(B)$B$NL>A0$rJV$7$^$9!#%U%#!<%k%I!&%$%s%G%#%1!<%?$O(B0$B$+$i3+;O$5$l$^$9!#(B
192
- <dt><a name="fieldnum"><code>fieldnum(<var>name</var>)</code></a>
193
- <dd>$BM?$($i$l$?%U%#!<%k%I(B($BB0@-(B)$B$NL>A0$KBP1~$9$k!"%U%#!<%k%I(B($BB0@-(B)$B$N:w0z$rJV$7$^$9!#(B
194
- <dt><a name="type"><code>type(<var>index</var>)</code></a>
195
- <dd>$BM?$($i$l$?%U%#!<%k%I(B($BB0@-(B)$B$KBP1~$9$k%U%#!<%k%I$N7?$rJV$7$^$9!#FbIt%3!<%G%#%s%0$5$l$F$$$k7?$,@0?t$GJV$5$l$^$9!#%U%#!<%k%I!&%$%s%G%#%1!<%?$O(B0$B$+$i3+;O$5$l$^$9!#(B
196
- <dt><a name="size"><code>size(<var>index</var>)</code></a>
197
- <dd>$BM?$($i$l$?%U%#!<%k%I(B($BB0@-(B)$B$KBP1~$9$k%U%#!<%k%I$N%5%$%:$r%P%$%H?t$GJV$7$^$9!#JV$5$l$k%5%$%:$,(B-1$B$N>l9g!"%U%#!<%k%I$O2DJQD9$G$9!#%U%#!<%k%I!&%$%s%G%#%1!<%?$O(B0$B$+$i3+;O$5$l$^$9!#(B
198
- <dt><a name="getvalue"><code>getvalue(<var>tup_num, field_num</var>)
199
- </code></a>
200
- <dd>$B%U%#!<%k%I(B($BB0@-(B)$B$NCM$rJV$7$^$9!#$[$H$s$I$NLd$$9g$o$;$KBP$7$F!"(B<a href="#getvalue">getvalue</a>$B$K$h$C$FJV$5$l$kCM$O!"%L%k$G=*$o$k(BASCII$BJ8;zNs$GI=8=$5$l$^$9!#Ld$$9g$o$;$N7k2L$,%P%$%J%j%+!<%=%k$G$"$C$?>l9g!"(B<a href="#getvalue">getvalue</a>$B$K$h$C$FJV$5$l$kCM$O!"%P%C%/%(%s%I!&%5!<%P$NFbIt%U%)!<%^%C%H$K0MB8$7$?%P%$%J%j$GI=8=$5$l$^$9!#%G!<%?$r@5$7$$%?%$%W$K%-%c%9%H$7$?$j!"JQ49$7$?$j$9$k$N$O%W%m%0%i%^$N@UG$$G$9!#(B<a href="#PGresult">PGresult</a>$B$N%$%s%9%?%s%9$O(Bquery$B$N$?$S$K@8@.$5$l$^$9!#ITMW$K$J$C$?>l9g$O!"%W%m%0%i%^$,@UG$$r$b$C$F(B<a href="#clear">clear</a>$B$r8F$S=P$7%a%b%j$r2rJ|$7$F2<$5$$!#(B
201
- <dt><a name="getlength"><code>getlength(<var>tup_num, field_num</var>)
202
- </code></a>
203
- <dd>$B%U%#!<%k%I(B($BB0@-(B)$B$ND9$5$r%P%$%H$GJV$7$^$9!#(B
204
- <dt><a name="cmdtuples"><code>cmdtuples</code></a>
205
- <dd>$B:G8e$NLd$$9g$o$;%3%^%s%I$N1F6A$r$&$1$?9T?t$rJV$7$^$9!#(B
206
- <dt><a name="cmdstatus"><code>cmdstatus</code></a>
207
- <dd>$B:G8e$NLd$$9g$o$;%3%^%s%I$N%3%^%s%I%9%F!<%?%9$rJ8;zNs$GJV$7$^$9!#(B
208
- <dt><a name="oid"><code>oid</code></a>
209
- <dd>$BA^F~$5$l$?9T$N(BOID$B$rJV$7$^$9!#(B
210
- <dt><a name="clear"><code>clear</code></a>
211
- <dd>$BLd$$9g$o$;$N7k2L@8@.$5$l$?(B<a href="#PGresult">PGresult</a>$B$N%$%s%9%?%s%9$r%/%j%"$7$^$9!#(B
212
- </dl>
213
- </div>
214
- <hr>
215
- <div>
216
- <h2><a name="PGlarge">PGlarge</a></h2>
217
- <p>
218
- $B%i!<%8%*%V%8%'%/%H$K%"%/%;%9$9$k$?$a$N%/%i%9!#$3$N%*%V%8%'%/%H$O(B <a href="lo_import">lo_import</a>, <a href="lo_create">lo_create</a>, <a href="lo_open">lo_open</a> $B$N7k2L$H$7$FJV$5$l$^$9!#(B
219
- </p>
220
- <h3>super class:</h3>
221
- <p>
222
- <code>Object</code>
223
- </p>
224
- <h2>methods:</h2>
225
- <dl>
226
- <dt><a name="open"><code>open([<var>mode</var>])</code></a>
227
- <dd>$B%i!<%8%*%V%8%'%/%H$r3+$-$^$9!#(B <var>&quot;INV_READ&quot;</var>,<var>&quot;INV_WRITE&quot;</var>$B$N$I$A$i$+$N%b!<%I$r;XDj$7$^$9!#<:GT$9$k$H(B <code>PGError</code> $BNc30$,H/@8$7$^$9!#%b!<%I$r>JN,$7$?>l9g$O(B<var>&quot;INV_READ&quot;</var>$B$G$9!#(B
228
- <dt><a name="close"><code>close</code></a>
229
- <dd>$B%i!<%8%*%V%8%'%/%H$rJD$8$^$9!#0J9_$3$N%*%V%8%'%/%H$KBP$9$k%"%/%;%9$ONc30$rH/@8$7$^$9!#(B
230
- <dt><a name="read"><code>read([<var>length</var>])</code></a>
231
- <dd><var>length</var> $B%P%$%HFI$_9~$s$G$=$NJ8;zNs$rJV$7$^$9!#(B<var>length</var> $B$,>JN,$5$l$?;~$K$O!"A4$F$N%G!<%?$rFI$_9~$_$^$9!#(B
232
- <dt><a name="write"><code>write(<var>str</var>)</code></a>
233
- <dd><var>str</var>$B$r%i!<%8%*%V%8%'%/%H$K=q$-9~$_$^$9!#=q$-9~$s$@%P%$%H?t$rJV$7$^$9!#(B
234
- <dt><a name="seek"><code>seek(<var>offset</var>, <var>whence</var>)</code></a>
235
- <dd>$B%i!<%8%*%V%8%'%/%H$N%]%$%s%?$r(B <var>offset</var> $B0\F0$7$^$9!#(B<var>whence</var> $B$O(B SEEK_SET, SEEK_CUR, and SEEK_END $B$,;XDj$G$-$^$9!#$=$l$>$l(B 0,1,2$B$H?t;z$G;XDj$7$F$b9=$$$^$;$s!#(B
236
- <dt><a name="tell"><code>tell</code></a>
237
- <dd>$B%i!<%8%*%V%8%'%/%H$N%]%$%s%?$N8=:_$N0LCV$rJV$7$^$9!#(B
238
- <dt><a name="unlink"><code>unlink</code></a>
239
- <dd>$B%i!<%8%*%V%8%'%/%H$r:o=|$7$^$9!#(B
240
- <dt><a name="oid"><code>oid</code></a>
241
- <dd>$B%i!<%8%*%V%8%'%/%H$N(B oid $B$rJV$7$^$9!#(B
242
- <dt><a name="size"><code>size</code></a>
243
- <dd>$B%i!<%8%*%V%8%'%/%H$N%5%$%:$rJV$7$^$9!#(B
244
- <dt><a name="export"><code>export(<var>file</var>)</code></a>
245
- <dd><var>file</var>$B$K%i!<%8%*%V%8%'%/%H$r=q$-=P$7$^$9!#(B
246
- </dl>
247
- </div>
248
- <hr>
249
- <address>
250
- mailto:
251
- <a href="mailto:noborus@netlab.jp">Noboru Saitou</a>
252
- </address>
253
- </body>
254
- </html>
255
-
256
-