wanting to use postgres with python - WHAT am I doing wrong?????? AGGGHHHH

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

wanting to use postgres with python - WHAT am I doing wrong?????? AGGGHHHH

Ronni
I want to use postgres with python but I can't seem to get it working.  
If I read things correctly I need python installed then I need postgres
installed.  I did both on my Sun Solaris Opteron AMD 64 (Mandrake 10.1
os) using the --enable-shared and --with-python options.  Both came back
with ready statements.  I can do stuff with python and I can do stuff
with postgres - but I can't seem to do stuff with both!  I installed
Python-2.4.1 and PostGreSQL-8.0.3.

I read up and decided that I needed PyGreSQL so downloaded
PyGreSQL-3.6.2 and had to work extensively (before asking for help there
again) to get just the compile to work.  It seems to add the shared
library but the "python setup.py install" doesn't work AT ALL.

My question is - is there a more simple way?  I must surely be doing
something wrong.  Maybe I don't even need PyGreSQL.

Please - all advice welcome!  My brain is so tired and ready for
something fresh!
Thank you in advance for any help given.  I can promise you that it is
greatly appreciated!
Ronni

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
Reply | Threaded
Open this post in threaded view
|

Re: wanting to use postgres with python - WHAT am I

Tino Wildenhain
Am Mittwoch, den 03.08.2005, 09:49 -0600 schrieb Ronni:

> I want to use postgres with python but I can't seem to get it working.  
> If I read things correctly I need python installed then I need postgres
> installed.  I did both on my Sun Solaris Opteron AMD 64 (Mandrake 10.1
> os) using the --enable-shared and --with-python options.  Both came back
> with ready statements.  I can do stuff with python and I can do stuff
> with postgres - but I can't seem to do stuff with both!  I installed
> Python-2.4.1 and PostGreSQL-8.0.3.
>
> I read up and decided that I needed PyGreSQL so downloaded
> PyGreSQL-3.6.2 and had to work extensively (before asking for help there
> again) to get just the compile to work.  It seems to add the shared
> library but the "python setup.py install" doesn't work AT ALL.
>
> My question is - is there a more simple way?  I must surely be doing
> something wrong.  Maybe I don't even need PyGreSQL.
>
"doesnt work at all" is not a good problem report. Its better to include
the output of the run. python setup.py will also tell you options
you can give (specify path to your postgres libs/includes and so on)

Did you install python from source too?

Most people use psycopg with python and postgres.

--
Tino Wildenhain <[hidden email]>


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
Reply | Threaded
Open this post in threaded view
|

Re: wanting to use postgres with python - WHAT am I doing wrong?????? AGGGHHHH

Stephane Bortzmeyer
In reply to this post by Ronni
On Wed, Aug 03, 2005 at 09:49:18AM -0600,
 Ronni <[hidden email]> wrote
 a message of 24 lines which said:

> I want to use postgres with python

This is too vague. Do you want:

1) To do server-side programming in Python (creating functions in
Python instead of plPgSQL or SQL)?

If so:
http://www.postgresql.org/docs/8.0/interactive/plpython.html

2) Access the database from a client written in Python?

If so:
http://initd.org/projects/psycopg1

(There are other Python client interfaces such as PoPy, but psycopg is
the most common, and best maintained version.)

The second is typically much simpler. (I do both.)

> I did both on my Sun Solaris Opteron AMD 64 (Mandrake 10.1 os)
                       ^^^^^^^                 ^^^^^^^^
                          ??? Solaris or Mandrake?

> using the --enable-shared and --with-python options.

--with-python is only for 1), server-side programming.

> but I can't seem to do stuff with both!

Commands typed and actual results obtained? Otherwise, noone can help
you.

> I read up and decided that I needed PyGreSQL

No.


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend