# Postgres question

**URL:** <https://www.ruby-forum.com/t/postgres-question/53401>\
**Category:** Rails\
**Created:** [February 3, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/postgres-question/53401 "2006-02-03T23:03:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Colin\_F](https://www.ruby-forum.com/u/Colin_F)\
**Post date:** [February 3, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/postgres-question/53401/1 "2006-02-03T23:03:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Colin\_F](https://www.ruby-forum.com/u/Colin_F)\
**Post date:** [February 4, 2006, 1:12am UTC](https://www.ruby-forum.com/t/postgres-question/53401/2 "2006-02-04T01:12:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Colin\_F](https://www.ruby-forum.com/u/Colin_F)\
**Post date:** [February 4, 2006, 1:29am UTC](https://www.ruby-forum.com/t/postgres-question/53401/3 "2006-02-04T01:29:46Z")

</div>

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  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subversion training, consulting and support  
[http://www.orcaware.com/svn/](http://www.orcaware.com/svn/)

---

<div class="post-metadata">

**Author:** ![Colin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Colin\_F](https://www.ruby-forum.com/u/Colin_F)\
**Post date:** [February 4, 2006, 3:28am UTC](https://www.ruby-forum.com/t/postgres-question/53401/4 "2006-02-04T03:28:05Z")

</div>

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

Robby

–  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

- Robby R., Founder & Executive Director \*
- PLANET ARGON, LLC | [www.planetargon.com](http://www.planetargon.com) \*
- Ruby on Rails Development, Consulting, and Hosting \*
- Portland, Oregon | p: 503.351.4730 | f: 815.642.4068 \*
- blog: [www.robbyonrails.com](http://www.robbyonrails.com) | book: [www.programmingrails.com](http://www.programmingrails.com) \*  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

---

<div class="post-metadata">

**Author:** ![Colin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Colin\_F](https://www.ruby-forum.com/u/Colin_F)\
**Post date:** [February 4, 2006, 7:41am UTC](https://www.ruby-forum.com/t/postgres-question/53401/5 "2006-02-04T07:41:31Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![Colin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Colin\_F](https://www.ruby-forum.com/u/Colin_F)\
**Post date:** [February 4, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/postgres-question/53401/6 "2006-02-04T17:19:43Z")

</div>

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. 🙂  
}  
} 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

---

<div class="post-metadata">

**Author:** ![Colin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Colin\_F](https://www.ruby-forum.com/u/Colin_F)\
**Post date:** [February 4, 2006, 3:19am UTC](https://www.ruby-forum.com/t/postgres-question/53401/7 "2006-02-04T03:19:00Z")

</div>

On 2/3/06, Colin F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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.
