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.
@@ -26,3 +26,5 @@ Yuta TSUBOI <yuuta-t@is.aist-nara.ac.jp>
26
26
  Lugovoi Nikolai <meadow.nnick@gmail.com>
27
27
  Jeff Davis <ruby@j-davis.com>
28
28
  Bertram Scharpf <software@bertram-scharpf.de>
29
+ Michael Granger <ged@FaerieMUD.org>
30
+ Mahlon E. Smith <mahlon@martini.nu>
data/README CHANGED
@@ -1,125 +1,68 @@
1
- ================================================================================
2
- ruby-pg: Ruby interface to PostgreSQL RDBMS
3
- ================================================================================
1
+ = ruby-pg: Ruby interface to PostgreSQL RDBMS
4
2
 
5
- This library is copyrighted by the authors.
6
-
7
- Authors:
8
- * Yukihiro Matsumoto <matz@ruby-lang.org>
9
- Author of Ruby.
10
- * Eiji Matsumoto <usagi@ruby.club.or.jp>
11
- One of users who loves Ruby.
12
- * Jeff Davis <ruby-pg@j-davis.com>
13
-
14
- Thanks to:
15
- * Noboru Saitou <noborus@netlab.jp>
16
- Past maintainer.
17
- * Dave Lee
18
- Past maintainer.
19
- * Guy Decoux ts <decoux@moulon.inra.fr>
20
-
21
- Maintainer:
22
- Jeff Davis <ruby-pg@j-davis.com>
23
-
24
- Copying:
25
- You may redistribute this software under the terms of the Ruby license,
26
- included in the file "LICENSE". The Ruby license also allows distribution
27
- under the terms of the GPL, included in the file "COPYING.txt" and the
28
- file "GPL".
29
-
30
- Portions of the code are from the PostgreSQL project, and are distributed
31
- under the terms of the BSD license, included in the file "BSD".
32
-
33
- - Summary
3
+ This is the extension library to access a PostgreSQL database from Ruby. This
4
+ library works with PostgreSQL 7.4 and later.
34
5
 
35
- This is the extension library to access a PostgreSQL database from Ruby.
36
- This library works with PostgreSQL 7.4 and later.
6
+ == Requirements
37
7
 
38
- - Requirements
8
+ * Ruby 1.8.6 or later.
9
+ * PostgreSQL 7.3 or later installed.
39
10
 
40
- Ruby 1.8 or later.
41
- PostgreSQL 7.3 or later installed.
11
+ It may work with earlier versions as well, but those are not regularly tested.
42
12
 
43
- It may work with earlier versions as well, but those are
44
- not regularly tested.
13
+ == How To Install
45
14
 
46
- - How to install ?
15
+ Install via RubyGems:
47
16
 
48
- Follow the instructions below to compile and install:
17
+ gem install pg
49
18
 
50
- ruby extconf.rb
51
- make
52
- su (if necessary)
53
- make install
19
+ Or install from source:
54
20
 
55
- You may need to specify the directory name for the include files and the
56
- -lpq library by using
21
+ rake install
57
22
 
58
- --with-pgsql-include=<include file directory>
59
- --with-pgsql-lib=<library directory>
23
+ You may need to specify the path to the 'pg_config' program installed with
24
+ Postgres:
60
25
 
61
- For example:
26
+ rake -- --with-pg-config=<path to pg_config>
62
27
 
63
- ruby extconf.rb --with-pgsql-include=/usr/local/pgsql/include \
64
- --with-pgsql-lib=/usr/local/pgsql/lib
28
+ For example, on a Mac with PostgreSQL installed via MacPorts
29
+ (<tt>port install postgresql84</tt>):
65
30
 
66
- - Modules
31
+ rake install -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
67
32
 
