[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Is there a One True Postgres interface? Is Ruby-postgres maintained?

John Carter

4/14/2008 10:24:00 PM

Is there a One true Ruby Interface to Postgres?

All websites I have found so far have "Last Updated" timestamps of
several years ago.

Is ruby-postgres still being maintained?

Running with warnings on,
require 'postgres'
emits this warning...

/opt/ruby/ruby-1.8.6-p114/lib/ruby/1.8/i686-linux/bigdecimal.so: warning: discarding old open

Looking in the postgres.c file I see...

rb_define_singleton_alias(rb_cPGconn, "connect", "new");
rb_define_singleton_alias(rb_cPGconn, "open", "connect");
rb_define_singleton_alias(rb_cPGconn, "setdb", "connect");
rb_define_singleton_alias(rb_cPGconn, "setdblogin", "connect");
rb_define_singleton_alias(rb_cPGconn, "open", "connect");

Deleting the second "open", "connect" gets rid of the warning.

Here's the patch

diff -u postgres.c~ postgres.c
--- postgres.c~ 2005-12-22 04:59:43.000000000 +1300
+++ postgres.c 2008-04-15 10:11:26.000000000 +1200
@@ -2510,7 +2510,6 @@
rb_define_singleton_alias(rb_cPGconn, "open", "connect");
rb_define_singleton_alias(rb_cPGconn, "setdb", "connect");
rb_define_singleton_alias(rb_cPGconn, "setdblogin", "connect");
- rb_define_singleton_alias(rb_cPGconn, "open", "connect");
rb_define_singleton_method(rb_cPGconn, "escape", pgconn_s_escape, 1);
rb_define_singleton_method(rb_cPGconn, "quote", pgconn_s_quote, 1);
rb_define_singleton_alias(rb_cPGconn, "format", "quote");



John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand


57 Answers

John Carter

4/14/2008 10:29:00 PM

0

On Tue, 15 Apr 2008, John Carter wrote:

> Is ruby-postgres still being maintained?
>
> Running with warnings on,
> require 'postgres'
> emits this warning...
>
> /opt/ruby/ruby-1.8.6-p114/lib/ruby/1.8/i686-linux/bigdecimal.so: warning:
> discarding old open

Sorry, some version details on that post...

This is against the snapshot version
ruby-postgres-20051221.tar.gz

from
http://ruby.scripting.ca...

The fault is not in the release version.
ruby-postgres-0.7.1.tar.gz




John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand


Reid Thompson

4/14/2008 11:11:00 PM

0

John Carter wrote:
> Is there a One true Ruby Interface to Postgres?
>
> All websites I have found so far have "Last Updated" timestamps of
> several years ago.
>
> Is ruby-postgres still being maintained?

see ruby-pg

http://rubyforge.org/project...

John Carter

4/14/2008 11:41:00 PM

0

On Tue, 15 Apr 2008, Reid Thompson wrote:

> see ruby-pg
>
> http://rubyforge.org/project...

Interestingly enough that link also serves up both flavors,
ruby-postgres and ruby-pg, without comment. Is there any discussion
anywhere on the relative merits?

Or is ruby-pg the One True flavour?



John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand


John Carter

4/14/2008 11:45:00 PM

0

On Tue, 15 Apr 2008, John Carter wrote:

> On Tue, 15 Apr 2008, Reid Thompson wrote:
>
>> see ruby-pg
>>
>> http://rubyforge.org/project...
>
> Interestingly enough that link also serves up both flavors,
> ruby-postgres and ruby-pg, without comment. Is there any discussion
> anywhere on the relative merits?
>
> Or is ruby-pg the One True flavour?

Ok, sorry, I have now RTFRM "Read The Fine README" and see that ruby-pg is
indeed The One True Postgres Interface and ruby-postgres is being superceded



John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand


John Carter

4/15/2008 4:41:00 AM

0

On Tue, 15 Apr 2008, Chad Perrin wrote:

> On Tue, Apr 15, 2008 at 08:44:31AM +0900, John Carter wrote:
>>
>> Ok, sorry, I have now RTFRM "Read The Fine README" and see that ruby-pg is
>> indeed The One True Postgres Interface and ruby-postgres is being superceded
>
> Where'd you find that README? In the source -- or is there somewhere to
> get it without downloading?

In the basement, in the locked cupboard, the one with the sign "Beware
of the Leopard".... :-)) (As you can tell, I'm a Douglas Adams fan...)

It's inside the ruby-pg source bundle.


John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand


Joel VanderWerf

4/15/2008 4:53:00 AM

0

John Carter wrote:
> In the basement, in the locked cupboard, the one with the sign "Beware
> of the Leopard".... :-)) (As you can tell, I'm a Douglas Adams fan...)

Funny. I always figured you as an Edgar Rice Burroughs fan. ;)

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

