You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(18) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(11) |
Feb
(7) |
Mar
(7) |
Apr
(7) |
May
(17) |
Jun
(33) |
Jul
(19) |
Aug
(3) |
Sep
(19) |
Oct
(18) |
Nov
(27) |
Dec
(13) |
2003 |
Jan
(12) |
Feb
(8) |
Mar
(11) |
Apr
(42) |
May
(19) |
Jun
(49) |
Jul
(23) |
Aug
(12) |
Sep
(2) |
Oct
(8) |
Nov
(8) |
Dec
(13) |
2004 |
Jan
(13) |
Feb
(2) |
Mar
(7) |
Apr
(7) |
May
(6) |
Jun
(13) |
Jul
(4) |
Aug
(12) |
Sep
(6) |
Oct
(6) |
Nov
(50) |
Dec
(10) |
2005 |
Jan
(20) |
Feb
(20) |
Mar
(2) |
Apr
(10) |
May
(12) |
Jun
(7) |
Jul
|
Aug
(4) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
(2) |
Feb
(2) |
Mar
(5) |
Apr
(6) |
May
(3) |
Jun
(17) |
Jul
(2) |
Aug
(8) |
Sep
(1) |
Oct
(5) |
Nov
(3) |
Dec
(2) |
2007 |
Jan
(2) |
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2009 |
Jan
(2) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Gerhard <ger...@gm...> - 2002-07-04 05:51:43
|
* Ricardo Rivaldo <ri...@tr...> [2002-07-04 00:53 -0300]: > Does anyone have a sample source code on how to use pyPgSQL? Please > send me if you have! Unfortunately, the code I have is a little hard to understand, or using features that aren't even in CVS, yet [1]. All I can currently offer are the examples/ directory of the pyPgSQL source distribution. Also, this entry of our FAQ might help: http://pypgsql.sourceforge.net/pypgsql-faq.html#id2713923 I know the current state is suboptimal, and writing a manual has been on my TODO list for a while. If you're stuck, just ask here. Gerhard [1] I have started a little PostgreSQL admin utility in pyPgSQL/wxPython just for fun. -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930 public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) |
From: Ricardo R. <ri...@tr...> - 2002-07-04 03:53:39
|
RG9lcyBhbnlvbmUgaGF2ZSBhIHNhbXBsZSBzb3VyY2UgY29kZSBvbiBob3cgdG8gdXNlIHB5UGdT UUwgPyBQbGVhc2Ugc2VuZCBtZSBpZiB5b3UgaGF2ZSAhDQogDQpSaXZhbGRvDQo= |
From: Dave S. <Dst...@em...> - 2002-06-14 16:59:15
|
I used your code: from pyPgSQL import PgSQL db = PgSQL.connect('postgresql_IP::database_name:user_login:password_for_user_in_postgresql::') cursor = db.cursor() cursor.execute("select * from xamemails WHERE aclcomment = 'Virus Detected'") result = cursor.fetchall() for row in result: print row.tstamp, row.tx, row.rx ... and it works like a champ - thanks! FAQ for newbies: [1] Make sure the locate pg_hba.conf file on the server is correct for your system/workstation. [2] Make sure the username you use for PostgreSQL has a password assigned to it before you use it in your code. [3] In the Windows version, and interpreter for Python is also an editor. Watch out for being in the wrong 'mode'. [4] In the Windows version, you need to save your file before you press F5 and run it. >>> Michael Watkins <wa...@tr...> 06/13/02 07:04PM >>> At 04:29 PM 6/13/2002 -0400, Dave Strickler wrote: > > I tried to to this, and the "from" command worked, and I got a lot > > further. But, as you can see from below, it wasn't 100% sucsessful. Any > > clues as to what is going wrong? I made a pg_hba.conf in the PgSQL > > directory, and added in my 10.0.0.120 address (that's my workstation), > > but it didn't help. You are getting close but not quite... Note!! pg_hba.conf does not go in the PgSQL directory... but in your PostgreSQL server's **data** directory... something like /usr/local/pgsql/data if you have not moved it. Try at the command line locate pg_hba.conf which should show you the path to some sample and the actual conf file. In that file have: host all 10.0.0.120 255.255.255.0 trust ... for now, just to be sure authentication isn't an issue. |
From: Dave S. <Dst...@em...> - 2002-06-14 16:37:54
|
Well that's a little nugget of knowledge I was missing! I thought the file belonged on my end... I updated the file on my server in /usr/local/pgsql/var under RedHat installation, and have definitely gotten further. Will play with Python a little more today and see if I can get things going. Thanks for all your help! Dave Strickler CEO DWS - "The GroupWise Integration Experts" Boston * Austin * Belgium * Denmark http://www.emailsolutions.com (800) 999-5412 x10 ------------------------------------ Want to get rid of SPAM, Viruses, and unwanted content? MailWise Filter - "The E-Mail Firewall (tm) for Your Company" See http://www.emailsolutions.com/MailWise >>> Michael Watkins <wa...@tr...> 06/13/02 07:04PM >>> At 04:29 PM 6/13/2002 -0400, Dave Strickler wrote: > > I tried to to this, and the "from" command worked, and I got a lot > > further. But, as you can see from below, it wasn't 100% sucsessful. Any > > clues as to what is going wrong? I made a pg_hba.conf in the PgSQL > > directory, and added in my 10.0.0.120 address (that's my workstation), > > but it didn't help. You are getting close but not quite... Note!! pg_hba.conf does not go in the PgSQL directory... but in your PostgreSQL server's **data** directory... something like /usr/local/pgsql/data if you have not moved it. Try at the command line locate pg_hba.conf which should show you the path to some sample and the actual conf file. In that file have: host all 10.0.0.120 255.255.255.0 trust ... for now, just to be sure authentication isn't an issue. |
From: Michael W. <wa...@tr...> - 2002-06-13 23:04:13
|
At 04:29 PM 6/13/2002 -0400, Dave Strickler wrote: > > I tried to to this, and the "from" command worked, and I got a lot > > further. But, as you can see from below, it wasn't 100% sucsessful. Any > > clues as to what is going wrong? I made a pg_hba.conf in the PgSQL > > directory, and added in my 10.0.0.120 address (that's my workstation), > > but it didn't help. You are getting close but not quite... Note!! pg_hba.conf does not go in the PgSQL directory... but in your PostgreSQL server's **data** directory... something like /usr/local/pgsql/data if you have not moved it. Try at the command line locate pg_hba.conf which should show you the path to some sample and the actual conf file. In that file have: host all 10.0.0.120 255.255.255.0 trust ... for now, just to be sure authentication isn't an issue. |
From: bob a. <rd...@pa...> - 2002-06-13 21:59:53
|
On Thursday, June 13, 2002, at 02:04 PM, Dave Strickler wrote: > Gerhard, > =A0 > First off, thanks for your help in this one. While I am a pretty good=20= > program, my experience is in Windows and VMS - Unix is still very new = to=20 > me, and full of lots of struggles. I do like it, but its a steep = learning=20 > curve... > =A0 > I tried the settings you had in your pg_hba.conf file, and alterted it = to=20 > look like: > =A0 > host=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 127.0.0.1=A0=A0=A0=A0= 255.255.255.255=A0=A0=A0 trust > host=A0=A0=A0=A0=A0=A0 all=A0=A0=A0=A0=A0=A0=A0=A0 10.0.0.120=A0 = 255.255.255.0=A0=A0=A0=A0=A0 md5 don't know if this helps. but this is what i have in conf: local all trust host all 127.0.0.1 255.255.255.255 trust perhaps you need an entry for 'local' |
From: Dave S. <Dst...@em...> - 2002-06-13 21:05:45
|
Gerhard, First off, thanks for your help in this one. While I am a pretty good program, my experience is in Windows and VMS - Unix is still very new to me, and full of lots of struggles. I do like it, but its a steep learning curve... I tried the settings you had in your pg_hba.conf file, and alterted it to look like: host all 127.0.0.1 255.255.255.255 trust host all 10.0.0.120 255.255.255.0 md5 My workstation running Python (windows version for now) is on the 10.0.0.120 IP address. Should I put an entry in for root? I now the postmaster is started with an "-i" as I can connect via telnet to the port. Thanks for all your help. I hope I can return the favor some day. Dave Strickler CEO DWS - "The GroupWise Integration Experts" Boston * Austin * Belgium * Denmark http://www.emailsolutions.com (800) 999-5412 x10 ------------------------------------ Want to get rid of SPAM, Viruses, and unwanted content? MailWise Filter - "The E-Mail Firewall (tm) for Your Company" See http://www.emailsolutions.com/MailWise >>> Gerhard =?unknown-8bit?Q?H=E4ring?= <ger...@gm...> 06/13/02 04:43PM >>> * Dave Strickler < Dst...@em... > [2002-06-13 16:29 -0400]: > Hmmm.... Still getting: > DatabaseError: FATAL 1: No pg_hba.conf entry for host 10.0.0.120, user > root, database xamime > > The problem here being I don't know what I'm doing wrong. Is this a > syntax issue, a rights issue, or a bug (doubt it the latter). A rights and thus a PostgreSQL configuration issue. The pg_hba.conf file must be configured to allow you this access and the postmaster must be started with the option "-i" to listen on TCP/IP connections at all (default is not to). Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB43C0 public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Pypgsql-users mailing list Pyp...@li... https://lists.sourceforge.net/lists/listinfo/pypgsql-users |
From: Gerhard <ger...@gm...> - 2002-06-13 20:45:16
|
* Dave Strickler <Dst...@em...> [2002-06-13 16:29 -0400]: > Hmmm.... Still getting: > DatabaseError: FATAL 1: No pg_hba.conf entry for host 10.0.0.120, user > root, database xamime > > The problem here being I don't know what I'm doing wrong. Is this a > syntax issue, a rights issue, or a bug (doubt it the latter). A rights and thus a PostgreSQL configuration issue. The pg_hba.conf file must be configured to allow you this access and the postmaster must be started with the option "-i" to listen on TCP/IP connections at all (default is not to). Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB43C0 public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) |
From: Dave S. <Dst...@em...> - 2002-06-13 20:30:02
|
Hmmm.... Still getting: Dave Strickler CEO DWS - "The GroupWise Integration Experts" Boston * Austin * Belgium * Denmark http://www.emailsolutions.com (800) 999-5412 x10 ------------------------------------ Want to get rid of SPAM, Viruses, and unwanted content? MailWise Filter - "The E-Mail Firewall (tm) for Your Company" See http://www.emailsolutions.com/MailWise >>> from pyPgSQL import PgSQL >>> db = PgSQL.connect(database='xamime', user='root', host='10.0.0.21') Traceback (most recent call last): File "<pyshell#2>", line 1, in ? db = PgSQL.connect(database='xamime', user='root', host='10.0.0.21') File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 1591, in connect return Connection(connInfo) File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 1689, in __init__ raise DatabaseError, m DatabaseError: FATAL 1: No pg_hba.conf entry for host 10.0.0.120, user root, database xamime The problem here being I don't know what I'm doing wrong. Is this a syntax issue, a rights issue, or a bug (doubt it the latter). TIA, >>> "Billy G. Allie" <Bil...@mu...> 06/13/02 03:17PM >>> "Dave Strickler" wrote: > I tried to to this, and the "from" command worked, and I got a lot > further. But, as you can see from below, it wasn't 100% sucsessful. Any > clues as to what is going wrong? I made a pg_hba.conf in the PgSQL > directory, and added in my 10.0.0.120 address (that's my workstation), > but it didn't help. > > Any clues? > ======================================== > > >>> dsn = "dbname='xamime' user='root' host='10.0.0.21'" > >>> db = PgSQL.connect(dsn) The syntax for connect requires either a string in the form of: 'host:port:database:user:password:options:tty' i.e: dsn = '10.0.0.21::xamime:root' db = PgSQL.connect(dsn) or passing named parameters: db = PgSQL.connect(database='xamime', user='root', host='10.0.0.21') See the README file and the DB-API 2.0 spec for more details. Later. ___________________________________________________________________________ ____ | Billy G. Allie | Domain....: Bil...@mu... | /| | 7436 Hartwell | MSN.......: B_G...@em... |-/-|----- | Dearborn, MI 48126| |/ |LLIE | (313) 582-1540 | _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Pypgsql-users mailing list Pyp...@li... https://lists.sourceforge.net/lists/listinfo/pypgsql-users |
From: Billy G. A. <Bil...@mu...> - 2002-06-13 19:18:21
|
"Dave Strickler" wrote: > I tried to to this, and the "from" command worked, and I got a lot > further. But, as you can see from below, it wasn't 100% sucsessful. Any > clues as to what is going wrong? I made a pg_hba.conf in the PgSQL > directory, and added in my 10.0.0.120 address (that's my workstation), > but it didn't help. > > Any clues? > ======================================== > > >>> dsn = "dbname='xamime' user='root' host='10.0.0.21'" > >>> db = PgSQL.connect(dsn) The syntax for connect requires either a string in the form of: 'host:port:database:user:password:options:tty' i.e: dsn = '10.0.0.21::xamime:root' db = PgSQL.connect(dsn) or passing named parameters: db = PgSQL.connect(database='xamime', user='root', host='10.0.0.21') See the README file and the DB-API 2.0 spec for more details. Later. ___________________________________________________________________________ ____ | Billy G. Allie | Domain....: Bil...@mu... | /| | 7436 Hartwell | MSN.......: B_G...@em... |-/-|----- | Dearborn, MI 48126| |/ |LLIE | (313) 582-1540 | |
From: Gerhard <ger...@gm...> - 2002-06-13 02:54:23
|
* Dave Strickler <Dst...@em...> [2002-06-12 22:22 -0400]: > I tried to to this, and the "from" command worked, and I got a lot > further. But, as you can see from below, it wasn't 100% sucsessful. Any > clues as to what is going wrong? I made a pg_hba.conf in the PgSQL > directory, and added in my 10.0.0.120 address (that's my workstation), > but it didn't help. Did you restart or reload the PostgreSQL server? Here's my pg_hba.conf: host all 127.0.0.1 255.255.255.255 trust host all 192.168.2.10 255.255.255.0 md5 The md5 auth requires Pg 7.2.x, IIRC. Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930 public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) |
From: Dave S. <Dst...@em...> - 2002-06-13 02:22:46
|
I tried to to this, and the "from" command worked, and I got a lot further. But, as you can see from below, it wasn't 100% sucsessful. Any clues as to what is going wrong? I made a pg_hba.conf in the PgSQL directory, and added in my 10.0.0.120 address (that's my workstation), but it didn't help. Any clues? ======================================== >>> dsn = "dbname='xamime' user='root' host='10.0.0.21'" >>> db = PgSQL.connect(dsn) Traceback (most recent call last): File "<pyshell#17>", line 1, in ? db = PgSQL.connect(dsn) File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 1591, in connect return Connection(connInfo) File "C:\PYTHON22\Lib\site-packages\pyPgSQL\PgSQL.py", line 1689, in __init__ raise DatabaseError, m DatabaseError: FATAL 1: No pg_hba.conf entry for host 10.0.0.120, user root, database root >>> Michael Watkins <wa...@tr...> 06/12/02 09:43PM >>> Close... from pyPgSQL import PgSQL dsn = 'dbname=yourdb user=youruser host=yourhost' db = PgSQL.connect(dsn) cursor = db.cursor() and now... cursor.execute("select * from something") result = cursor.fetchall() for row in result: print row.acolumn, row.anothercolumn happy experimenting... Mike At 09:30 PM 6/12/2002 -0400, Dave Strickler wrote: >You're gonna think I'm whacko, but actually, I have read those docs. What >I'm missing, is what do I load ( I think its "import PgSQL") so that I can >use the connect command etc. > >When I start up Python, it doesn't understand any of the pypgsql commands, >and I assume that's b/c I need to load a library... _______________________________________________________________ Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ _______________________________________________ Pypgsql-users mailing list Pyp...@li... https://lists.sourceforge.net/lists/listinfo/pypgsql-users |
From: Dave S. <Dst...@em...> - 2002-06-13 01:57:18
|
That's exectly what I needed - Thanks! "from pyPgSQL import PgSQL" ahhh...... Dave Strickler CEO DWS - "The GroupWise Integration Experts" Boston * Austin * Belgium * Denmark http://www.emailsolutions.com (800) 999-5412 x10 ------------------------------------ Want to get rid of SPAM, Viruses, and unwanted content? MailWise Filter - "The E-Mail Firewall (tm) for Your Company" See http://www.emailsolutions.com/MailWise >>> Michael Watkins <wa...@tr...> 06/12/02 09:43PM >>> Close... from pyPgSQL import PgSQL dsn = 'dbname=yourdb user=youruser host=yourhost' db = PgSQL.connect(dsn) cursor = db.cursor() and now... cursor.execute("select * from something") result = cursor.fetchall() for row in result: print row.acolumn, row.anothercolumn happy experimenting... Mike At 09:30 PM 6/12/2002 -0400, Dave Strickler wrote: >You're gonna think I'm whacko, but actually, I have read those docs. What >I'm missing, is what do I load ( I think its "import PgSQL") so that I can >use the connect command etc. > >When I start up Python, it doesn't understand any of the pypgsql commands, >and I assume that's b/c I need to load a library... |
From: Michael W. <wa...@tr...> - 2002-06-13 01:43:05
|
Close... from pyPgSQL import PgSQL dsn = 'dbname=yourdb user=youruser host=yourhost' db = PgSQL.connect(dsn) cursor = db.cursor() and now... cursor.execute("select * from something") result = cursor.fetchall() for row in result: print row.acolumn, row.anothercolumn happy experimenting... Mike At 09:30 PM 6/12/2002 -0400, Dave Strickler wrote: >You're gonna think I'm whacko, but actually, I have read those docs. What >I'm missing, is what do I load ( I think its "import PgSQL") so that I can >use the connect command etc. > >When I start up Python, it doesn't understand any of the pypgsql commands, >and I assume that's b/c I need to load a library... |
From: Dave S. <Dst...@em...> - 2002-06-13 01:31:31
|
You're gonna think I'm whacko, but actually, I have read those docs. What I'm missing, is what do I load ( I think its "import PgSQL") so that I can use the connect command etc. When I start up Python, it doesn't understand any of the pypgsql commands, and I assume that's b/c I need to load a library... Dave Strickler CEO DWS - "The GroupWise Integration Experts" Boston * Austin * Belgium * Denmark http://www.emailsolutions.com (800) 999-5412 x10 ------------------------------------ Want to get rid of SPAM, Viruses, and unwanted content? MailWise Filter - "The E-Mail Firewall (tm) for Your Company" See http://www.emailsolutions.com/MailWise >>> Gerhard =?iso-8859-15?Q?H=E4ring?= <ge...@bi...> 06/12/02 06:24PM >>> * Dave Strickler < Dst...@em... > [2002-06-12 17:23 -0400]: > Thanks for the tips! > > What I am looking for is even one step above that. When I load up > Python, how do I tell is to import the PgSQL library so that it > understands these commands? Oops. 100.00 % new to Python? There is a python (or python.exe, depending on the OS) interpreter. It can be used interactively for trying out stuff, like this transcript shows: gerhard@lilith:~$ python Python 2.2.1 (#1, Apr 21 2002, 08:38:44) [GCC 2.95.4 20011002 (Debian prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from pyPgSQL import PgSQL >>> print "hello" hello >>> print 4+5 9 >>> from pyPgSQL import PgSQL >>> conn = PgSQL.connect() >>> cursor = conn.cursor() >>> cursor.execute("select * from test") >>> print cursor.fetchone() [1, 'Gerhard', 25] >>> But you normally don't use Python this way except for experimenting (for this, it's very cool, though.) You normally write Python modules and scripts and put them in files, ending in .py. Several approaches are possible for the actual development cycle. Many people, me included, simple use their favourite editor to write the Python source files, than run them on the commandline. There are also IDEs available, one is even included in the Python standard distribution: IDLE. > Thanks for your help... The Python documentation, that you'll likely already have installed, includes a tutorial, which is ok if you already know programming. It's also available online: http://www.python.org/doc/current/tut/tut.html The following page lots of useful information for Python beginners and beginners to programmin in general: http://www.python.org/doc/Newbies.html I'd recommend to get familiar with Python itself first, then, after a few days install pyPgSQL and try database programming. All of the above isn't to be taken as absolute of course, it all depends on your previous experience. I believe the resources from these URLs will get you started relatively quickly. Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930 public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) |
From: Adam B. <ad...@po...> - 2002-06-12 23:08:05
|
Hallo Billy, I apologize that I haven't written before, but I had to finish some urgent projects and I haven't much time for anything else. :( Of course I downloaded pyPgSQL 2.1 as soon as it was announced here. It works very good, especially this new transaction isolation level setting, which I asked for some time ago :)) I improved most of my applications to use this feature and I am glad to see that everything is OK, and even works better than before. I wonder why people still use other Python libraries for PostgreSQL, this one is the best! :^)) > 1. Should pyPgSQL drop compatibility with versions of Python previous to > version 2.2? It really doesn't matter for me. My applications work with both Python 2.1 and 2.2 (I don't use many features of Python 2.2 yet). However, I think that it is not good for any project to keep backward compatibility -- it always equals to more complicated code. Even PostgreSQL evolves and some SQL commands and syntax become obsolete, so many programmers will have to improve their programs. The only problem arises when someone uses libraries which don't work with newer Python releases. For example something is wrong with stable branch of wxPython/wxGTK library and I still haven't figured what it could be. The application crashes (core dumped etc.) and I still have to use Pyhton 2.0 (!) to run it. Hopefully I am now switching to PyGTK and this problem will soon disappear, even if not removed by a next wxPython version. Generally, I vote for option 1! :) Regards, -- Adam Buraczewski <ad...@po...> * Linux registered user #165585 GCS/TW d- s-:+>+:- a- C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K? w-- O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI? D G++ e+++>++++ h r+>++ y? |
From: Adam B. <ad...@po...> - 2002-06-12 23:07:47
|
> I've fiddled with adding Unicode support for some time now, but I didn't get > enough testers yet to make me comfortable enough with it for adding it to a > pyPgSQL release. On the Sourceforge patches section, I've uploaded a patch for > full Unicode support, including getting Unicode results back from the database, > insert Unicode strings, and automatic encoding conversions. I'll try to update > this patch today to work with the latest pyPgSQL 2.1 release and drop you a > note when it's ready. I'm very, very sorry I haven't find time yet for testing your Unicode patch yet :((( I know that You made a huge effort to bring this functionality to pyPgSQL and that I should have help You at least with testing it. I hope I will manage to do this within two or three days, but I cannot promise anything, I'm afraid. I'd like also to ask, why is it still necessary to set the encoding twice, one time during connect() (as a "client_encoding" parameter), and the second one using "set client_encoding to ..." command? Why doesn't pyPgSQL send this command to PostgreSQL automatically? Is it something I don't understand here? :) -- Adam Buraczewski <ad...@po...> * Linux registered user #165585 GCS/TW d- s-:+>+:- a- C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K? w-- O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI? D G++ e+++>++++ h r+>++ y? |
From: Adam B. <ad...@po...> - 2002-06-12 23:07:47
|
> > One other thing for the PostgreSQL experts (ehem): am I correct that > > there is no way of knowing how many rows a cursor contains? Is it really > > the easiest solution to first do a SELECT COUNT on the same query? > Looks like so, but in the end I was able to do without knowing the total > number of rows. I'm not an expert, but I think that even PostgreSQL itself doesn't know the number of rows before all of them are fetched. Look at files at src/backend/executor directory, especially execMain.c and execProcnode.c. The main fetching loop is in ExecutePlan() function, which fetches rows one by one till ExecProcNode() returns nothing. PostgreSQL portals simply don't execute more than it is necessary to get the needed number of rows, whatever is the source of the data (a table, a view or even a SRF -- a "set returning function"). Regards, -- Adam Buraczewski <ad...@po...> * Linux registered user #165585 GCS/TW d- s-:+>+:- a- C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K? w-- O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI? D G++ e+++>++++ h r+>++ y? |
From: Adam B. <ad...@po...> - 2002-06-12 23:07:47
|
> > [Arrays vs. 'IN'] > > Right, and there's no way of knowing what the database engine expects for > > that parameter until it has parsed the statement. > Unless you also parse at the client side, which I'd rather not ;-) > There might be a solution with controlling the behaviour using a flag in the > cursor object, for example. But what will happen when someone passes many different parameters to execute() function, some of them being arrays which have to be converted to "'{one,two,three}'" and some to "('one', 'two', 'three')"? I think the only good way would be to leave current cursor object behaviour as it is and add new class (call it PgSet, for instance), which would be converted to the second form above. What do You think? I agree that it would be useful. However, there are probably many more such situations where a programmer would like to convert automatically a data structure into the SQL expression of his/her choice. I am not sure if it is really good for a general library like pyPgSQL to have so many features not covered by standards. Regards, -- Adam Buraczewski <ad...@po...> * Linux registered user #165585 GCS/TW d- s-:+>+:- a- C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K? w-- O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI? D G++ e+++>++++ h r+>++ y? |
From: Dave S. <Dst...@em...> - 2002-06-12 21:43:54
|
Thanks for the tips! What I am looking for is even one step above that. When I load up Python, how do I tell is to import the PgSQL library so that it understands these commands? Thanks for your help... Dave Strickler CEO DWS - "The GroupWise Integration Experts" Boston * Austin * Belgium * Denmark http://www.emailsolutions.com (800) 999-5412 x10 ------------------------------------ Want to get rid of SPAM, Viruses, and unwanted content? MailWise Filter - "The E-Mail Firewall (tm) for Your Company" See http://www.emailsolutions.com/MailWise >>> Gerhard =?unknown-8bit?Q?H=E4ring?= <ger...@gm...> 06/12/02 05:17PM >>> * Dave Strickler < Dst...@em... > [2002-06-12 16:26 -0400]: > I'm new to Python and pyPgSQL, and learn best by example. Is there a set > of example code I could check out? The source distribution has an examples/ subdirectory with demo code. If you see a feature you want to use that is not covered by the demos, feel free to ask here, and I (or somebody else) can give example code for that. The set of features may be a little overwhelming. From all the features available, you'll mostly need only these patterns: # Open a connection to the database conn = PgSQL.connect(<connection parameters here>) # Obtain a 'cursor'. This is normally the only object that you'll use. cursor = conn.cursor() # Execute a simple SQL statement against the database cursor.execute("insert into test(name) values ('foo')") # Execute a SQL statement with appropriate parameter substitution and quoting # of these parameters done by PyPgSQL. cursor.execute("select from test where name=%s", ("foo",)) # Iterate over all results and do something with them (here. print the 'id' # column with all three ways of column access that pyPgSQL supports) for row in cursor.fetchall(): print row.id, row[0], row["id"] # Close the cursor. cursor.close() # Close the connection. conn.close() HTH, Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB43C0 public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) _______________________________________________________________ Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ _______________________________________________ Pypgsql-users mailing list Pyp...@li... https://lists.sourceforge.net/lists/listinfo/pypgsql-users |
From: Gerhard <ger...@gm...> - 2002-06-12 21:18:57
|
* Dave Strickler <Dst...@em...> [2002-06-12 16:26 -0400]: > I'm new to Python and pyPgSQL, and learn best by example. Is there a set > of example code I could check out? The source distribution has an examples/ subdirectory with demo code. If you see a feature you want to use that is not covered by the demos, feel free to ask here, and I (or somebody else) can give example code for that. The set of features may be a little overwhelming. From all the features available, you'll mostly need only these patterns: # Open a connection to the database conn = PgSQL.connect(<connection parameters here>) # Obtain a 'cursor'. This is normally the only object that you'll use. cursor = conn.cursor() # Execute a simple SQL statement against the database cursor.execute("insert into test(name) values ('foo')") # Execute a SQL statement with appropriate parameter substitution and quoting # of these parameters done by PyPgSQL. cursor.execute("select from test where name=%s", ("foo",)) # Iterate over all results and do something with them (here. print the 'id' # column with all three ways of column access that pyPgSQL supports) for row in cursor.fetchall(): print row.id, row[0], row["id"] # Close the cursor. cursor.close() # Close the connection. conn.close() HTH, Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB43C0 public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) |
From: Dave S. <Dst...@em...> - 2002-06-12 20:27:00
|
I'm new to Python and pyPgSQL, and learn best by example. Is there a set of example code I could check out? Thanks, Dave Strickler CEO DWS - "The GroupWise Integration Experts" Boston * Austin * Belgium * Denmark http://www.emailsolutions.com (800) 999-5412 x10 ------------------------------------ Want to get rid of SPAM, Viruses, and unwanted content? MailWise Filter - "The E-Mail Firewall (tm) for Your Company" See http://www.emailsolutions.com/MailWise |
From: Gerhard <ger...@gm...> - 2002-06-09 11:27:03
|
* Gerhard Häring <ger...@gm...> [2002-06-07 20:35 +0200]: > In a current project, I needed to wrap the PostgreSQL SQL extension MOVE > FORWARD/BACKWARD to move in server-side cursors. I'd suggest to add the > following method to the Cursor class: > > def move(self, howmany) It think better to implement the optional DB-API extension Cursor Method .scroll(value[,mode='relative']) from PEP 0249. > One other thing for the PostgreSQL experts (ehem): am I correct that > there is no way of knowing how many rows a cursor contains? Is it really > the easiest solution to first do a SELECT COUNT on the same query? Looks like so, but in the end I was able to do without knowing the total number of rows. Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930 public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) |
From: Gerhard <ger...@gm...> - 2002-06-07 18:35:22
|
In a current project, I needed to wrap the PostgreSQL SQL extension MOVE FORWARD/BACKWARD to move in server-side cursors. I'd suggest to add the following method to the Cursor class: def move(self, howmany) where howmany can be a positive or negative number, which controls wether the cursor is moved backward or forward. Comments? One other thing for the PostgreSQL experts (ehem): am I correct that there is no way of knowing how many rows a cursor contains? Is it really the easiest solution to first do a SELECT COUNT on the same query? I can imagine there might be a hack with moving forward/backward by variying values to examine the number of rows in the cursor. Or is there a clean solution that I'm missing? Gerhard -- mail: gerhard <at> bigfoot <dot> de registered Linux user #64239 web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930 public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) |
From: Michael W. <wa...@tr...> - 2002-06-06 15:24:43
|
At 12:00 AM 6/6/2002 -0400, Billy G. Allie wrote: >1. Should pyPgSQL drop compatibility with versions of Python previous to >version 2.2? I'm ok with option 1, support 2.2 and on only. A normally silent pyPgSQL user... |