postgres 0.7.1 → 0.7.9.2007.12.12

Sign up to get free protection for your applications and to get access to all the features.
data/doc/postgres.html DELETED
@@ -1,257 +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
- res = conn.exec(&quot;select * from a;&quot;)
49
- </pre>
50
- <h3>super class:</h3>
51
- <code>Object</code>
52
- <h3>class methods:</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
- </p>
63
- <dl>
64
- <dt>Connect to the PostgreSQL server. Options are:</dt>
65
- <dd><var>pghost</var> : Server hostname(string)
66
- <dd><var>pgport</var> : Server port number(integer)
67
- <dd><var>pgoptions</var> : backend options(string)
68
- <dd><var>pgtty</var> : tty to print backend debug message(string)
69
- <dd><var>dbname</var> : connecting database name(string)
70
- <dd><var>login</var> : login user name(string)
71
- <dd><var>passwd</var> : login password(string)
72
- </dl>
73
- <p>On failure, it raises <code>PGError</code> exception.</p>
74
- <h3>methods:</h3>
75
- <dl>
76
- <dt><a name="db"><code>db</code></a>
77
- <dd>Returns the connected database name.
78
- <dt><a name="host"><code>host</code></a>
79
- <dd>Returns the connected server name.
80
- <dt><a name="user"><code>user</code></a>
81
- <dd>Returns the authenticated user name.
82
- <dt><a name="options"><code>options</code></a>
83
- <dd>Returns backend option string.
84
- <dt><a name="port"><code>port</code></a>
85
- <dd>Returns the connected server port number.
86
- <dt><a name="tty"><code>tty</code></a>
87
- <dd>Returns the connected pgtty.
88
- <dt><a name="error"><code>error</code></a>
89
- <dd>Returns the error message about connection.
90
- <dt> <a name="finish"><code>finish</code></a>
91
- <dt> <a name="close"><code>close</code></a>
92
- <dd>Closes the backend connection.
93
- <dt><a name="reset"><code>reset</code></a>
94
- <dd>Resets the backend connection. This method closes the backend
95
- connection and tries to re-connect.
96
- <dt><a name="trace"><code>trace(<var>port</var>)</code></a>
97
- <dd>Enables tracing message passing between backend. The trace
98
- message will be written to the port object, which is the
99
- instance of the class File.
100
- <dt><a name="untrace"><code>untrace</code></a>
101
- <dd>Disables the message tracing.
102
- <dt><a name="exec"><code>exec(<var>sql</var>)</code></a>
103
- <dd>Sends SQL query request specified by <var>sql</var> to the
104
- PostgreSQL. Returns the <a href="#PGresult">PGresult</a>
105
- instance on success. On failure, it raises <code>PGError</code>
106
- exception.
107
- <dt><a name="query"><code>query(<var>sql</var>)</code></a>
108
- <dd>Sends SQL query request specified by <var>sql</var> to the
109
- PostgreSQL.Returns an Array as the resulting tuple on success.
110
- On failure, it returns nil, and error detail can be obtained
111
- by error.
112
- <dt><a name="async_exec"><code>async_exec(<var>sql</var>)</code></a>
113
- <dd>Sends SQL asynchronous query request specified by <var>sql</var>
114
- to the PostgreSQL. Returns the <a href="#PGresult">PGresult</a>
115
- instance on success. On failure, it raises <code>PGError</code>
116
- exception.
117
- <dt><a name="async_query"><code>async_query(<var>sql</var>)</code></a>
118
- <dd>Sends SQL asynchronous query request specified by <var>sql</var>
119
- to the PostgreSQL.Returns an Array as the resulting tuple on
120
- success. On failure, it returns nil, and error detail can be
121
- obtained by error.
122
- <dt><a name="get_notify"><code>get_notify</code></a>
123
- <dd>Returns the array of the unprocessed notifiers.
124
- If there is no unprocessed notifier, it returns nil.
125
- <dt><a name="insert_table"><code>insert_table(<var>table</var>,
126
- <var>array</var>)</code></a>
127
- <dd>Inserts contents of the <var>array</var> into the
128
- <var>table</var>.
129
- <dt><a name="getline"><code>getline</code></a>
130
- <dd>Reads a line from the backend server into internal buffer.
131
- Returns nil for EOF, 0 for success, 1 for buffer overflowed.
132
- You need to ensure single &quot;.&quot; from backend to confirm
133
- transmission completion. The sample program <a href="../sample/psql.rb">psql.rb</a>
134
- treats this copy protocol right.
135
- <dt><a name="putline"><code>putline(<var>string</var>)</code></a>
136
- <dd>Sends the <var>string</var> to the backend server.
137
- Users must send a single &quot;.&quot; to denote the end of data transmission.
138
- <dt><a name="endcopy"><code>endcopy</code></a>
139
- <dd>Waits until the backend completes the copying. You should call
140
- this method after putline, or getline.Returns nil on success,
141
- raises an exception otherwise.
142
- <dt><a name="set_client_encoding"><code>set_client_encoding</code></a>
143
- <dd>Set client encoding(String).
144
- <dt><a name="client_encoding"><code>client_encoding</code></a>
145
- <dd>Returns client encoding(String).
146
-
147
- <dt><a name="lo_import"><code>lo_import(<var>file</var>)</code></a>
148
- <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.
149
- <dt><a name="lo_export"><code>lo_export(<var>oid</var>, <var>file</var>)</code></a>
150
- <dd>Save a large object of oid to a <var>file</var>.
151
- <dt><a name="lo_create"><code>lo_create([<var>mode</var>])</code></a>
152
- <dd>Return the <a href="#PGlarge">PGlarge</a> instance on success. On failure, it raises <code>PGError</code> exception.
153
- <dt><a name="lo_open"><code>lo_open(<var>oid</var>, [<var>mode</var>])</code></a>
154
- <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>
155
- <dt><a name="lo_unlink"><code>lo_unlink(<var>oid</var>)</code></a>
156
- <dd>Unlink (deletes) the postgres large object of oid.
157
- </dl>
158
- </div>
159
- <hr>
160
- <div>
161
- <h2><a name="PGresult">PGresult</a></h2>
162
- <P>
163
- The class to represent the query result tuples. The object of this
164
- class is created as the result of every query. You may need to invoke
165
- clear method for the finished object for better memory performance.
166
- </P>
167
- <h3>super class:</h3>
168
- <p>
169
- <code>Object</code>
170
- </p>
171
- <h2>methods:</h2>
172
- <dl>
173
- <dt><a name="status"><code>status</code></a>
174
- <dd><dl>
175
- <dt>Returns the status of the query. The status value is
176
- either:
177
- <dd>EMPTY_QUERY
178
- <dd>COMMAND_OK
179
- <dd>TUPLES_OK
180
- <dd>COPY_OUT
181
- <dd>COPY_IN
182
- </dl>
183
- <dt><a name="result"><code>result</code></a>
184
- <dd>Returns the query result tuple in the array.
185
- <dt><a name="fields"><code>fields</code></a>
186
- <dd>Returns the array of the fields of the query result.
187
- <dt><a name="num_tuples"><code>num_tuples</code></a>
188
- <dd>Returns the number of tuples of the query result.
189
- <dt><a name="num_fields"><code>num_fields</code></a>
190
- <dd>Returns the number of fields of the query result.
191
- <dt><a name="fieldname"><code>fieldname(<var>index</var>)</code></a>
192
- <dd>Returns the field name corresponding field index.
193
- <dt><a name="fieldnum"><code>fieldnum(<var>name</var>)</code></a>
194
- <dd>Returns the index of the <var>name</var>ed field.
195
- <dt><a name="type"><code>type(<var>index</var>)</code></a>
196
- <dd>Returns the integer corresponding the type of the field.
197
- The field indicator starts from zero.
198
- <dt><a name="size"><code>size(<var>index</var>)</code></a>
199
- <dd>Returns the size of the field in bytes.
200
- Returns <code>-1</code> if the field is variable sized.
201
- <dt><a name="getvalue"><code>getvalue(<var>tup_num, field_num</var>)
202
- </code></a>
203
- <dd>Returns the field value.
204
- <dt><a name="getlength"><code>getlength(<var>tup_num, field_num</var>)
205
- </code></a>
206
- <dd>Returns the length of the field in bytes.
207
- <dt><a name="cmdstatus"><code>cmdstatus</code></a>
208
- <dd>Returns the status string of the last query command.
209
- <dt><a name="clear"><code>clear</code></a>
210
- <dd>Clears the <a href="#PGresult">PGresult</a> object as the result
211
- of the query.
212
- </dl>
213
- </div>
214
- <hr>
215
- <div>
216
- <h2><a name="PGlarge">PGlarge</a></h2>
217
- <P>
218
- The class to access large objects. The object of this class is created as the
219
- result of <a href="#lo_import">lo_import</a>, <a href="#lo_create">lo_create</a>, and <a href="#lo_open">lo_open</a>.
220
- </P>
221
- <h3>super class:</h3>
222
- <p>
223
- <code>Object</code>
224
- </p>
225
- <h2>methods:</h2>
226
- <dl>
227
- <dt><a name="open"><code>open([<var>mode</var>])</code></a>
228
- <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>.
229
- <dt><a name="close"><code>close</code></a>
230
- <dd>Close a large object. Closed when they are garbage-collected.
231
- <dt><a name="read"><code>read([<var>length</var>])</code></a>
232
- <dd>Attempts to read <var>length</var> bytes from large object. If no <var>length</var> given, reads all data.
233
- <dt><a name="write"><code>write(<var>str</var>)</code></a>
234
- <dd>Write the string to the large object. Return the number of bytes written.
235
- <dt><a name="seek"><code>seek(<var>offset</var>, <var>whence</var>)</code></a>
236
- <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.
237
- <dt><a name="tell"><code>tell</code></a>
238
- <dd>Return the current position of the large object pointer.
239
- <dt><a name="unlink"><code>unlink</code></a>
240
- <dd>Delete large object.
241
- <dt><a name="oid"><code>oid</code></a>
242
- <dd>Return the large object oid.
243
- <dt><a name="size"><code>size</code></a>
244
- <dd>Return the size of large object.
245
- <dt><a name="export"><code>export(<var>file</var>)</code></a>
246
- <dd>Save a large object of oid to a <var>file</var>.
247
- </dl>
248
- </div>
249
- <hr>
250
- <address>
251
- mailto:
252
- <a href="mailto:noborus@netlab.jp">Noboru Saitou</a>
253
- </address>
254
- </body>
255
- </html>
256
-
257
-
data/doc/postgres.jp.html DELETED
@@ -1,239 +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
- </p>
63
- <dl>
64
- <dt>PostgreSQL$B%5!<%P$H@\B3$7$^$9!#%*%W%7%g%s$N0UL#$O0J2<$NDL$j$G$9!#(B</dt>
65
- <dd><var>pghost</var> : $B%5!<%P$N%[%9%HL>(B($BJ8;zNs(B)
66
- <dd><var>pgport</var> : $B%5!<%P$,(Blisten$B$7$F$$$k%]!<%HHV9f(B($B@0?t(B)
67
- <dd><var>pgoptions</var> : backend$B$r5/F0$9$k:]$N%*%W%7%g%s(B($BJ8;zNs(B)
68
- <dd><var>pgtty</var> : backend$B$,%G%P%C%0%a%C%;!<%8$rI=<($9$k(Btty($BJ8;zNs(B)
69
- <dd><var>dbname</var> : $B@\B3$9$k%G!<%?%Y!<%9L>(B($BJ8;zNs(B)
70
- <dd><var>login</var> : $B%f!<%6L>(B($BJ8;zNs(B)
71
- <dd><var>dbname</var> : $B%Q%9%o!<%I(B($BJ8;zNs(B)
72
- </dl>
73
- <p>$B<:GT$7$?>l9g$O(B <code>PGError</code> $BNc30$,H/@8$7$^$9!#(B</p>
74
- <h3>methods:</h3>
75
- <dl>
76
- <dt><a name="db"><code>db</code></a>
77
- <dd>$B@\B3$7$?%G!<%?%Y!<%9L>$rJV$7$^$9!#(B
78
- <dt><a name="host"><code>host</code></a>
79
- <dd>$B@\B3$7$?%5!<%PL>$rJV$7$^$9!#(B
80
- <dt><a name="user"><code>user</code></a>
81
- <dd>$B%5!<%P$X@\B3;~$KG'>Z$7$?%f!<%6L>$rJV$7$^$9!#(B
82
- <dt><a name="options"><code>options</code></a>
83
- <dd>backend$B$r5/F0$9$k:]$K;XDj$7$?(Boption$B$rJV$7$^$9!#(B
84
- <dt><a name="port"><code>port</code></a>
85
- <dd>$B%5!<%P$X@\B3$9$k:]$K;HMQ$7$?%]!<%HHV9f$rJV$7$^$9!#(B
86
- <dt><a name="tty"><code>tty</code></a>
87
- <dd>$B@\B3$7$F$$$k(Bpgtty$B$rJV$7$^$9!#(B
88
- <dt><a name="error"><code>error</code></a>
89
- <dd>$B@\B3$K4X$9$k%(%i!<%a%C%;!<%8$rJV$7$^$9!#(B
90
- <dt> <a name="finish"><code>finish</code></a>
91
- <dt> <a name="close"><code>close</code></a>
92
- <dd>$B%P%C%/%(%s%I$H$N@\B3$r=*N;$7$^$9!#(B
93
- <dt><a name="reset"><code>reset</code></a>
94
- <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
95
- <dt><a name="trace"><code>trace(<var>port</var>)</code></a>
96
- <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
97
- <dt><a name="untrace"><code>untrace</code></a>
98
- <dd>$B%P%C%/%(%s%I$H$N%a%C%;!<%8$N<uEO$7$N%H%l!<%9$rL58z$K$7$^$9!#(B
99
- <dt><a name="exec"><code>exec(<var>sql</var>)</code></a>
100
- <dd><var>sql</var>$B$G;XDj$5$l$?(BSQL$BLd$$9g$o$;J8$r(BPostgreSQL$B$XAw$j$^$9!#(B
101
- $BLd$$9g$o$;$,@.8y$7$?>l9g$K$O!"7k2L$,(B<a href="#PGresult">PGresult</a>$B%/%i%9$N(B
102
- $B%$%s%9%?%s%9$H$7$FJV$5$l!"$=$&$G$J$$>l9g$ONc30$,H/@8$7$^$9!#(B
103
- <dt><a name="query"><code>query(<var>sql</var>)</code></a>
104
- <dd><var>sql</var>$B$G;XDj$5$l$?(BSQL$BLd$$9g$o$;J8$r(BPostgreSQL$B$XAw$j$^$9!#(B
105
- $BLd$$9g$o$;$,@.8y$7$?>l9g$K$O!"7k2L$,(B Array $B%/%i%9$N(B
106
- $B%$%s%9%?%s%9$H$7$FJV$5$l!"$=$&$G$J$$>l9g$O(B nil $B$,JV$5$l$^$9!#(B
107
- <dt><a name="async_exec"><code>async_exec(<var>sql</var>)</code></a>
108
- <dd><var>sql</var>$B$G;XDj$5$l$?(BSQL$BLd$$9g$o$;J8$r(BPostgreSQL$B$X(B
109
- $BHsF14|$G(B $BAw$j$^$9!#Ld$$9g$o$;$,@.8y$7$?>l9g$K$O!"(B
110
- $B7k2L$,(B<a href="#PGresult">PGresult</a>$B%/%i%9$N(B
111
- $B%$%s%9%?%s%9$H$7$FJV$5$l!"$=$&$G$J$$>l9g$ONc30$,H/@8$7$^$9!#(B
112
- <dt><a name="async_query"><code>async_query(<var>sql</var>)</code></a>
113
- <dd><var>sql</var>$B$G;XDj$5$l$?(BSQL$BLd$$9g$o$;J8$r(BPostgreSQL$B$X(B
114
- $BHsF14|$G(B $BAw$j$^$9!#Ld$$9g$o$;$,@.8y$7$?>l9g$K$O!"7k2L$,(B Array $B%/%i%9$N(B
115
- $B%$%s%9%?%s%9$H$7$FJV$5$l!"$=$&$G$J$$>l9g$O(B nil $B$,JV$5$l$^$9!#(B
116
- <dt><a name="get_notify"><code>get_notify</code></a>
117
- <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
118
- <dt><a name="insert_table"><code>insert_table(<var>table</var>,
119
- <var>array</var>)</code></a>
120
- <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
121
- <dt><a name="getline"><code>getline</code></a>
122
- <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>
123
- $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
124
- <dt><a name="putline"><code>putline(<var>string</var>)</code></a>
125
- <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
126
- <dt><a name="endcopy"><code>endcopy</code></a>
127
- <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
128
- <dt><a name="set_client_encoding"><code>set_client_encoding</code></a>
129
- <dd>$B%/%i%$%"%s%H$NJ8;z%3!<%I$r;XDj$7$^$9(B($BJ8;zNs(B)$B!#(B
130
- <dt><a name="client_encoding"><code>client_encoding</code></a>
131
- <dd>$B%/%i%$%"%s%H$NJ8;z%3!<%I$rJV$7$^$9(B($BJ8;zNs(B)$B!#(B
132
-
133
- <dt><a name="lo_import"><code>lo_import(<var>file</var>)</code></a>
134
- <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
135
- <dt><a name="lo_export"><code>lo_export(<var>oid</var>, <var>file</var>)</code></a>
136
- <dd>$B%i!<%8%*%V%8%'%/%H$r(B <var>file</var> $B$KJ]B8$7$^$9!#(B
137
- <dt><a name="lo_create"><code>lo_create([<var>mode</var>])</code></a>
138
- <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
139
- <dt><a name="lo_open"><code>lo_open(<var>oid</var>, [<var>mode</var>])</code></a>
140
- <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
141
- <dt><a name="lo_unlink"><code>lo_unlink(<var>oid</var>)</code></a>
142
- <dd><var>oid</var>$B$N%i!<%8%*%V%8%'%/%H$r:o=|$7$^$9!#(B
143
- </dl>
144
- </div>
145
- <hr>
146
- <div>
147
- <h2><a name="PGresult">PGresult</a></h2>
148
- <P>
149
- Query$B$N7k2L$H$7$FF@$i$l$?%?%C%W%k$r(Bwrap$B$9$k%/%i%9!%$3$N%/%i%9(B
150
- $B$N%$%s%9%?%s%9$O!"(Bquery$B$r9T$&$?$S$K@8@.$5$l$^$9!#8N$KF@$i$l$?(B
151
- $B7k2L$,ITMW$K$J$C$?>l9g$K$O!"(Bclear$B$r8F$S=P$7$F%a%b%j$r2rJ|$9$k(B
152
- $B$h$&$K$7$F2<$5$$!#(B
153
- </P>
154
- <h3>$B%9!<%Q!<%/%i%9(B:</h3>
155
- <p>
156
- <code>Object</code>
157
- </p>
158
- <h2>$B%a%=%C%I(B:</h2>
159
- <dl>
160
- <dt><a name="status"><code>status</code></a>
161
- <dd><dl>
162
- <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
163
- <dd>EMPTY_QUERY
164
- <dd>COMMAND_OK
165
- <dd>TUPLES_OK
166
- <dd>COPY_OUT
167
- <dd>COPY_IN
168
- </dl>
169
- <dt><a name="result"><code>result</code></a>
170
- <dd>$BLd$$9g$o$;7k2L$N%?%C%W%k(B($B%$%s%9%?%s%9(B)$B$r!"G[Ns$GJV$7$^$9!#(B
171
- <dt><a name="fields"><code>fields</code></a>
172
- <dd>$BLd$$9g$o$;$N7k2L$N%U%#!<%k%I(B($BB0@-(B)$B$r!"G[Ns$GJV$7$^$9!#(B
173
- <dt><a name="num_tuples"><code>num_tuples</code></a>
174
- <dd>$BLd$$9g$o$;7k2L$N%?%C%W%k(B($B%$%s%9%?%s%9(B)$B$N?t$rJV$7$^$9!#(B
175
- <dt><a name="num_fields"><code>num_fields</code></a>
176
- <dd>$BLd$$9g$o$;$N7k2L$N%U%#!<%k%I(B($BB0@-(B)$B$N?t$rJV$7$^$9!#(B
177
- <dt><a name="fieldname"><code>fieldname(<var>index</var>)</code></a>
178
- <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
179
- <dt><a name="fieldnum"><code>fieldnum(<var>name</var>)</code></a>
180
- <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
181
- <dt><a name="type"><code>type(<var>index</var>)</code></a>
182
- <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
183
- <dt><a name="size"><code>size(<var>index</var>)</code></a>
184
- <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
185
- <dt><a name="getvalue"><code>getvalue(<var>tup_num, field_num</var>)
186
- </code></a>
187
- <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
188
- <dt><a name="getlength"><code>getlength(<var>tup_num, field_num</var>)
189
- </code></a>
190
- <dd>$B%U%#!<%k%I(B($BB0@-(B)$B$ND9$5$r%P%$%H$GJV$7$^$9!#(B
191
- <dt><a name="cmdstatus"><code>cmdstatus</code></a>
192
- <dd>$B:G8e$NLd$$9g$o$;%3%^%s%I$N%3%^%s%I%9%F!<%?%9$rJ8;zNs$GJV$7$^$9!#(B
193
- <dt><a name="clear"><code>clear</code></a>
194
- <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
195
- </dl>
196
- </div>
197
- <hr>
198
- <div>
199
- <h2><a name="PGlarge">PGlarge</a></h2>
200
- <p>
201
- $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
202
- </p>
203
- <h3>super class:</h3>
204
- <p>
205
- <code>Object</code>
206
- </p>
207
- <h2>methods:</h2>
208
- <dl>
209
- <dt><a name="open"><code>open([<var>mode</var>])</code></a>
210
- <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
211
- <dt><a name="close"><code>close</code></a>
212
- <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
213
- <dt><a name="read"><code>read([<var>length</var>])</code></a>
214
- <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
215
- <dt><a name="write"><code>write(<var>str</var>)</code></a>
216
- <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
217
- <dt><a name="seek"><code>seek(<var>offset</var>, <var>whence</var>)</code></a>
218
- <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
219
- <dt><a name="tell"><code>tell</code></a>
220
- <dd>$B%i!<%8%*%V%8%'%/%H$N%]%$%s%?$N8=:_$N0LCV$rJV$7$^$9!#(B
221
- <dt><a name="unlink"><code>unlink</code></a>
222
- <dd>$B%i!<%8%*%V%8%'%/%H$r:o=|$7$^$9!#(B
223
- <dt><a name="oid"><code>oid</code></a>
224
- <dd>$B%i!<%8%*%V%8%'%/%H$N(B oid $B$rJV$7$^$9!#(B
225
- <dt><a name="size"><code>size</code></a>
226
- <dd>$B%i!<%8%*%V%8%'%/%H$N%5%$%:$rJV$7$^$9!#(B
227
- <dt><a name="export"><code>export(<var>file</var>)</code></a>
228
- <dd><var>file</var>$B$K%i!<%8%*%V%8%'%/%H$r=q$-=P$7$^$9!#(B
229
- </dl>
230
- </div>
231
- <hr>
232
- <address>
233
- mailto:
234
- <a href="mailto:noborus@netlab.jp">Noboru Saitou</a>
235
- </address>
236
- </body>
237
- </html>
238
-
239
-
data/extconf.rb DELETED
@@ -1,47 +0,0 @@
1
- if VERSION < "1.3"
2
- print "This library is for ruby-1.3 or higher.\n"
3
- exit 1
4
- end
5
-
6
- require "mkmf"
7
-
8
- dir_config('pgsql')
9
-
10
- $CFLAGS = ""
11
- $LDFLAGS = ""
12
-
13
- have_library("wsock32", "cygwin32_socket") or have_library("socket", "socket")
14
- have_library("inet", "gethostbyname")
15
- have_library("nsl", "gethostbyname")
16
- have_header("sys/un.h")
17
- if have_func("socket") or have_func("cygwin32_socket")
18
- have_func("hsterror")
19
- unless have_func("gethostname")
20
- have_func("uname")
21
- end
22
- if ENV["SOCKS_SERVER"] # test if SOCKSsocket needed
23
- if have_library("socks", "Rconnect")
24
- $CFLAGS+="-DSOCKS"
25
- end
26
- end
27
- incdir = ENV["POSTGRES_INCLUDE"]
28
- incdir ||= with_config("pgsql-include-dir")
29
- if incdir
30
- $CFLAGS += "-I#{incdir}"
31
- puts "Using PostgreSQL include directory: #{incdir}"
32
- end
33
- libdir = ENV["POSTGRES_LIB"]
34
- libdir ||= with_config("pgsql-lib-dir")
35
- if libdir
36
- $LDFLAGS += "-L#{libdir}"
37
- puts "Using PostgreSQL lib directory: #{libdir}"
38
- end
39
- if have_library("pq", "PQsetdbLogin")
40
- have_func("PQsetClientEncoding")
41
- have_func("pg_encoding_to_char")
42
- have_func("PQescapeString")
43
- create_makefile("postgres")
44
- else
45
- puts "Could not find PostgreSQL libraries: Makefile not created"
46
- end
47
- end
@@ -1,22 +0,0 @@
1
- require 'rubygems'
2
-
3
- SPEC = Gem::Specification.new do |s|
4
- s.name = "postgres"
5
- s.version = %q{0.7.1}
6
- s.author = "Yukihiro Matsumoto, Eiji Matsumoto, Noboru Saitou"
7
- s.email = "noborus@netlab.jp"
8
- s.homepage = "http://www.postgresql.jp/interfaces/ruby/"
9
- s.autorequire = "postgres"
10
- s.platform = Gem::Platform::RUBY
11
- s.summary = "The extension library to access a PostgreSQL database from Ruby."
12
- s.extensions = %w{extconf.rb}
13
- s.files = Dir.glob('**/*')
14
- s.requirements = ["none"]
15
- s.require_paths = %w{.}
16
- s.required_ruby_version = %q{> 0.0.0}
17
- end
18
-
19
- if $0 == __FILE__
20
- Gem::manage_gems
21
- Gem::Builder.new(spec).build
22
- end