ruby-postgres 0.7.1.2005.11.24-mswin32

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/README.ja ADDED
@@ -0,0 +1,183 @@
1
+ PostgreSQL$BMQ3HD%%i%$%V%i%j(B version 0.7.1
2
+
3
+ $B$^$D$b$H(B $B$f$-$R$m(B
4
+ $B$^$D$b$H(B $B$($$$8(B
5
+
6
+ $B@$OC?M(B: $B@FF#(B $BEP(B
7
+
8
+ - What's this ?
9
+
10
+ $BK\%i%$%V%i%j$O!"(BRuby$B$+$i(BPostgreSQL$B$X%"%/%;%9$9$k$?$a$N3HD%%i%$%V%i%j$G$9!#(B
11
+ $B%5%]!<%H$7$F$$$k(BPostgreSQL$B$N%P!<%8%g%s$O!"(B6.5/7.0/7.1/7.2 $B$G$9!#(B6.3$B0JA0$N(B
12
+ $B%P!<%8%g%s$G$b(B($B$A$g$C$H$7$?JQ99$G(B)$BF0:n$9$k$H;W$$$^$9$,!"%F%9%H$7$F$$$^$;$s!#(B
13
+
14
+ - How to install ?
15
+ *** requirement ***
16
+ PostgreSQL module$B$r;H$&$s$G$9$+$i!$EvA3(BPostgreSQL$B$OI,MW$G$9$M!%:#$N$H$3$m(B
17
+ $B%m!<%+%k$K(BPostgreSQL$B$,%$%s%9%H!<%k$5$l$F$$$k$3$H$rA0Ds$K$7$F$$$^$9$,!$(B
18
+ $BI,MW$J%X%C%@$H(Blibpq$B$5$($"$l$P!$%5!<%P$OI,$:$7$b%m!<%+%k$GF0:n$7$F$$$kI,MW(B
19
+ $B$O$"$j$^$;$s!%(B
20
+
21
+ $B%G%U%)%k%H$G$O!$(BPostgreSQL$B$,(B/usr/local/pgsql$BG[2<$K%$%s%9%H!<%k$5$l$F$$$k(B
22
+ $B$H$7$F$$$^$9!%JL$N>l=j$K%$%s%9%H!<%k$7$F$$$k>l9g$K$O!$4D6-JQ?t(BPGLIB$B$K(Blibpq
23
+ $B%i%$%V%i%j$,CV$$$F$"$k(Bdirectory$B$K@_Dj$7$F2<$5$$!#(B
24
+
25
+ $BG$0U$N>l=j$G!$$3$N%"!<%+%$%V$rE83+$7$F$/$@$5$$!%8e$O(B
26
+
27
+ ruby extconf.rb
28
+ make
29
+ su ($B$b$7I,MW$J$i(B)
30
+ make install
31
+
32
+ $B$H$9$k$@$1$G$9!%(BPostgreSQL$B$N%$%s%/%k!<%I%U%!%$%k!"%i%$%V%i%j%U%!%$%k$N(B
33
+ $B%$%s%9%H!<%k>l=j$,I8=`$N0LCV$G$O$J$/%3%s%Q%$%i$,8+IU$1$k$3$H$,$G$-$J$$(B
34
+ $B>l9g$K$O(B
35
+
36
+ --with-pgsql-include-dir=<$B%$%s%/%k!<%I%U%!%$%k%G%#%l%/%H%j(B>
37
+ --with-pgsql-lib-dir=<$B%i%$%V%i%j%G%#%l%/%H%j(B>
38
+ $B$^$?$O(B
39
+ --with-pgsql-dir=<$B%G%#%l%/%H%j(B>
40
+ $B$3$l$O0J2<$N$h$&$K;XDj$7$?$H$-$H$*$J$8$G$9!#(B
41
+ --with-pgsql-include-dir=<$B%G%#%l%/%H%j(B>/include
42
+ --with-pgsql-lib-dir=<$B%G%#%l%/%H%j(B>/lib
43
+
44
+
45
+ $BNc$($P(B
46
+
47
+ ruby extconf.rb --with-pgsql-include-dir=/usr/local/pgsql/include \
48
+ --with-pgsql-lib-dir=/usr/local/pgsql/lib
49
+ $B$^$?$O(B
50
+ ruby extconf.rb --with-pgsql-dir=/usr/local/pgsql
51
+
52
+ $B$N$h$&$K;XDj$7$F$/$@$5$$!#(B
53
+
54
+ - How to use ?
55
+
56
+ require "postgres"
57
+
58
+ $B$H$7$F$+$i8f;HMQ2<$5$$!#(B
59
+
60
+ - What function can I use ?
61
+
62
+ $B4pK\E*$K!"(BC$B$N(Blibpq$B%$%s%?%U%'!<%9$GDj5A$5$l$F$$$k4X?t$O%5%]!<%H$7$F$$$^$9!#(B
63
+ ver 0.6.0 $B$+$i?7$7$/(B Large Object $B%$%s%?!<%U%'%$%9$,DI2C$5$l$^$7$?!#(B
64
+
65
+ $B%5%]!<%H$7$F$$$k%a%=%C%I$N0lMw$O0J2<$NDL$j$G$9!#(B
66
+
67
+ PGconn$B%/%i%9(B:
68
+
69
+ $B%/%i%9%a%=%C%I(B
70
+ new
71
+ connect
72
+ setdb
73
+ setdblogin
74
+ escape
75
+ quote
76
+ escape_bytea
77
+
78
+ $B%a%=%C%I(B
79
+ db
80
+ host
81
+ options
82
+ port
83
+ tty
84
+ status
85
+ error
86
+ finish
87
+ close
88
+ reset
89
+ user
90
+ trace
91
+ untrace
92
+
93
+ exec
94
+ query
95
+ async_exec
96
+ async_query
97
+ get_notify
98
+ insert_table
99
+ putline
100
+ getline
101
+ endcopy
102
+ notifies
103
+
104
+ lo_import
105
+ lo_export
106
+ lo_create
107
+ lo_open
108
+ lo_unlink
109
+
110
+ client_encoding
111
+ set_client_encoding
112
+
113
+ PGresult$B%/%i%9(B:
114
+
115
+ $B%a%=%C%I(B
116
+ each
117
+ []
118
+ status
119
+ result
120
+ fields
121
+ num_tuples
122
+ num_fields
123
+ fieldname
124
+ fieldnum
125
+ type
126
+ size
127
+ getvalue
128
+ getlength
129
+ cmdstatus
130
+ print
131
+ clear
132
+
133
+ PGlarge$B%/%i%9(B:
134
+
135
+ $B%a%=%C%I(B
136
+ open
137
+ close
138
+ read
139
+ write
140
+ lseek
141
+ tell
142
+ unlink
143
+ oid
144
+ size
145
+ export
146
+
147
+ - Acknowledgement
148
+
149
+ $BK\3HD%%i%$%V%i%j$r:n@.$9$k$K$"$?$C$F!"(Bruby-list, ruby-dev,
150
+ ruby-talk,$B5Z$S(B pgsql-jp$B%a!<%j%s%0%j%9%H$N%a%s%P!<$K!"B?$/$NM-1W$J(B
151
+ $B%"%I%P%$%9$rD:$-$^$7$?!#$3$3$K46<U$N0U$rI=$7$^$9!#(B
152
+
153
+ - Copying
154
+
155
+ $BK\3HD%%i%$%V%i%j$NCx:n8"$O!"$^$D$b$H(B $B$f$-$R$m$H$^$D$b$H(B $B$($$$8$,(B
156
+ $BJ];}$7$^$9!#(B
157
+
158
+ $BK\3HD%%i%$%V%i%j$O!"(BRuby$BK\BN$HF1$8G[I[>r7o$K=>$C$F:FG[I[$9$k$3$H(B
159
+ $B$,$G$-$^$9!#(BRuby$BK\BN$NG[I[>r7o$K$D$$$F$O!"(BRuby$BG[I[J*Cf$N(BREADME.jp
160
+ $B$K=q$+$l$F$$$^$9!#(B
161
+
162
+ $B8=:_$O@FF#(B $BEP$,(B maintainer $B$r>5$C$F$$$k$N$G!"Ld$$9g$o$;$O$3$A$i$NJ}$K(B
163
+ $B$*4j$$$7$^$9!#(B
164
+
165
+ - Author
166
+
167
+ $B$^$D$b$H(B $B$f$-$R$m(B <matz@ruby-lang.org>
168
+ Author of Ruby
169
+
170
+ $B$^$D$b$H(B $B$($$$8(B <usagi@ruby.club.or.jp>
171
+ One of users who loves Ruby
172
+
173
+ $B$3$N$U$?$j$O7;Do$G$O$"$j$^$;$s!#(B :-)
174
+
175
+ - Special Thanks
176
+
177
+ Guy Decoux ts <decoux@moulon.inra.fr>
178
+
179
+ - maintainer
180
+
181
+ $B@FF#(B $BEP(B <noborus@netlab.jp>
182
+ $B$^$D$b$H$G$J$/$F$9$$$^$;$s(B :-)
183
+
data/doc/postgres.html ADDED
@@ -0,0 +1,278 @@
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>