psycopg | 1 Sep 2005 04:40
Favicon
Gravatar

[psycopg] #35: ThreadedPoolConnection still references psycopg

#35: ThreadedPoolConnection still references psycopg
----------------------+-----------------------------------------------------
       Id:  35        |      Status:  new                     
Component:  psycopg2  |    Modified:  Thu Sep  1 04:40:02 2005
 Severity:  normal    |   Milestone:                          
 Priority:  normal    |     Version:  2.0beta                 
    Owner:  fog       |    Reporter:  whitekid <at> gmail.com      
----------------------+-----------------------------------------------------
 lib/pool.py still references psycopg.
 it may be psycopg2


 {{{
 --- lib/pool.py.orig
 +++ lib/pool.py
  <at>  <at>  -16,7 +16,7  <at>  <at> 
  # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 License
  # for more details.

 -import psycopg
 +import psycopg2

  try:
      from zLOG import LOG, DEBUG, INFO
  <at>  <at>  -31,7 +31,7  <at>  <at> 

  ^L

 -class PoolError(psycopg.Error):
(Continue reading)

psycopg | 1 Sep 2005 16:31
Favicon
Gravatar

[psycopg] #36: Problem with timestampz, ... and DateTime

#36: Problem with timestampz, ... and DateTime
----------------------+-----------------------------------------------------
       Id:  36        |      Status:  new                     
Component:  psycopg2  |    Modified:  Thu Sep  1 16:31:16 2005
 Severity:  normal    |   Milestone:  PSYCOPG 2.0             
 Priority:  low       |     Version:  2.0                     
    Owner:  fog       |    Reporter:  mage <at> mordor.ath.cx      
----------------------+-----------------------------------------------------
 Hello,

 I'm using psycopg2 with postgresql 7.4 and I noticed that timestamptz,
 interval, ... types aren't quoted when INSERT.
 In db1 I 'SELECT mycol FROM mytable', mycol is a timestamptz type and is
 converted as a Python DateTime type,
 Later I had to insert this field in another database, let's say db2. I run
 psycopg.execute('INSERT INTO mytable(mycol) values (%s), (valuefromdb1))'
 it fails because the returned query to postgresql is : INSERT INTO
 mytable(mycol) VALUES (2004-08-21 15:35:12.12). The returned query should
 be INSERT INTO mytable(mycol) VALUES ('2004-08-21 15:35:12.12'). I tried
 to quote the values, but if I do that, I get 'None' strings (quite
 logical). I resolved my problem by creating a little Python function :

 def quote(value):
     if isinstance(value, str):
         return psycopg.QuotedString(str)
     else:
         return None

--

-- 
Ticket URL: <http://initd.org/tracker/psycopg/ticket/36>
(Continue reading)

psycopg | 1 Sep 2005 16:32
Favicon
Gravatar

[psycopg] #37: Builds incorrectly on Sparc

#37: Builds incorrectly on Sparc
----------------------+-----------------------------------------------------
       Id:  37        |      Status:  new                     
Component:  psycopg2  |    Modified:  Thu Sep  1 16:31:58 2005
 Severity:  normal    |   Milestone:                          
 Priority:  normal    |     Version:  2.0beta                 
    Owner:  fog       |    Reporter:  agthorr <at> barsoom.org     
----------------------+-----------------------------------------------------
 I have a Solaris system which does not have the round() function in libc.
 psycopg2 builds OK, but chokes when I try to load it as a module because
 the dynamic linker can't find round().  If I modify config.h to define the
 built-in round() (as is done for Windows and FreeBSD) it works fine.  It'd
 be nice if it worked out of the box. ;)

 Information on my system:
 {{{
   ix:~/src/crawler$ showrev
   Hostname: ix
   Hostid: 83149731
   Release: 5.9
   Kernel architecture: sun4u
   Application architecture: sparc
   Hardware provider: Sun_Microsystems
   Domain: cs.uoregon.edu
   Kernel version: SunOS 5.9 Generic 112233-12 Mar 2004
   ix:~/src/crawler$
 }}}

--

-- 
Ticket URL: <http://initd.org/tracker/psycopg/ticket/37>
(Continue reading)

Federico Di Gregorio | 1 Sep 2005 16:38
Favicon
Gravatar

Re: #36: Problem with timestampz, ... and DateTime

Il giorno gio, 01/09/2005 alle 14.31 +0000, psycopg ha scritto:
> #36: Problem with timestampz, ... and DateTime
> ----------------------+-----------------------------------------------------
>        Id:  36        |      Status:  new                     
> Component:  psycopg2  |    Modified:  Thu Sep  1 16:31:16 2005
>  Severity:  normal    |   Milestone:  PSYCOPG 2.0             
>  Priority:  low       |     Version:  2.0                     
>     Owner:  fog       |    Reporter:  mage@...      
> ----------------------+-----------------------------------------------------
>  Hello,
> 
>  I'm using psycopg2 with postgresql 7.4 and I noticed that timestamptz,
>  interval, ... types aren't quoted when INSERT.

This is fixed in SVN trunk and will be in next release.

--

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog@...
INIT.D Developer                                           fog@...
  We should forget about small efficiencies, say about 97% of the
   time: premature optimization is the root of all evil.    -- D.E.Knuth
_______________________________________________
Psycopg mailing list
Psycopg@...
http://lists.initd.org/mailman/listinfo/psycopg
psycopg | 2 Sep 2005 14:27
Favicon
Gravatar

[psycopg] #38: Missing Debug-Info from Psycopg

#38: Missing Debug-Info from Psycopg
----------------------+-----------------------------------------------------
       Id:  38        |      Status:  new                           
Component:  psycopg2  |    Modified:  Fri Sep  2 14:27:00 2005      
 Severity:  wishlist  |   Milestone:                                
 Priority:  low       |     Version:  2.0beta                       
    Owner:  fog       |    Reporter:  bernd.borstel <at> ikp-stuttgart.de
----------------------+-----------------------------------------------------
 Hello,

   having switched lately to Psycopg 2 (psycopg2-2.0b4, Thank You!) AND to
 Silva I am not quite sure to turn to the right list:

 Since (?) Psycopg 2 it has got more difficult to deal with (own)
 programming and syntax errors, because since then we had clear error
 messages in the ZMI or on the actual page like:

 Error, psycopg.ProgrammingError: ERROR: Attribute 'muname' not found
 select mnname, mvname, muname from imitarbeiter where mit_id = 7 ;

 Now we have :

 Error Value: global name 'OperationalError' is not defined

 Of course, one can look into the error log, but mostly the Messages in the
 ZMI have been very helpfull.
 I am a not very experienced Zope-User, so all I can do is to tell You
 about it.

 Thank You!
(Continue reading)

Greg Schlut | 2 Sep 2005 20:09

import errors on redhat

I just installed psycopg2.2.0b4 on a redhat7.1 system.  When I import 
psycopg2 I recieve these errors.  What could causing this?

Python 2.3.5 (#1, Sep  2 2005, 12:01:29)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import psycopg2
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/lib/python2.3/site-packages/psycopg2/__init__.py", line 
24, in ?
     from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: /usr/lib/python2.3/site-packages/psycopg2/_psycopg.so: 
undefined symbol: __ctype_tolower_loc
 >>>

Thanks,
	Greg
Clodoaldo Pinto | 5 Sep 2005 12:46
Picon

execute prepared

I'm using PyGreSQL bundled in the fedora postgresql rpms. I'm
wondering if Psycopg could help me.

I'm doing this:

cursor.execute("prepare ins (int, int, float4, float4, float4, float4,
int, int, int, int, int, int, int, int, int, int, int) as \
    insert into usuarios_producao_temp (\
    usuario,\
    n_time,\
    pontos_0,\
    pontos_24,\
    pontos_7,\
    pontos_14,\
    wus_0,\
    wus_24,\
    wus_7,\
    rank_0,\
    rank_0_time,\
    rank_24,\
    rank_24_time,\
    rank_7,\
    rank_7_time,\
    rank_30,\
    rank_30_time\
    )\
    values ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17);")
cursor.execute("select * from usuarios_producao_matriz")
ins = db.cursor()
linha = cursor.fetchone()
(Continue reading)

psycopg | 7 Sep 2005 12:50
Favicon
Gravatar

[psycopg] #39: Two ZPsycoPG with Unicode and Not Unicode

#39: Two ZPsycoPG with Unicode and Not Unicode
----------------------+-----------------------------------------------------
       Id:  39        |      Status:  new                     
Component:  psycopg1  |    Modified:  Wed Sep  7 12:50:39 2005
 Severity:  normal    |   Milestone:                          
 Priority:  normal    |     Version:  1.1.19                  
    Owner:  fog       |    Reporter:  axel <at> straschil.com      
----------------------+-----------------------------------------------------
 Hello!

 I'm using latest psycopg 1.* / ZPsycoPG, Python 2.4, Zope 2.7.*, PG 8.0
 following is behaviour is on two different machines, Gentoo and RedHat.

 I've a Zope instance with to ZPsycoPG databaseconnections to databases
 on the same server:

 zpsycopg1 to database1, the database Encoding is SQL_ASCII
 zpsycopg2 to database2, the database Encoding is UNICODE

 zpsycopg1 should be set to Backend encoding UTF-8, Output Unicode
 strings unset.
 zpsycopg2 should be set to Backend encoding UTF-8, Output Unicode
 strings activated.

 This does not work, it seems the if I activate "Output Unicode strings"
 for one zpsycopg that this would be used for all zpsycopg's, and vice
 versa if i deactivate it for one, it would not be used for all
 (But in the management interface, it is shown right).

 Ist it possible that I can't mix that?
(Continue reading)

psycopg | 7 Sep 2005 18:20
Favicon
Gravatar

[psycopg] #40: Zope + PsycoPg

#40: Zope + PsycoPg
----------------------+-----------------------------------------------------
       Id:  40        |      Status:  new                     
Component:  psycopg1  |    Modified:  Wed Sep  7 18:20:49 2005
 Severity:  normal    |   Milestone:                          
 Priority:  normal    |     Version:  1.1.18                  
    Owner:  fog       |    Reporter:  markon                  
----------------------+-----------------------------------------------------
 I've just installed Zope + PsycoPg, but I cannot view "Z PsycoPG" list
 entry in Zope [http://server:8080/manage]


 Compile command:
 ./configure
 --with-zope=/var/lib/zope/
 --with-mxdatetime-includes=/usr/lib/python2.3/site-
 packages/mx/DateTime/mxDateTime
 --with-postgres-includes=/usr/include/postgresql
 --with-python=/usr/lib/python2.3

 My configuration:
 * Fedora Core 2
 * Python 2.3.5 (precompiled from RPM)
 * Zope 2.8 (precompiled from RPM)
 * PsycoPg compiled succesfuly

 Misc information:
 * ls /usr/lib/python2.3/lib-dynload/
  [ ...output ommited...]
  psycopgmodule.so
  [ ...output ommited...]
(Continue reading)

Federico Di Gregorio | 7 Sep 2005 18:16
Favicon
Gravatar

Re: psycopg + zope problem

Il giorno mer, 07/09/2005 alle 18.01 +0200, Martin Konicek ha scritto:
> Hi,
> 
> I've just installed Zope + PsycoPg, but I cannot view "Z PsycoPG" list
> entry in Zope [http://server:8080/manage]

Make sure you're using the same Python for Zope and psycopg. Sometimes a
pre-package Zope comes with its own Python and compilign psycopg with a
different one simply won't work.

federico

--

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog@...
INIT.D Developer                                           fog@...
  There are 10 types of people in this world, those that understand
   binary, and those that don't.                   -- Michael Gittelsohn
_______________________________________________
Psycopg mailing list
Psycopg@...
http://lists.initd.org/mailman/listinfo/psycopg

Gmane