Forum: Ruby on Rails Postgres question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1e40cf754e04f23c034b63d0c2e2127b?d=identicon&s=25 Colin Freas (Guest)
on 2006-02-03 23:03
(Received via mailing list)
What are the practical differences between using postgres and
postgres-pr to
connect rails to a postgres database?

I realize the -pr version is pure ruby, while the other is a set of c
bindings, but, does that result in performance, reliability, or feature
differences?

Any information appreciated.

Colin Freas
D23f436b8e718e80f447712cdac67083?d=identicon&s=25 Amr Malik (Guest)
on 2006-02-04 01:12
Colin Freas wrote:
> What are the practical differences between using postgres and
> postgres-pr to
> connect rails to a postgres database?
>
> I realize the -pr version is pure ruby, while the other is a set of c
> bindings, but, does that result in performance, reliability, or feature
> differences?
>
> Any information appreciated.
>
> Colin Freas

I didn't have much luck with the C version on my OSX Tiger ibook. But
maybe that was just something I wasn't doing right. -pr worked out of
the box and for dev purposes, it seems ok.

I have not used these two side by side, but just knowing that one is
written in C, I would expect it to give a little better performance (if
not markedly improved performance). Can't really comment one reliability
& feature diffs.

regards,

-Amr
27c57aaa4bda5ac8b0593659573b522f?d=identicon&s=25 Blair Zajac (Guest)
on 2006-02-04 01:29
(Received via mailing list)
Amr Malik wrote:
>>Any information appreciated.
>>
>>Colin Freas
>
>
> I didn't have much luck with the C version on my OSX Tiger ibook. But
> maybe that was just something I wasn't doing right. -pr worked out of
> the box and for dev purposes, it seems ok.

To this point, I've used the Fink and DarwinPorts C bindings on my
project just
fine on Tiger.  My rake check suite passes just the same with Linux as
with OS X.

Regards,
Blair

--
Blair Zajac, Ph.D.
CTO, OrcaWare Technologies
<blair@orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/
25e11a00a89683f7e01e425a1a6e305c?d=identicon&s=25 Wilson Bilkovich (Guest)
on 2006-02-04 03:19
(Received via mailing list)
On 2/3/06, Colin Freas <colinfreas@gmail.com> wrote:
>
> What are the practical differences between using postgres and postgres-pr to
> connect rails to a postgres database?
>
> I realize the -pr version is pure ruby, while the other is a set of c
> bindings, but, does that result in performance, reliability, or feature
> differences?
>
> Any information appreciated.
>
I haven't run into any trouble with the postgres-pr driver, except
that not all of the ActiveRecord unit tests pass.  I haven't had time
to really investigate deeply, but I'd imagine that this means that
certain features are missing.
B84d42a3a5c343f8fc6ab7d7f47fd3f5?d=identicon&s=25 Robby Russell (Guest)
on 2006-02-04 03:28
(Received via mailing list)
On Fri, 2006-02-03 at 17:02 -0500, Colin Freas wrote:
> I realize the -pr version is pure ruby, while the other is a set of c
> bindings, but, does that result in performance, reliability, or
> feature
> differences?
>

>From my experience... it's *worth* the few extra steps to get the C
bindings working. :-)

Robby

--
/**************************************************************
* Robby Russell, Founder & Executive Director                 *
* PLANET ARGON, LLC | www.planetargon.com                     *
* Ruby on Rails Development, Consulting, and Hosting          *
* Portland, Oregon  | p: 503.351.4730 | f: 815.642.4068       *
* blog: www.robbyonrails.com | book: www.programmingrails.com *
***************************************************************/
1e40cf754e04f23c034b63d0c2e2127b?d=identicon&s=25 Colin Freas (Guest)
on 2006-02-04 07:41
(Received via mailing list)
> From my experience... it's *worth* the few extra steps to get the C
> bindings working. :-)
>

Robby, why do you say that?

Blair and Amr seem to think that the -pr versions are fine...  but, in a
slightly misdirected posting to the Ruby mailing list some time ago, I
got a
response very similar to yours.

But, that's why I asked the question of which is better...  some
specific
examples, knowledge of what causes differences in behavior, and maybe
some
pointers to locations in the code that cause that behavior would go a
long
way towards helping us all figure out what the real differences here
are,
and how they'd affect systems under development.

Just to throw my $0.02 in, I'm using the postgres-pr version, with
postgres
8, and it's working fine...  if there are compelling reasons to switch
though, which seem to be darkly hinted at, I'd rather do it now than
later.

Colin
675475d0b65710be6d992eb5eb2c61c2?d=identicon&s=25 Gregory Seidman (Guest)
on 2006-02-04 17:19
(Received via mailing list)
On Sat, Feb 04, 2006 at 12:57:02AM -0500, Colin Freas wrote:
} > From my experience... it's *worth* the few extra steps to get the C
} > bindings working. :-)
}
} Robby, why do you say that?
}
} Blair and Amr seem to think that the -pr versions are fine...  but, in
a
} slightly misdirected posting to the Ruby mailing list some time ago, I
} got a response very similar to yours.
}
} But, that's why I asked the question of which is better...  some
specific
} examples, knowledge of what causes differences in behavior, and maybe
} some pointers to locations in the code that cause that behavior would
go
} a long way towards helping us all figure out what the real differences
} here are, and how they'd affect systems under development.
}
} Just to throw my $0.02 in, I'm using the postgres-pr version, with
} postgres 8, and it's working fine...  if there are compelling reasons
to
} switch though, which seem to be darkly hinted at, I'd rather do it now
} than later.

So it seems to me that it very much depends on your development platform
and your deployment platform. For me, both are Debian and it's dead easy
to
set up the C bindings (apt-get install libdbd-pg-ruby); it doesn't even
involve a gem install. For platforms with less complete package
management
systems (*cough* Windows *cough*), it's easier to use gem for package
management, and the -pr version doesn't require any work other than the
gem
install.

When it comes to deployment, you probably want the extra performance of
the
C bindings, so you may want to get that working on your deployment
platform
even if you don't bother for your development platform. Then again, the
only good reason to optimize (and the C bindings are an optimization,
make
no mistake) is because you have a performance bottleneck; if it ain't
broke, don't fix it, and the only way to tell is by monitoring real-life
(or simulated) performance.

} Colin
--Greg
This topic is locked and can not be replied to.