pg 0.15.0.pre.454-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- data/BSDL +22 -0
- data/ChangeLog +2945 -0
- data/Contributors.rdoc +46 -0
- data/History.rdoc +205 -0
- data/LICENSE +56 -0
- data/Manifest.txt +53 -0
- data/POSTGRES +23 -0
- data/README-OS_X.rdoc +68 -0
- data/README-Windows.rdoc +67 -0
- data/README.ja.rdoc +14 -0
- data/README.rdoc +111 -0
- data/Rakefile +156 -0
- data/Rakefile.cross +271 -0
- data/ext/extconf.rb +91 -0
- data/ext/gvl_wrappers.c +13 -0
- data/ext/gvl_wrappers.h +185 -0
- data/ext/pg.c +525 -0
- data/ext/pg.h +126 -0
- data/ext/pg_connection.c +3600 -0
- data/ext/pg_result.c +939 -0
- data/ext/vc/pg.sln +26 -0
- data/ext/vc/pg_18/pg.vcproj +216 -0
- data/ext/vc/pg_19/pg_19.vcproj +209 -0
- data/lib/2.0/pg_ext.so +0 -0
- data/lib/pg.rb +52 -0
- data/lib/pg/connection.rb +71 -0
- data/lib/pg/constants.rb +11 -0
- data/lib/pg/exceptions.rb +11 -0
- data/lib/pg/result.rb +16 -0
- data/sample/array_insert.rb +20 -0
- data/sample/async_api.rb +106 -0
- data/sample/async_copyto.rb +39 -0
- data/sample/async_mixed.rb +56 -0
- data/sample/check_conn.rb +21 -0
- data/sample/copyfrom.rb +81 -0
- data/sample/copyto.rb +19 -0
- data/sample/cursor.rb +21 -0
- data/sample/disk_usage_report.rb +186 -0
- data/sample/issue-119.rb +94 -0
- data/sample/losample.rb +69 -0
- data/sample/minimal-testcase.rb +17 -0
- data/sample/notify_wait.rb +72 -0
- data/sample/pg_statistics.rb +294 -0
- data/sample/replication_monitor.rb +231 -0
- data/sample/test_binary_values.rb +33 -0
- data/sample/wal_shipper.rb +434 -0
- data/sample/warehouse_partitions.rb +320 -0
- data/spec/data/expected_trace.out +26 -0
- data/spec/data/random_binary_data +0 -0
- data/spec/lib/helpers.rb +279 -0
- data/spec/pg/connection_spec.rb +1013 -0
- data/spec/pg/result_spec.rb +278 -0
- data/spec/pg_spec.rb +31 -0
- metadata +275 -0
- metadata.gz.sig +0 -0
data/Contributors.rdoc
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
Thanks to all the great people that have contributed code, suggestions, and patches through the
|
3
|
+
years. If you contribute a patch, please include a patch for this file that adds your name to the
|
4
|
+
list.
|
5
|
+
|
6
|
+
* Dennis Vshivkov <walrus@amur.ru>
|
7
|
+
* Gabriel Emerson <gemerson@evalsoft.com>
|
8
|
+
* Noboru Saitou <noborus@netlab.jp>
|
9
|
+
* Akinori MUSHA <knu@iDaemons.org>
|
10
|
+
* Andy Yu <is@gnuchina.org>
|
11
|
+
* Ceri Storey <cez@compsoc.man.ac.uk>
|
12
|
+
* Gavin Kistner <gavin@refinery.com>
|
13
|
+
* Henry T. So Jr. <henryso@panix.com>
|
14
|
+
* Jeremy Henty <jeremy@chaos.org.uk>
|
15
|
+
* <kasa@air.linkclub.or.jp>
|
16
|
+
* Leon Brooks <leon-ruby-postgres@cyberknights.com.au>
|
17
|
+
* Martin Hedenfalk <mahe@kth.se>
|
18
|
+
* Yukihiro Matsumoto <matz@zetabits.com>
|
19
|
+
* Eiji Matsumoto <usagi@ruby.club.or.jp>
|
20
|
+
* MoonWolf <moonwolf@moonwolf.com>
|
21
|
+
* <m_seki@mva.biglobe.ne.jp>
|
22
|
+
* Nate Haggard <nate@wordplace.com>
|
23
|
+
* Neil Conway <nconway@klamath.dyndns.org>
|
24
|
+
* Noboru Matui <silicon@mx1.freemail.ne.jp>
|
25
|
+
* Okada Jun <yun@be-in.org>
|
26
|
+
* Shirai,Kaoru <shirai@p1jp.com>
|
27
|
+
* Riley <wormwood@speakeasy.org>
|
28
|
+
* shibata <kshibata@vesta.ocn.ne.jp>
|
29
|
+
* <greentea@fa2.so-net.ne.jp>
|
30
|
+
* ts <decoux@moulon.inra.fr>
|
31
|
+
* Yuta TSUBOI <yuuta-t@is.aist-nara.ac.jp>
|
32
|
+
* Lugovoi Nikolai <meadow.nnick@gmail.com>
|
33
|
+
* Jeff Davis <ruby@j-davis.com>
|
34
|
+
* Bertram Scharpf <software@bertram-scharpf.de>
|
35
|
+
* Michael Granger <ged@FaerieMUD.org>
|
36
|
+
* Mahlon E. Smith <mahlon@martini.nu>
|
37
|
+
* Lars Kanis <kanis@comcard.de>
|
38
|
+
* Jason Yanowitz <me-bitbucket@jasonyanowitz.com>
|
39
|
+
* Charlie Savage <cfis@rubyforge.org>
|
40
|
+
* Rafał Bigaj <rafal.bigaj@gmail.com>
|
41
|
+
* Jason Yanowitz <me-bitbucket@jasonyanowitz.com>
|
42
|
+
* Greg Hazel <ghazel@gmail.com>
|
43
|
+
* Chris White <cwprogram@live.com>
|
44
|
+
* Aaron Patterson <aaron.patterson@gmail.com>
|
45
|
+
* Tim Felgentreff <timfelgentreff@gmail.com>
|
46
|
+
|
data/History.rdoc
ADDED
@@ -0,0 +1,205 @@
|
|
1
|
+
== v0.15.0 [2013-03-03] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
Bugfixes:
|
4
|
+
|
5
|
+
- Fix segfault in PG::Result#field_values when called with non String value.
|
6
|
+
- Fix encoding of messages delivered by notice callbacks.
|
7
|
+
- Fix text encoding for Connection#wait_for_notify and Connection#notifies.
|
8
|
+
- Fix 'Bad file descriptor' problems under Windows: wrong behaviour of
|
9
|
+
#wait_for_notify() and timeout handling of #block on Ruby 1.9.
|
10
|
+
|
11
|
+
Documentation fixes:
|
12
|
+
|
13
|
+
- conn#socket() can not be used with IO.for_fd() on Windows.
|
14
|
+
|
15
|
+
Enhancements:
|
16
|
+
|
17
|
+
- Tested under Ruby 2.0.0p0.
|
18
|
+
- Add single row mode of PostgreSQL 9.2.
|
19
|
+
- Set fallback_application_name to programm name $0. Thanks to Will Leinweber
|
20
|
+
for the patch.
|
21
|
+
- Release Ruby's GVL while calls to blocking libpq functions to allow better
|
22
|
+
concurrency in threaded applications.
|
23
|
+
- Refactor different variants of waiting for the connection socket.
|
24
|
+
- Make use of rb_thread_fd_select() on Ruby 1.9 and avoid deprecated
|
25
|
+
rb_thread_select().
|
26
|
+
- Add an example of how to insert array data using a prepared statement (#145).
|
27
|
+
- Add continous integration tests on travis-ci.org.
|
28
|
+
- Add PG::Result#each_row for iterative over result sets by row. Thanks to
|
29
|
+
Aaron Patterson for the patch.
|
30
|
+
- Add a PG::Connection#socket_io method for fetching a (non-autoclosing) IO
|
31
|
+
object for the connection's socket.
|
32
|
+
|
33
|
+
Specs:
|
34
|
+
|
35
|
+
- Fix various specs to run on older PostgreSQL and Ruby versions.
|
36
|
+
- Avoid fork() in specs to allow usage on Windows and JRuby.
|
37
|
+
|
38
|
+
|
39
|
+
== v0.14.1 [2012-09-02] Michael Granger <ged@FaerieMUD.org>
|
40
|
+
|
41
|
+
Important bugfix:
|
42
|
+
|
43
|
+
- Fix stack overflow bug in PG::Result#values and #column_values (#135). Thanks
|
44
|
+
to everyone who reported the bug, and Lars Kanis especially for figuring out
|
45
|
+
the problem.
|
46
|
+
|
47
|
+
PostgreSQL 9.2 beta fixes:
|
48
|
+
|
49
|
+
- Recognize PGRES_SINGLE_TUPLE as OK when checking PGresult (Jeremy Evans)
|
50
|
+
|
51
|
+
Documentation fixes:
|
52
|
+
|
53
|
+
- Add note about the usage scope of the result object received by the
|
54
|
+
#set_notice_receiver block. (Lars Kanis)
|
55
|
+
- Add PGRES_COPY_BOTH to documentation of PG::Result#result_status. (Lars Kanis)
|
56
|
+
- Add some documentation to PG::Result#fnumber (fix for #139)
|
57
|
+
|
58
|
+
|
59
|
+
== v0.14.0 [2012-06-17] Michael Granger <ged@FaerieMUD.org>
|
60
|
+
|
61
|
+
Bugfixes:
|
62
|
+
#47, #104
|
63
|
+
|
64
|
+
|
65
|
+
New Methods for PostgreSQL 9 and async API support:
|
66
|
+
PG
|
67
|
+
- ::library_version
|
68
|
+
|
69
|
+
PG::Connection
|
70
|
+
- ::ping
|
71
|
+
- #escape_literal
|
72
|
+
- #escape_identifier
|
73
|
+
- #set_default_encoding
|
74
|
+
|
75
|
+
PG::Result
|
76
|
+
- #check
|
77
|
+
|
78
|
+
|
79
|
+
New Samples:
|
80
|
+
|
81
|
+
This release also comes with a collection of contributed sample scripts for
|
82
|
+
doing resource-utilization reports, graphing database statistics,
|
83
|
+
monitoring for replication lag, shipping WAL files for replication,
|
84
|
+
automated tablespace partitioning, etc. See the samples/ directory.
|
85
|
+
|
86
|
+
|
87
|
+
== v0.13.2 [2012-02-22] Michael Granger <ged@FaerieMUD.org>
|
88
|
+
|
89
|
+
- Make builds against PostgreSQL earlier than 8.3 fail with a descriptive
|
90
|
+
message instead of a compile failure.
|
91
|
+
|
92
|
+
|
93
|
+
== v0.13.1 [2012-02-12] Michael Granger <ged@FaerieMUD.org>
|
94
|
+
|
95
|
+
- Made use of a finished PG::Connection raise a PG::Error instead of
|
96
|
+
a fatal error (#110).
|
97
|
+
- Added missing BSDL license file (#108)
|
98
|
+
|
99
|
+
|
100
|
+
== v0.13.0 [2012-02-09] Michael Granger <ged@FaerieMUD.org>
|
101
|
+
|
102
|
+
Reorganization of modules/classes to be better Ruby citizens (with backward-compatible aliases):
|
103
|
+
- Created toplevel namespace 'PG' to correspond with the gem name.
|
104
|
+
- Renamed PGconn to PG::Connection (with ::PGconn alias)
|
105
|
+
- Renamed PGresult to PG::Result (with ::PGresult alias)
|
106
|
+
- Renamed PGError to PG::Error (with ::PGError alias)
|
107
|
+
- Declare all constants inside PG::Constants, then include them in
|
108
|
+
PG::Connection and PG::Result for backward-compatibility, and
|
109
|
+
in PG for convenience.
|
110
|
+
- Split the extension source up by class/module.
|
111
|
+
- Removed old compatibility code for PostgreSQL versions < 8.3
|
112
|
+
|
113
|
+
Documentation:
|
114
|
+
- Clarified licensing, updated to Ruby 1.9's license.
|
115
|
+
- Merged authors list, added some missing people to the Contributor's
|
116
|
+
list.
|
117
|
+
- Cleaned up the sample/ directory
|
118
|
+
- Making contact info a bit clearer, link to the Google+ page and
|
119
|
+
the mailing list
|
120
|
+
|
121
|
+
Enhancements:
|
122
|
+
- Added a convenience method: PG.connect -> PG::Connection.new
|
123
|
+
|
124
|
+
Bugfixes:
|
125
|
+
- Fixed LATIN5-LATIN10 Postgres<->Ruby encoding conversions
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
== v0.12.2 [2012-01-03] Michael Granger <ged@FaerieMUD.org>
|
130
|
+
|
131
|
+
- Fix for the 1.8.7 breakage introduced by the st.h fix for alternative Ruby
|
132
|
+
implementations (#97 and #98). Thanks to Lars Kanis for the patch.
|
133
|
+
- Encode error messages with the connection's encoding under 1.9 (#96)
|
134
|
+
|
135
|
+
|
136
|
+
== v0.12.1 [2011-12-14] Michael Granger <ged@FaerieMUD.org>
|
137
|
+
|
138
|
+
- Made rake-compiler a dev dependency, as Rubygems doesn't use the Rakefile
|
139
|
+
for compiling the extension. Thanks to eolamey@bitbucket and Jeremy Evans
|
140
|
+
for pointing this out.
|
141
|
+
- Added an explicit include for ruby/st.h for implementations that need it
|
142
|
+
(fixes #95).
|
143
|
+
|
144
|
+
|
145
|
+
== v0.12.0 [2011-12-07] Michael Granger <ged@FaerieMUD.org>
|
146
|
+
|
147
|
+
- PGconn#wait_for_notify
|
148
|
+
* send nil as the payload argument if the NOTIFY didn't have one.
|
149
|
+
* accept a nil argument for no timeout (Sequel support)
|
150
|
+
* Fixed API docs
|
151
|
+
* Taint and encode event name and payload
|
152
|
+
- Handle errors while rb_thread_select()ing in PGconn#block.
|
153
|
+
(Brian Weaver).
|
154
|
+
- Fixes for Win32 async queries (Rafał Bigaj)
|
155
|
+
- Memory leak fixed: Closing opened WSA event. (rafal)
|
156
|
+
- Fixes for #66 Win32 asynchronous queries hang on connection
|
157
|
+
error. (rafal)
|
158
|
+
- Fixed a typo in PGconn#error_message's documentation
|
159
|
+
- fixing unused variable warnings for ruby 1.9.3 (Aaron Patterson)
|
160
|
+
- Build system bugfixes
|
161
|
+
- Converted to Hoe
|
162
|
+
- Updates for the Win32 binary gem builds (Lars Kanis)
|
163
|
+
|
164
|
+
|
165
|
+
== v0.11.0 [2011-02-09] Michael Granger <ged@FaerieMUD.org>
|
166
|
+
|
167
|
+
Enhancements:
|
168
|
+
|
169
|
+
* Added a PGresult#values method to fetch all result rows as an Array of
|
170
|
+
Arrays. Thanks to Jason Yanowitz (JYanowitz at enovafinancial dot com) for
|
171
|
+
the patch.
|
172
|
+
|
173
|
+
|
174
|
+
== v0.10.1 [2011-01-19] Michael Granger <ged@FaerieMUD.org>
|
175
|
+
|
176
|
+
Bugfixes:
|
177
|
+
|
178
|
+
* Add an include guard for pg.h
|
179
|
+
* Simplify the common case require of the ext
|
180
|
+
* Include the extconf header
|
181
|
+
* Fix compatibility with versions of PostgreSQL without PQgetCancel. (fixes #36)
|
182
|
+
* Fix require for natively-compiled extension under Windows. (fixes #55)
|
183
|
+
* Change rb_yield_splat() to rb_yield_values() for compatibility with Rubinius. (fixes #54)
|
184
|
+
|
185
|
+
|
186
|
+
== v0.10.0 [2010-12-01] Michael Granger <ged@FaerieMUD.org>
|
187
|
+
|
188
|
+
Enhancements:
|
189
|
+
|
190
|
+
* Added support for the payload of NOTIFY events (w/Mahlon E. Smith)
|
191
|
+
* Updated the build system with Rubygems suggestions from RubyConf 2010
|
192
|
+
|
193
|
+
Bugfixes:
|
194
|
+
|
195
|
+
* Fixed issue with PGconn#wait_for_notify that caused it to miss notifications that happened after
|
196
|
+
the LISTEN but before the wait_for_notify.
|
197
|
+
|
198
|
+
== v0.9.0 [2010-02-28] Michael Granger <ged@FaerieMUD.org>
|
199
|
+
|
200
|
+
Bugfixes.
|
201
|
+
|
202
|
+
== v0.8.0 [2009-03-28] Jeff Davis <davis.jeffrey@gmail.com>
|
203
|
+
|
204
|
+
Bugfixes, better Windows support.
|
205
|
+
|
data/LICENSE
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a) distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b) accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c) give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d) make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
.gemtest
|
2
|
+
BSDL
|
3
|
+
ChangeLog
|
4
|
+
Contributors.rdoc
|
5
|
+
History.rdoc
|
6
|
+
LICENSE
|
7
|
+
Manifest.txt
|
8
|
+
POSTGRES
|
9
|
+
README-OS_X.rdoc
|
10
|
+
README-Windows.rdoc
|
11
|
+
README.ja.rdoc
|
12
|
+
README.rdoc
|
13
|
+
Rakefile
|
14
|
+
Rakefile.cross
|
15
|
+
ext/extconf.rb
|
16
|
+
ext/gvl_wrappers.c
|
17
|
+
ext/gvl_wrappers.h
|
18
|
+
ext/pg.c
|
19
|
+
ext/pg.h
|
20
|
+
ext/pg_connection.c
|
21
|
+
ext/pg_result.c
|
22
|
+
ext/vc/pg.sln
|
23
|
+
ext/vc/pg_18/pg.vcproj
|
24
|
+
ext/vc/pg_19/pg_19.vcproj
|
25
|
+
lib/pg.rb
|
26
|
+
lib/pg/connection.rb
|
27
|
+
lib/pg/constants.rb
|
28
|
+
lib/pg/exceptions.rb
|
29
|
+
lib/pg/result.rb
|
30
|
+
sample/array_insert.rb
|
31
|
+
sample/async_api.rb
|
32
|
+
sample/async_copyto.rb
|
33
|
+
sample/async_mixed.rb
|
34
|
+
sample/check_conn.rb
|
35
|
+
sample/copyfrom.rb
|
36
|
+
sample/copyto.rb
|
37
|
+
sample/cursor.rb
|
38
|
+
sample/disk_usage_report.rb
|
39
|
+
sample/issue-119.rb
|
40
|
+
sample/losample.rb
|
41
|
+
sample/minimal-testcase.rb
|
42
|
+
sample/notify_wait.rb
|
43
|
+
sample/pg_statistics.rb
|
44
|
+
sample/replication_monitor.rb
|
45
|
+
sample/test_binary_values.rb
|
46
|
+
sample/wal_shipper.rb
|
47
|
+
sample/warehouse_partitions.rb
|
48
|
+
spec/data/expected_trace.out
|
49
|
+
spec/data/random_binary_data
|
50
|
+
spec/lib/helpers.rb
|
51
|
+
spec/pg/connection_spec.rb
|
52
|
+
spec/pg/result_spec.rb
|
53
|
+
spec/pg_spec.rb
|
data/POSTGRES
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
PostgreSQL Database Management System
|
2
|
+
(formerly known as Postgres, then as Postgres95)
|
3
|
+
|
4
|
+
Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
5
|
+
|
6
|
+
Portions Copyright (c) 1994, The Regents of the University of California
|
7
|
+
|
8
|
+
Permission to use, copy, modify, and distribute this software and its
|
9
|
+
documentation for any purpose, without fee, and without a written agreement
|
10
|
+
is hereby granted, provided that the above copyright notice and this
|
11
|
+
paragraph and the following two paragraphs appear in all copies.
|
12
|
+
|
13
|
+
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
14
|
+
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
|
15
|
+
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
|
16
|
+
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
|
17
|
+
POSSIBILITY OF SUCH DAMAGE.
|
18
|
+
|
19
|
+
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
|
20
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
21
|
+
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
22
|
+
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
|
23
|
+
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
data/README-OS_X.rdoc
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
= Compiling on MacOS X
|
2
|
+
|
3
|
+
The EnterpriseDB packages are the recommended PostgreSQL installations to use
|
4
|
+
with MacOS X. They eliminate most or all of the issues with getting 'pg'
|
5
|
+
installed, linked correctly, and running.
|
6
|
+
|
7
|
+
== Segfaults and SSL Support
|
8
|
+
|
9
|
+
If you need a custom installation of PostgreSQL, you should ensure that you
|
10
|
+
either compile it against the same version of OpenSSL as the OpenSSL extension
|
11
|
+
of the Ruby you'll be using, or compile it without SSL support. If you fail to
|
12
|
+
do this, you will likely see segfaults when you use 'pg' and the 'openssl'
|
13
|
+
extension at the same time. You can see what library it's linked against using
|
14
|
+
'otool -L'; for example, on my 10.7 machine I use for 'pg' development:
|
15
|
+
|
16
|
+
$ otool -L /System/Library/Frameworks/Ruby.framework/Versions\
|
17
|
+
/1.8/usr/lib/ruby/1.8/universal-darwin11.0/openssl.bundle
|
18
|
+
|
19
|
+
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/\
|
20
|
+
lib/ruby/1.8/universal-darwin11.0/openssl.bundle:
|
21
|
+
/System/Library/Frameworks/Ruby.framework/Versions/1.8/\
|
22
|
+
usr/lib/libruby.1.dylib (compatibility version 1.8.0, \
|
23
|
+
current version 1.8.7)
|
24
|
+
/usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, \
|
25
|
+
current version 0.9.8)
|
26
|
+
/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, \
|
27
|
+
current version 0.9.8)
|
28
|
+
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, \
|
29
|
+
current version 159.0.0)
|
30
|
+
|
31
|
+
|
32
|
+
== Dealing with Installation Problems
|
33
|
+
|
34
|
+
If you are building/installing pg on MacOS X, and the installation doesn't
|
35
|
+
work at first, here are a few things you can try.
|
36
|
+
|
37
|
+
=== pg_config
|
38
|
+
|
39
|
+
The first thing you should do is ensure that the 'pg_config' tool that comes
|
40
|
+
with Postgres is in your path. If it isn't, or the one that's first in your
|
41
|
+
path isn't the one that was installed with the Postgres you want to build
|
42
|
+
against, you can specify the path to it with the --with-pg-config option.
|
43
|
+
|
44
|
+
For example, if you're using the Ruby binary that comes with OSX, and
|
45
|
+
PostgreSQL 9.0.x installed from MacPorts, do:
|
46
|
+
|
47
|
+
gem install -- --with-pg-config=/opt/local/lib/postgresql90/bin/pg_config
|
48
|
+
|
49
|
+
=== ARCHFLAGS and Universal Binaries
|
50
|
+
|
51
|
+
OS X supports both architecture-specific binaries (e.g. i386), as well as
|
52
|
+
universal binaries (i.e. i386 & ppc). If Ruby is built as a universal binary
|
53
|
+
and PostgreSQL is not, you need to specify the path to the appropriate
|
54
|
+
pg_config binary or set the environment variable ARCHFLAGS appropriately.
|
55
|
+
|
56
|
+
Alternatively, if the build system can't figure out which architectures it
|
57
|
+
should include, you may need to set the 'ARCHFLAGS' environment variable
|
58
|
+
explicitly:
|
59
|
+
|
60
|
+
sudo env ARCHFLAGS='-arch x86_64' gem install pg
|
61
|
+
|
62
|
+
or, if you're building from source:
|
63
|
+
|
64
|
+
rake compile ARCHFLAGS="-arch x86_64"
|
65
|
+
|
66
|
+
Note that the recommended EnterpriseDB packages are correctly compiled as
|
67
|
+
universal binaries, and don't need any of these workarounds.
|
68
|
+
|