68
- 'pg': The 'pg' module is the newer module, that has been greatly improved, and
69
- is almost a complete rewrite. It is not backwards compatible. Use this module
70
- for newly written code. It should be more stable, less buggy, and has more
71
- features.
33
+ See README.OS_X for more information about installing under MacOS X, and
34
+ README.windows for Windows build/installation instructions.
72
35
 
73
- 'postgres': Older module, maintained for backwards compatibility. It
74
- has known flaws that aren't reasonably fixable without breaking backwards
75
- compatibility. Use this module if you have code that already works, and
76
- you just want the fixes that I've committed to this module (for instance,
77
- this module is compatible with PostgreSQL 8.3).
36
+ == Copying
78
37
 
79
- - How to use ?
80
-
81
- This gem builds and installs two PostgreSQL database adapters, 'postgres'
82
- and 'pg'.
38
+ This library is copyrighted by the authors.
83
39
 
84
- The standard way to download and install the most current stable
85
- version of the postgres gem (from http://gems.rubyforge.org) is to use
86
- the RubyGem package manager. You may need to supply RubyGem with the
87
- location of the libpq library and the libpq.h and libpq/libpq-fs.h
88
- files, and may need to run as root.
89
- If you installed from source on a Unix system you can locate these
90
- libpq files with:
91
- find <path to install directory> -name "libpq-fe.h" -print
92
- With binary distributions, you may need to install additional
93
- PostgreSQL development libraries to get these files.
40
+ Authors:
41
+ * Yukihiro Matsumoto <matz@ruby-lang.org> - Author of Ruby.
42
+ * Eiji Matsumoto <usagi@ruby.club.or.jp> - One of users who loves Ruby.
43
+ * Jeff Davis <ruby-pg@j-davis.com>
94
44
 
95
- Then run:
96
- sudo gem install postgres -- --with-pgsql-include-dir=<location of
97
- Postgresql>/include --with-pgsql-lib-dir=<location of Postgresql/lib
45
+ Thanks to:
46
+ * Noboru Saitou <noborus@netlab.jp> - Past maintainer.
47
+ * Dave Lee - Past maintainer.
48
+ * Guy Decoux (ts) <decoux@moulon.inra.fr>
49
+
50
+ Maintainers:
51
+ * Jeff Davis <ruby-pg@j-davis.com>
52
+ * Michael Granger <ged@FaerieMUD.org>
98
53
 
99
- Example:
100
- on Mac OS X with PostgreSQL in /Library/PostgreSQL8 use
101
- --with-pgsql-include-dir=/Library/PostgreSQL8/include --with-pgsql-lib-
102
- dir=/Library/PostgreSQL8/lib
54
+ You may redistribute this software under the terms of the Ruby license,
55
+ included in the file "LICENSE". The Ruby license also allows distribution
56
+ under the terms of the GPL, included in the file "GPL".
103
57
 
104
- To use the module with Rails:
105
- refer to it as
106
- adapter: postgresql
107
- in your database:yaml file
58
+ Portions of the code are from the PostgreSQL project, and are distributed
59
+ under the terms of the BSD license, included in the file "BSD".
108
60
 
109
- To use these modules in Ruby directly (not Rails), refer to the RDoc
110
- documentation.
61
+ Portions copyright LAIKA, Inc.
111
62
 
112
- - Acknowledgments
63
+ == Acknowledgments
113
64
 
114
65
  We are thankful to the people at the ruby-list and ruby-dev mailing lists.
115
66
  And to the people who developed PostgreSQL.
116
67
 
117
- - Copying
118
-
119
- This library is copyrighted by its authors; Yukihiro Matsumoto, and Eiji
120
- Matsumoto.
121
-
122
- Portions copyright Laika, Inc.
123
-
124
-
125
68
 
@@ -0,0 +1,19 @@
1
+ = Compiling on MacOS X
2
+
3
+ If you are building/installing ruby-pg on MacOS X, and the installation doesn't work at first, here are a few things you can try.
4
+
5
+ == Compiling With the Correct Architecture
6
+
7
+ OS X supports both architecture-specific binaries (e.g. i386), as well as universal binaries (i.e. i386 & ppc). If ruby is built as a universal binary and postgresql is not, you need to specify the path to the appropriate pg_config binary or set the environment variable ARCHFLAGS appropriately.
8
+
9
+ For example, if you're using the stock Ruby binary, and PostgreSQL 8.4.x installed from MacPorts (without specifying the {{{+universal}}} variant), do:
10
+
11
+ gem install -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
12
+
13
+ Alternatively, if the build system can't figure out which architectures it should include, you may need to set the 'ARCHFLAGS' environment variable explicitly:
14
+
15
+ sudo env ARCHFLAGS='-arch i386' gem install pg
16
+
17
+ or, if you're building from source:
18
+
19
+ rake compile ARCHFLAGS="-arch i386"
@@ -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
+
@@ -0,0 +1,72 @@
1
+
2
+ = Compiling on MS Windows
3
+
4
+ In order to build this extension on MS Windows you will need a couple things.
5
+
6
+ First, a compiler. For the one click installer this means you should either
7
+ use VC++ 6.0 or the compiler that comes with cygwin or mingw if you're
8
+ building on that platform.
9
+
10
+ If you've built Ruby yourself, you should use the same compiler to build
11
+ this library that you used to build Ruby.
12
+
13
+ Second, PostgreSQL. Be sure you installed it with the development header
14
+ files if you installed it using the standard PostgreSQL installer for
15
+ Windows. If you didn't, you can run the installer again, select "modify",
16
+ and then select the 'development headers' option to install them.
17
+
18
+ I recommend making sure that 'pg_config.exe' is in your PATH. The PostgreSQL
19
+ installer for Windows does not necessarily update your PATH when it installs
20
+ itself, so you may need to do this manually. This isn't strictly necessary,
21
+ however.
22
+
23
+ In order to build ruby-pg, just run 'rake'. If the pg_config.exe executable
24
+ is not in your PATH, you'll need to explicitly point ruby-pg to where your
25
+ PostgreSQL headers and libraries are with something like this:
26
+
27
+ rake --with-pg-dir=c:/progra~1/postgr~1/8.3
28
+
29
+ Adjust your path accordingly. BE SURE TO USE THE SHORT PATH NAMES! If you
30
+ try to use a path with spaces in it, the nmake.exe program will choke.
31
+
32
+
33
+ == Cross compiling for mswin32
34
+
35
+ Using rake-compiler a cross compiled pg-gem can be build on a linux host for
36
+ the win32 platform. The generated gem is statically linked against libpq and
37
+ libssl. OpenSSL and PostgreSQL are downloaded and compiled from the sources.
38
+ There are no runtime dependencies to any but the standard Windows DLLs.
39
+
40
+ Install mingw32. On a debian based system this should work:
41
+
42
+ apt-get install mingw32
43
+
44
+ On MacOS X, if you have MacPorts installed:
45
+
46
+ port install i386-mingw32-gcc
47
+
48
+ Install the rake-compiler:
49
+
50
+ gem install rake-compiler
51
+
52
+ Download and cross compile ruby for win32:
53
+
54
+ rake-compiler cross-ruby VERSION=1.8.6-p287
55
+
56
+ Download and cross compile pg for win32:
57
+
58
+ rake cross native gem RUBY_CC_VERSION=1.8.6 OPENSSL_VERSION=0.9.8l POSTGRESQL_VERSION=8.4.2
59
+
60
+ If everything works, there should be pg-VERSION-x86-mswin32.gem in the pkg
61
+ directory.
62
+
63
+
64
+ If you have any problems you can submit them via the project's issue-tracker:
65
+
66
+ http://bitbucket.org/ged/ruby-pg/issues/new/
67
+
68
+ Or you can join the mailing list:
69
+
70
+ ruby-pg-general@rubyforge.org
71
+
72
+ And submit questions, problems, or solutions, so that it can be improved.