Postgres question

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 F.

Colin F. 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 F.

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

Amr M. wrote:

Any information appreciated.

Colin F.

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 Z., Ph.D.
CTO, OrcaWare Technologies
[email protected]
Subversion training, consulting and support
http://www.orcaware.com/svn/

On Fri, 2006-02-03 at 17:02 -0500, Colin F. 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. :slight_smile:

Robby


/**************************************************************

  • Robby R., 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 *
    ***************************************************************/

From my experience… it’s worth the few extra steps to get the C
bindings working. :slight_smile:

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

On Sat, Feb 04, 2006 at 12:57:02AM -0500, Colin F. wrote:
} > From my experience… it’s worth the few extra steps to get the C
} > bindings working. :slight_smile:
}
} 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

On 2/3/06, Colin F. [email protected] 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.