Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > postgres database

Reply
Thread Tools

postgres database

 
 
Tom Allison
Guest
Posts: n/a
 
      01-25-2006
What is the file I need to require for connection to a postgres
database? DNS resolution?

How am I *supposed* to find this?
I didn't see anything in the Core or Standard library references.



 
Reply With Quote
 
 
 
 
Pat Maddox
Guest
Posts: n/a
 
      01-25-2006
You need to have the postgres adapter installed. I made a blog
post[1] that covers installation. It's pretty easy, just have to do a
few steps beyond the 'gem install postgres'. You can probably skip
the step to symlink libpq-fe.h because I think that's FreeBSD
specific. Naturally, you'll need to make sure you use the correct
paths for postgresql's include/lib dirs, where your gems are located,
etc.

Pat

[1] http://www.flpr.org/articles/2005/12...stgres-adapter


On 1/24/06, Tom Allison <> wrote:
> What is the file I need to require for connection to a postgres
> database? DNS resolution?
>
> How am I *supposed* to find this?
> I didn't see anything in the Core or Standard library references.
>
>
>



 
Reply With Quote
 
 
 
 
Dave Howell
Guest
Posts: n/a
 
      01-26-2006

On Jan 24, 2006, at 18:23, Pat Maddox wrote:

> You need to have the postgres adapter installed. I made a blog
> post[1] that covers installation. It's pretty easy, just have to do a
> few steps beyond the 'gem install postgres'. You can probably skip
> the step to symlink libpq-fe.h because I think that's FreeBSD
> specific. Naturally, you'll need to make sure you use the correct
> paths for postgresql's include/lib dirs, where your gems are located,
> etc.


A suggestion to the wider PostgreSQL-using Ruby populace; I was
somewhat confused until I figured out that I had to install at least
part of Postgres (bits of library files, I think) on the machine
running Ruby in order to talk to the database that's running on a
different system.

If somebody should happen to write/update/expand upon the instructions
for installing Postgres support into Ruby to include the case where the
Ruby code is being installed and/or running on a system without local
Postgres, that'd probably be a good thing . . . Maybe some way to
permanently bind the libraries into the gem-installed Ruby bits?

[Stop me if I start talking nonsense, I'm not entirely sure what I'm
talking about here.]



 
Reply With Quote
 
tsumeruby@tsumelabs.com
Guest
Posts: n/a
 
      01-26-2006
On Friday 27 January 2006 02:30 am, Dave Howell wrote:
> A suggestion to the wider PostgreSQL-using Ruby populace; I was
> somewhat confused until I figured out that I had to install at least
> part of Postgres (bits of library files, I think) on the machine
> running Ruby in order to talk to the database that's running on a
> different system.
>
> If somebody should happen to write/update/expand upon the instructions
> for installing Postgres support into Ruby to include the case where the
> Ruby code is being installed and/or running on a system without local
> Postgres, that'd probably be a good thing . . . Maybe some way to
> permanently bind the libraries into the gem-installed Ruby bits?
>
> [Stop me if I start talking nonsense, I'm not entirely sure what I'm
> talking about here.]


Good suggestion, but it would be platform specific. Maybe this situation would
be best to create a pure ruby library. I see what you're saying. I think the
tile/tk packager is a direct solution, only if there was a packager for ruby
which would act this way.. To package in all the client libs built for many
platforms(Win, fbsd, linux, macosx), and package in to one small package.

Tsume


 
Reply With Quote
 
Dave Howell
Guest
Posts: n/a
 
      01-26-2006

On Jan 26, 2006, at 9:52, wrote:

> On Friday 27 January 2006 02:30 am, Dave Howell wrote:
>
> To package in all the client libs built for many
> platforms(Win, fbsd, linux, macosx), and package in to one small
> package.


Not necessarily, I think. I just installed Postgres 8, so I don't think
I'd want Psql7.x libraries. (Or maybe they'd be fine.) I first tried
mounting the server's Postgres library directory, and then told the
gem-install script where it was, but it didn't actually copy them, it
just noted their location, so that failed the instant the mount went
down. Presumably, the code I have now is going to fail the instant I
move it to a different machine, unless I manage to scavenge up all the
various lint and popcorn flung far and wide in secret directories on my
system. {sigh}

But even just a mention of this minor pitfall would be good, I think.
All that's currently included is "You may have to tell the installer
where your postgres files are," without noting that you won't HAVE any
if you don't have a LOCAL install.

True self-contained binary-complete Ruby programs are apparently a much
more complicated project.




 
Reply With Quote
 
Wilson Bilkovich
Guest
Posts: n/a
 
      01-26-2006
On 1/26/06, Dave Howell <> wrote:
>
> On Jan 24, 2006, at 18:23, Pat Maddox wrote:
>
> > You need to have the postgres adapter installed. I made a blog
> > post[1] that covers installation. It's pretty easy, just have to do a
> > few steps beyond the 'gem install postgres'. You can probably skip
> > the step to symlink libpq-fe.h because I think that's FreeBSD
> > specific. Naturally, you'll need to make sure you use the correct
> > paths for postgresql's include/lib dirs, where your gems are located,
> > etc.

>
> A suggestion to the wider PostgreSQL-using Ruby populace; I was
> somewhat confused until I figured out that I had to install at least
> part of Postgres (bits of library files, I think) on the machine
> running Ruby in order to talk to the database that's running on a
> different system.
>
> If somebody should happen to write/update/expand upon the instructions
> for installing Postgres support into Ruby to include the case where the
> Ruby code is being installed and/or running on a system without local
> Postgres, that'd probably be a good thing . . . Maybe some way to
> permanently bind the libraries into the gem-installed Ruby bits?
>
> [Stop me if I start talking nonsense, I'm not entirely sure what I'm
> talking about here.]
>


