pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedPython + PostgreSQL
11+ messages / 5 participants
[nested] [flat]
* Python + PostgreSQL
@ 2000-08-02 10:34 Antonio Navarro Navarro <hostmaster@bemarnet.es>
0 siblings, 4 replies; 11+ messages in thread
From: Antonio Navarro Navarro @ 2000-08-02 10:34 UTC (permalink / raw)
To: pgsql-interfaces@hub.org
Hi All !
I have installed postgresql-python-7.0.2-2.i386.rpm in a RedHat 6.2 box.
Where can I find documentation for this module ? I'm trying to connect to a
server but the python says 'no password supplied'
import pg
dg = pg.connect("template1", "localhost", 5432)
Regards,
Antonio Navarro Navarro
BemarNet Management
http://www.bemarnet.es
hostmaster@bemarnet.es
Tlf. +34-96-1656644
Fax. +34-96-1656514
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-02 21:48 Karl Thomas Diedrich <died9501@uidaho.edu>
parent: Antonio Navarro Navarro <hostmaster@bemarnet.es>
3 siblings, 1 reply; 11+ messages in thread
From: Karl Thomas Diedrich @ 2000-08-02 21:48 UTC (permalink / raw)
To: Antonio Navarro Navarro <hostmaster@bemarnet.es>; +Cc: pgsql-interfaces@hub.org
I used the Postgresql python package to write a program. I couldn't find
any documentation either. Examples come in the RedHat package.
I used qit like this:
from pg import DB
cnx = DB("database-name")
cnx.query("""CREATE TABLE ...""")
You can see the full application at http://deodas.sourceforge.net/. Thqe
parts in the the file DEODAS/deodas/src/deodas_mod.py under CVS web.
Karl Diedrich
died9501@uidaho.edu
http://www.uidaho.edu/~died9501/
http://deodas.sourceforge.net/
On Wed, 2 Aug 2000, Antonio Navarro Navarro wrote:
> Hi All !
>
> I have installed postgresql-python-7.0.2-2.i386.rpm in a RedHat 6.2 box.
> Where can I find documentation for this module ? I'm trying to connect to a
> server but the python says 'no password supplied'
>
> import pg
>
> dg = pg.connect("template1", "localhost", 5432)
>
> Regards,
>
> Antonio Navarro Navarro
> BemarNet Management
> http://www.bemarnet.es
> hostmaster@bemarnet.es
> Tlf. +34-96-1656644
> Fax. +34-96-1656514
>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-03 07:02 Antonio Navarro Navarro <hostmaster@bemarnet.es>
parent: Antonio Navarro Navarro <hostmaster@bemarnet.es>
3 siblings, 0 replies; 11+ messages in thread
From: Antonio Navarro Navarro @ 2000-08-03 07:02 UTC (permalink / raw)
To: Karl Thomas Diedrich <died9501@uidaho.edu>; +Cc: pgsql-interfaces@hub.org
At 14.48 2/8/00 -0700, Karl Thomas Diedrich wrote:
>I used the Postgresql python package to write a program. I couldn't find
>any documentation either. Examples come in the RedHat package.
>
>I used qit like this:
>from pg import DB
>cnx = DB("database-name")
>cnx.query("""CREATE TABLE ...""")
>
>You can see the full application at http://deodas.sourceforge.net/. Thqe
>parts in the the file DEODAS/deodas/src/deodas_mod.py under CVS web.
Hi Karl !
Yes, this works for localhost and for servers that don't need user
authentication, but I need to connect to a remote server using an specific
username and password... Anyone can help ?
Regards,
Antonio Navarro Navarro
BemarNet Management
http://www.bemarnet.es
hostmaster@bemarnet.es
Tlf. +34-96-1656644
Fax. +34-96-1656514
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-03 13:59 D'Arcy J.M. Cain <darcy@druid.net>
parent: Karl Thomas Diedrich <died9501@uidaho.edu>
0 siblings, 0 replies; 11+ messages in thread
From: darcy@druid.net @ 2000-08-03 13:59 UTC (permalink / raw)
To: Karl Thomas Diedrich <died9501@uidaho.edu>; +Cc: Antonio Navarro Navarro <hostmaster@bemarnet.es>; pgsql-interfaces@hub.org
Thus spake Karl Thomas Diedrich
> I used the Postgresql python package to write a program. I couldn't find
> any documentation either. Examples come in the RedHat package.
Look at the actual distribution either in the PostgreSQL tree or download
the package from http://www.druid.net/pygresql/ and look at the README file.
> I used qit like this:
> from pg import DB
> cnx = DB("database-name")
> cnx.query("""CREATE TABLE ...""")
The reccommended way is now;
import pg
cnx = pg.DB("database-name")
The reason for this is to make pg.error and possibly other things available.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-03 14:05 D'Arcy J.M. Cain <darcy@druid.net>
parent: Antonio Navarro Navarro <hostmaster@bemarnet.es>
3 siblings, 0 replies; 11+ messages in thread
From: darcy@druid.net @ 2000-08-03 14:05 UTC (permalink / raw)
To: Antonio Navarro Navarro <hostmaster@bemarnet.es>; +Cc: pgsql-interfaces@hub.org
Thus spake Antonio Navarro Navarro
> I have installed postgresql-python-7.0.2-2.i386.rpm in a RedHat 6.2 box.
> Where can I find documentation for this module ? I'm trying to connect to a
> server but the python says 'no password supplied'
>
> import pg
>
> dg = pg.connect("template1", "localhost", 5432)
If the server requires a password then you need to supply one here. If
you don't need a password (i.e. "psql template1" works) then try this.
import pg
dg = pg.DB("template1")
Note DB is preferred over connect but the main change is not to use localhost
to connect. The default is to use a Unix socket rather than TCP/IP to
localhost and PostgreSQL treats that differently. If localhost was just
used here for illustrative purposes and in fact you are connecting over
TCP/IP to another machine then look at pg_hba.conf to adjust permissions
or add a password to the connection call.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-04 07:01 Antonio Navarro Navarro <hostmaster@bemarnet.es>
parent: Antonio Navarro Navarro <hostmaster@bemarnet.es>
3 siblings, 2 replies; 11+ messages in thread
From: Antonio Navarro Navarro @ 2000-08-04 07:01 UTC (permalink / raw)
To: pgsql-interfaces@hub.org; +Cc: darcy@druid.net
At 10.05 3/8/00 -0400, darcy@druid.net (D'Arcy J.M. Cain) wrote:
>Thus spake Antonio Navarro Navarro
>> I have installed postgresql-python-7.0.2-2.i386.rpm in a RedHat 6.2 box.
>> Where can I find documentation for this module ? I'm trying to connect to a
>> server but the python says 'no password supplied'
>>
>> import pg
>>
>> dg = pg.connect("template1", "localhost", 5432)
>
>If the server requires a password then you need to supply one here. If
>you don't need a password (i.e. "psql template1" works) then try this.
Hi again !
How must I add the password to the call , maybe
dg = pg.connect("template1", "10.0.0.1", 5432,"username", "password") ?
and where could I find documentation for the different functions supplied
in the package ?
Regards,
Antonio Navarro Navarro
BemarNet Management
http://www.bemarnet.es
hostmaster@bemarnet.es
Tlf. +34-96-1656644
Fax. +34-96-1656514
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-04 07:33 David Lloyd-Jones <david.lloyd-jones@attcanada.ca>
parent: Antonio Navarro Navarro <hostmaster@bemarnet.es>
1 sibling, 1 reply; 11+ messages in thread
From: David Lloyd-Jones @ 2000-08-04 07:33 UTC (permalink / raw)
To: pgsql-interfaces@hub.org; Antonio Navarro Navarro <hostmaster@bemarnet.es>; +Cc: darcy@druid.net
The full text of the O'Reilly book Learning Python is online at
http://www.ibooks.com/ free of charge -- as a promotion for giving them your
e-mail address. They are a new venture hoping to sell "e-books" over the
Net, so this is a promotion to get their list started, and Learning Python
isone of the four books they make available as a freebie.
-dlj.
----- Original Message -----
From: "Antonio Navarro Navarro" <hostmaster@bemarnet.es>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-04 11:30 D'Arcy J.M. Cain <darcy@druid.net>
parent: Antonio Navarro Navarro <hostmaster@bemarnet.es>
1 sibling, 0 replies; 11+ messages in thread
From: darcy@druid.net @ 2000-08-04 11:30 UTC (permalink / raw)
To: Antonio Navarro Navarro <hostmaster@bemarnet.es>; +Cc: pgsql-interfaces@hub.org
Thus spake Antonio Navarro Navarro
> >If the server requires a password then you need to supply one here. If
> >you don't need a password (i.e. "psql template1" works) then try this.
>
> Hi again !
>
> How must I add the password to the call , maybe
>
> dg = pg.connect("template1", "10.0.0.1", 5432,"username", "password") ?
connect(dbname, host, port, opt, tty, user, passwd)
Set any unused parameters to None.
> and where could I find documentation for the different functions supplied
> in the package ?
In the README that comes with the distribution.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-04 14:04 Bob Kline <bkline@rksystems.com>
parent: David Lloyd-Jones <david.lloyd-jones@attcanada.ca>
0 siblings, 1 reply; 11+ messages in thread
From: Bob Kline @ 2000-08-04 14:04 UTC (permalink / raw)
To: David Lloyd-Jones <david.lloyd-jones@attcanada.ca>; +Cc: pgsql-interfaces@hub.org, Antonio Navarro Navarro <hostmaster@bemarnet.es>; darcy@druid.net
On Fri, 4 Aug 2000, David Lloyd-Jones wrote:
> The full text of the O'Reilly book Learning Python is online at
> http://www.ibooks.com/ free of charge -- as a promotion for giving
> them your e-mail address. They are a new venture hoping to sell
> "e-books" over the Net, so this is a promotion to get their list
> started, and Learning Python isone of the four books they make
> available as a freebie.
Interesting. Unfortunately, their home page doesn't say anything about
this. Have a more direct URL?
--
Bob Kline
mailto:bkline@rksystems.com
http://www.rksystems.com
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-04 16:31 David Lloyd-Jones <david.lloyd-jones@attcanada.ca>
parent: Bob Kline <bkline@rksystems.com>
0 siblings, 1 reply; 11+ messages in thread
From: David Lloyd-Jones @ 2000-08-04 16:31 UTC (permalink / raw)
To: Bob Kline <bkline@rksystems.com>; David Lloyd-Jones <david.lloyd-jones@attcanada.ca>; +Cc: pgsql-interfaces@hub.org; Antonio Navarro Navarro <hostmaster@bemarnet.es>; D'Arcy J.M. Cain <darcy@druid.net>
From: "Bob Kline" <bkline@rksystems.com> asks:
> On Fri, 4 Aug 2000, David Lloyd-Jones wrote:
>
> > The full text of the O'Reilly book Learning Python is online at
> > http://www.ibooks.com/ free of charge -- as a promotion for giving
> > them your e-mail address. They are a new venture hoping to sell
> > "e-books" over the Net, so this is a promotion to get their list
> > started, and Learning Python isone of the four books they make
> > available as a freebie.
>
> Interesting. Unfortunately, their home page doesn't say anything about
> this. Have a more direct URL?
>
Hi Bob,
Here's my URL for it:
http://www.ibooks.com/SiteSrvr/SSS007X9JCVYKRB0NK5CNL765KAWJ1MKEU3FG/bmrsrc/
WPgs/SiteBrowser.htm?Op=7&BIN=1&frames=1
Problem is, that addresses a cookie on my disk after I've registered for it.
You might give the first part of that, http://www.ibooks.com/SiteSrvr/, a
try and see what happens. Alternately, look for the penguin on the right
hand side of the page, and look at the fine print in its vicinity.
Cheers,
-dlj.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Python + PostgreSQL
@ 2000-08-04 17:55 Bob Kline <bkline@rksystems.com>
parent: David Lloyd-Jones <david.lloyd-jones@attcanada.ca>
0 siblings, 0 replies; 11+ messages in thread
From: Bob Kline @ 2000-08-04 17:55 UTC (permalink / raw)
To: pgsql-interfaces@hub.org
On Fri, 4 Aug 2000, David Lloyd-Jones wrote:
> You might give the first part of that,
> http://www.ibooks.com/SiteSrvr/, a try and see what happens.
> Alternately, look for the penguin on the right hand side of the
> page, and look at the fine print in its vicinity.
Tried your suggestions, and have come to the conclusion that they
decided to withdraw the offer.
--
Bob Kline
mailto:bkline@rksystems.com
http://www.rksystems.com
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2000-08-04 17:55 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-08-02 10:34 Python + PostgreSQL Antonio Navarro Navarro <hostmaster@bemarnet.es>
2000-08-02 21:48 ` Karl Thomas Diedrich <died9501@uidaho.edu>
2000-08-03 13:59 ` D'Arcy J.M. Cain <darcy@druid.net>
2000-08-03 07:02 ` Antonio Navarro Navarro <hostmaster@bemarnet.es>
2000-08-03 14:05 ` D'Arcy J.M. Cain <darcy@druid.net>
2000-08-04 07:01 ` Antonio Navarro Navarro <hostmaster@bemarnet.es>
2000-08-04 07:33 ` David Lloyd-Jones <david.lloyd-jones@attcanada.ca>
2000-08-04 14:04 ` Bob Kline <bkline@rksystems.com>
2000-08-04 16:31 ` David Lloyd-Jones <david.lloyd-jones@attcanada.ca>
2000-08-04 17:55 ` Bob Kline <bkline@rksystems.com>
2000-08-04 11:30 ` D'Arcy J.M. Cain <darcy@druid.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox