# Ruby and PostgreSQL?

**URL:** <https://www.ruby-forum.com/t/ruby-and-postgresql/176294>\
**Category:** Ruby\
**Created:** [September 28, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/ruby-and-postgresql/176294 "2009-09-28T17:59:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [September 28, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/ruby-and-postgresql/176294/1 "2009-09-28T17:59:27Z")

</div>

Hi-

Not sure if this is the right place to post this, however I am looking  
for documentation for using Ruby with a Postgres database. I found  
the ruby-pg gem, however nothing in the way of docs and Google isn’t  
giving me much.

Anyone have any experience with this?

Thanks!

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [September 28, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/ruby-and-postgresql/176294/2 "2009-09-28T17:59:27Z")

</div>

On Mon, Sep 28, 2009 at 8:25 AM, pete [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Not sure if this is the right place to post this, however I am looking  
> for documentation for using Ruby with a Postgres database. I found  
> the ruby-pg gem, however nothing in the way of docs and Google isn’t  
> giving me much.

ruby-pg has pretty good rdoc, which you can view locally with `gem server`.

Ben

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [September 28, 2009, 6:09pm UTC](https://www.ruby-forum.com/t/ruby-and-postgresql/176294/3 "2009-09-28T18:09:24Z")

</div>

On Sep 28, 2009, at 10:25 AM, pete wrote:

> 

You will want the “pg” gem as opposed to the ruby-pg gem for a start.  
You did not specify your platform, but you will need a compiler to  
install the gem. There is a pure ruby connector for postgres: postgres-  
pr which provides the same functionality though with slower performance.

You can start here for documentation on the functionality available.

Cheers–

Charles

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [September 28, 2009, 6:15pm UTC](https://www.ruby-forum.com/t/ruby-and-postgresql/176294/4 "2009-09-28T18:15:50Z")

</div>

On Sep 28, 9:46 am, Ben B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Mon, Sep 28, 2009 at 8:25 AM, pete [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Not sure if this is the right place to post this, however I am looking  
> > for documentation for using Ruby with a Postgres database. I found  
> > the ruby-pg gem, however nothing in the way of docs and Google isn’t  
> > giving me much.
> 
> ruby-pg has pretty good rdoc, which you can view locally with `gem server`.
> 
> Ben

I didn’t even know that existed, awesome, thanks!

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [September 29, 2009, 3:50am UTC](https://www.ruby-forum.com/t/ruby-and-postgresql/176294/5 "2009-09-29T03:50:08Z")

</div>

On 2009-09-28, pete [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Not sure if this is the right place to post this, however I am looking  
> for documentation for using Ruby with a Postgres database. I found  
> the ruby-pg gem, however nothing in the way of docs and Google isn’t  
> giving me much.

Hi! There should be documentation; try running rdoc in the source tree,  
according to google. I did “rdoc --op foo”, and foo/index.html yielded  
a moderately usable hunk of documentation.

I was using this for a while (enough to find and submit a fix for a very  
ugly memory corruption bug), but now I don’t directly use it, rather, I  
have it embedded in Rails and use it through ActiveRecord.

-s

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [September 29, 2009, 7:17am UTC](https://www.ruby-forum.com/t/ruby-and-postgresql/176294/6 "2009-09-29T07:17:23Z")

</div>

On Sep 28, 2009, at 11:39 AM, Charles J. wrote:

> > 
> 
> You will want the “pg” gem as opposed to the ruby-pg gem for a  
> start. You did not specify your platform, but you will need a  
> compiler to install the gem. There is a pure ruby connector for  
> postgres: postgres-pr which provides the same functionality though  
> with slower performance.

I posted a little roundup of Ruby PostgreSQL drivers recently:

> **[在线播放免费人成毛片视频安全,强壮的公么征服我厨房,亚洲色欲色欱WWW在线,老外又粗又长一晚做五次](http://www.railsonpostgresql.com/2009/09/04/rails-postgresql-and-database-drivers)**
>
> 在线播放免费人成毛片视频安全,强壮的公么征服我厨房,亚洲色欲色欱WWW在线,老外又粗又长一晚做五次,99热在线播放,爆出白浆超碰人人人人,7788理论片在线观看,国产99视频精品免费观看9,欧美一级特黄A片免费看视频,下面插插好爽视频,97久久超碰中文字幕潮喷,国产啪视频1000部免费,综合在线视频图片区自拍,91精品国产自产在线观看

To summarize, “gem install pg”, and things are much better than they  
were a few years ago 🙂

Yours,

Tom

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [September 29, 2009, 11:48pm UTC](https://www.ruby-forum.com/t/ruby-and-postgresql/176294/7 "2009-09-29T23:48:32Z")

</div>

And of course you can write stored procedures with PL/Ruby - no need for  
that old fashioned business logic layer - stick everything in the  
database!