Personally, I just use the postgres-pr adapter, which is pure Ruby.
No dependencies, no compilation. Good stuff.


 
Reply With Quote
 
tsumeruby@tsumelabs.com
Guest
Posts: n/a
 
      01-26-2006
On Friday 27 January 2006 05:13 am, Dave Howell wrote:
> On Jan 26, 2006, at 9:52, wrote:
> > On Friday 27 January 2006 02:30 am, Dave Howell wrote:
> >
> > To package in all the client libs built for many
> > platforms(Win, fbsd, linux, macosx), and package in to one small
> > package.

>
> Not necessarily, I think. I just installed Postgres 8, so I don't think
> I'd want Psql7.x libraries. (Or maybe they'd be fine.) I first tried
> mounting the server's Postgres library directory, and then told the
> gem-install script where it was, but it didn't actually copy them, it
> just noted their location, so that failed the instant the mount went
> down. Presumably, the code I have now is going to fail the instant I
> move it to a different machine, unless I manage to scavenge up all the
> various lint and popcorn flung far and wide in secret directories on my
> system. {sigh}
>
> But even just a mention of this minor pitfall would be good, I think.
> All that's currently included is "You may have to tell the installer
> where your postgres files are," without noting that you won't HAVE any
> if you don't have a LOCAL install.
>
> True self-contained binary-complete Ruby programs are apparently a much
> more complicated project.


Have you tried the postgres-pr library? The library was brought to my
attention in another email.

Tsume


 
Reply With Quote
 
tsumeruby@tsumelabs.com
Guest
Posts: n/a
 
      01-27-2006
On Friday 27 January 2006 06:46 am, Dave Howell wrote:
> On Jan 26, 2006, at 13:32, wrote:
> > Have you tried the postgres-pr library? The library was brought to my
> > attention in another email.

>
> Yes, some months ago, but the installation failed utterly. I don't even
> recall what all I got in error messages. Also, I asked on this list a
> couple weeks ago which of the two (well, three, but two of them are the
> same thing with different names,) libraries to use, and was steered
> toward the non-pure-Ruby library.


I see it.. "postgres-ing? Too many choices!" I don't understand how one could
use a library over another just by someone making a comment, "AFAIK, it's not
as functional as the native extensions". Perhaps you should give the ruby
extension another shot, and post bug reports at any errors you receive. Pure
ruby solutions keep the sanity back in the programmer.

Tsume


 
Reply With Quote
 
Pat Maddox
Guest
Posts: n/a
 
      01-27-2006
On 1/26/06, <> wrote:
> On Friday 27 January 2006 06:46 am, Dave Howell wrote:
> > On Jan 26, 2006, at 13:32, wrote:
> > > Have you tried the postgres-pr library? The library was brought to my
> > > attention in another email.

> >
> > Yes, some months ago, but the installation failed utterly. I don't even
> > recall what all I got in error messages. Also, I asked on this list a
> > couple weeks ago which of the two (well, three, but two of them are the
> > same thing with different names,) libraries to use, and was steered
> > toward the non-pure-Ruby library.

>
> I see it.. "postgres-ing? Too many choices!" I don't understand how one c=

ould
> use a library over another just by someone making a comment, "AFAIK, it's=

not
> as functional as the native extensions". Perhaps you should give the ruby
> extension another shot, and post bug reports at any errors you receive. P=

ure
> ruby solutions keep the sanity back in the programmer.
>
> Tsume
>
>


I asked Robby Russel, who really knows his stuff when it comes to
postgres, which adapter to use. He said "postgres from RubyGems works
nicely."

Pat


 
Reply With Quote
 
tsumeruby@tsumelabs.com
Guest
Posts: n/a
 
      01-27-2006
On Friday 27 January 2006 10:31 am, Pat Maddox wrote:
> On 1/26/06, <> wrote:
> > On Friday 27 January 2006 06:46 am, Dave Howell wrote:
> > > On Jan 26, 2006, at 13:32, wrote:
> > > > Have you tried the postgres-pr library? The library was brought to my
> > > > attention in another email.
> > >
> > > Yes, some months ago, but the installation failed utterly. I don't even
> > > recall what all I got in error messages. Also, I asked on this list a
> > > couple weeks ago which of the two (well, three, but two of them are the
> > > same thing with different names,) libraries to use, and was steered
> > > toward the non-pure-Ruby library.

> >
> > I see it.. "postgres-ing? Too many choices!" I don't understand how one
> > could use a library over another just by someone making a comment,
> > "AFAIK, it's not as functional as the native extensions". Perhaps you
> > should give the ruby extension another shot, and post bug reports at any
> > errors you receive. Pure ruby solutions keep the sanity back in the
> > programmer.
> >
> > Tsume

>
> I asked Robby Russel, who really knows his stuff when it comes to
> postgres, which adapter to use. He said "postgres from RubyGems works
> nicely."
>
> Pat


The issue is not about wether one library works better than the other. As long
as the library is functional is the most important. However, the original OP
was wanting to know a method for not having to compile postgres client
library on each platform. Of course the solution is a pure ruby
implementation.

Tsume


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
existing postgres database Gian Holland Ruby 0 08-28-2007 05:12 PM
Postgres/Postgres-pr - some confusion Nick Black Ruby 1 11-16-2006 08:01 PM
Problem with Ruby-Postgres querying database schema Alexey Verkhovsky Ruby 1 10-23-2004 01:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57