Adding manpower to a late software project makes it later
Filed under: postgresql,ruby on rails — Michael Glauche @ 00:51

WordPress database error: [MySQL client ran out of memory]
SELECT ip FROM wp_statpress WHERE pvalue = '3'

WordPress database error: [MySQL client ran out of memory]
SELECT ip FROM wp_statpress WHERE pvalue = '3'

WordPress database error: [Lost connection to MySQL server during query]
SELECT urlrequested,pvalue,count(*) as counts FROM wp_statpress WHERE (ip!=null ) and (pvalue != '')and (pvalue != '3') group by urlrequested order by counts desc limit 5

Recently did wonder about how to replace the slow postgres-pr library
with the native postgres version. Unfortuately the native client is not
that easy to install, especially without having cygwin installed.

You’ll need the postgres installation files for windows, best is the
zipped version without the installier, for example
postgresql-8.2.5-1-binaries-no-installer.zip, as you only need to copy
a few files out of it.

Then you need to use gem to install the postgres extension:

c:\>gem install ruby-postgres
..
2. ruby-postgres 0.7.1.2006.04.06 (mswin32)
..
> 2

(choose the latest mswin32 build)

Usually everything should be done now, but wait, testing it with:

c:\> irb
irb(main):001:0> require 'postgres'

gives an error ! You need to go back to the postgres installer file and
copy a couple of libraries to the ruby “bin” file (for example in
c:\ruby\bin\)

  • comerr32.dll
  • krb5_32.dll
  • libeay32.dll
  • libiconv-2.dll
  • libintl-2.dll
  • libpq.dll
  • ssleay32.dll

Don’t overwrite any files if they already exist in the ruby directory !

Now its time to try it out again:

C:\>irb
irb(main):001:0> require 'postgres'
=> true
irb(main):002:0>

Voila ! We have a native postgres client library installed and can use the advanced features like large object access.


related post

    WordPress database error: [MySQL server has gone away]
    SELECT * FROM wp_comments WHERE comment_post_ID = 3 AND comment_approved = '1' ORDER BY comment_date_gmt ASC

    2 Comments »

    No comments yet.

    RSS feed for comments on this post. TrackBack URL

    Leave a comment

    You must be logged in to post a comment.

    23 queries. 1.622 seconds. Powered by WordPress

    Home