John Carter

4/15/2008 5:27:00 AM

0

On Tue, 15 Apr 2008, Joel VanderWerf wrote:

> John Carter wrote:
>> In the basement, in the locked cupboard, the one with the sign "Beware
>> of the Leopard".... :-)) (As you can tell, I'm a Douglas Adams fan...)
>
> Funny. I always figured you as an Edgar Rice Burroughs fan. ;)

Actually, it's the other way round....

Check the "X-Apparently-From:" header in my mails.

Now you'll have to excuse me, I must go rescue a scantily clad buxom
maiden in distress from a slobbering alien...

If other readers of this conversation are utterly confused... say
"barsoom" to Google and you will be enlightened....

Well, no, not actually enlightened as such.

Well, at least become informed about an obscure, old fashioned, and
ever so slightly kinky, steam punk corner of literary history.

John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand


Phillip Gawlowski

4/15/2008 5:47:00 AM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Carter wrote:

| If other readers of this conversation are utterly confused... say
| "barsoom" to Google and you will be enlightened....
|
| Well, no, not actually enlightened as such.

Careful, otherwise Tarzan may beat you to pulp. ;P


- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan

[Abstract art is] a product of the untalented, sold by the unprincipled
~ to the utterly bewildered.
~ -- Al Capp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail....

iEYEARECAAYFAkgEQWkACgkQbtAgaoJTgL9CsgCfY1SZcMHZVz31Oy9Yr1peL+Q5
QKsAnj4G7U97WNnScNUU/bTSFFvyk0ZM
=bRxb
-----END PGP SIGNATURE-----

Jeff Davis

4/15/2008 5:32:00 PM

0

On Tue, 2008-04-15 at 15:57 +0900, Chad Perrin wrote:
> It seems kind of suboptimal, to me, to only let someone know that
> postgres has been superseded by pg *after* something has already been
> downloaded and unpacked.

http://ruby-pg.rubyforge.org/svn/ruby-pg/tr...

Also, the project description does seem to imply that information in the
255 characters I was allowed for that field.

I haven't gotten around to actually writing a project home page yet,
which is the only other place I could really put that kind of
information. Rubyforge doesn't really offer a long description area.

If you have any specific suggestions that can make it more clear, please
let me know.

Regards,
Jeff Davis


Jeff Davis

4/15/2008 5:43:00 PM

0

On Tue, 2008-04-15 at 08:41 +0900, John Carter wrote:
> On Tue, 15 Apr 2008, Reid Thompson wrote:
>
> > see ruby-pg
> >
> > http://rubyforge.org/project...
>
> Interestingly enough that link also serves up both flavors,
> ruby-postgres and ruby-pg, without comment. Is there any discussion
> anywhere on the relative merits?
>

ruby-postgres had some serious maintenance problems, and was unable to
even build against PostgreSQL 8.3, and my various patches were not
applied.

So, I started maintaining a fork of ruby-postgres with my most important
patches applied, and started a rewrite to address some of the more
fundamental problems. The rewrite is called ruby-pg, and I consider it
to be the best driver available, and it's intended to replace the
others.

> Or is ruby-pg the One True flavour?

As far as I can tell, it's the only actively maintained PostgreSQL
driver for Ruby. It's fairly new, but:
* it's well documented (RDoc)
* offers almost all the functionality available from libpq (which is a
lot of functions)
* I'm responsive to bug reports
* I have an expanding set of rspec tests.

The biggest problem I am having with the project is making it work
seamlessly on windows. Several people have tried to help me, but I don't
think the problem has been solved, and I haven't received many specific
suggestions to make it work.

If anyone wants to help me with that, please contact me.

Regards,
Jeff Davis