Amin Abdulghani | 1 Apr 2003 22:01

Integrity error

Hi,

It seems v 1.0.15.1 throws Integrity Error even in cases 
its not supposed to. For example I noticed it throws it in 
cases when we do a selct on a table that doesn't exist. 
Previouse in v1.0.10 it used to throw ProgrammingError.

Looking at the code (cursor.c) line 867:

  if (asprintf(&errstr, "%s\n%s", pgerr, query) >= 0) {
      if (!strncmp(pgerr, "ERROR:  Cannot insert a 
duplicate key", 37)
          || !strncmp(pgerr, "ERROR:  ExecAppend: Fail to 
add null", 36)
          || !strstr(pgerr, "referential integrity 
violation"))
          PyErr_SetString(IntegrityError, errstr);

Shouldn't !strstr be strstr.

Thanks..
Amin
Federico Di Gregorio | 1 Apr 2003 22:53
Favicon
Gravatar

Re: Integrity error

Il mar, 2003-04-01 alle 22:01, Amin Abdulghani ha scritto:
> Hi,
> 
> It seems v 1.0.15.1 throws Integrity Error even in cases 
> its not supposed to. For example I noticed it throws it in 
> cases when we do a selct on a table that doesn't exist. 
> Previouse in v1.0.10 it used to throw ProgrammingError.
> 
> Looking at the code (cursor.c) line 867:
> 
> 
>   if (asprintf(&errstr, "%s\n%s", pgerr, query) >= 0) {
>       if (!strncmp(pgerr, "ERROR:  Cannot insert a 
> duplicate key", 37)
>           || !strncmp(pgerr, "ERROR:  ExecAppend: Fail to 
> add null", 36)
>           || !strstr(pgerr, "referential integrity 
> violation"))
>           PyErr_SetString(IntegrityError, errstr);
> 
> 
> Shouldn't !strstr be strstr.

gotcha! 

(will be fixed in next release, expected tomorrow [i hope {really}]...)

--

-- 
Federico Di Gregorio
Debian GNU/Linux Developer                                fog@...
(Continue reading)

Federico Di Gregorio | 1 Apr 2003 23:41
Favicon
Gravatar

Re: [Re:] Null, None

Il lun, 2003-03-31 alle 10:14, jose ha scritto:

> Seems that function nonones isn't triggered on NULL values.
> Please Federico take a look at my attachment.

i tested it and this is the result.

date1     : 2003-04-01 (yes)
text1     : None (yes)
var1      : aa (yes)
num1      : None (yes)
float1    : None (yes)
char1     : a (yes)
int1      : 1 (yes)
interv    : 00:00:01 (yes)
time1     : 23:36:29.342356 (yes)
ts        : 2003-04-01 23:36:29.34

the only problem is with "ts" but i did not check the values in
pg_types.h. you should make sure to use the right values for your
postgresql installation *and* a recent psycopg (None conversion was
introduced in 1.0.9.)

hope this helps,
federico

Federico Di Gregorio | 2 Apr 2003 17:04
Favicon
Gravatar

ANNOUNCE: dropping 1.0.x series

with the release of psycopg 1.1.3 i am officially dropping the 1.0.x
series.

if enough people ask, i'll backport a couple of fixes from 1.1.3 to
1.0.15.3 and make available a tarball but there will be no announce or
further support.

1.1.3 is as much as stable as 1.0.15.2, please switch to it, if you can.

federico

--

-- 
Federico Di Gregorio
Debian GNU/Linux Developer                                fog@...
INIT.D Developer                                           fog@...
   Lasciate che i furetti vengano a me. -- Maria Luisa Benedetta Panzani
Federico Di Gregorio | 2 Apr 2003 17:09
Favicon
Gravatar

RELEASE: psycopg 1.1.3

The bug reported by Amin Abdulghani was grave enough to need instant
fix. This is a bug-fixing release, with no new features. NEWS excerpt
attached at the end of this message, download from usual location:

	http://initd.org/pub/software/psycopg/psycopg-1.1.3.tar.gz

big changes in future releases will be:

     1. moving away from autotools (entering setup.py)
     2. dropping support for python 2.1 (unless somebody really needs
        it)
     3. using builtin datetime objects in python 2.3
     4. and obviously fixing the open problems (mainly in ZPsycopgDA)

ciao,
federico

psycopg news for 1.1.3
----------------------

* Fixed problem with psycopg always reporting IntegrityError.

* Fixed segfault in debug statements.

* Now Python GIL is unlocked during PQconnectdb() calls (better
  multithreading.)

--

-- 
Federico Di Gregorio
Debian GNU/Linux Developer                                fog@...
(Continue reading)

Yury Don | 2 Apr 2003 17:23
Picon

Re: RELEASE: psycopg 1.1.3

Hello Federico,

Wednesday, April 2, 2003, 9:09:03 PM, you wrote:

FDG> big changes in future releases will be:

FDG>      1. moving away from autotools (entering setup.py)
FDG>      2. dropping support for python 2.1 (unless somebody really needs
FDG>         it)

But what about those who use it with zope???? Zope still
work quaranteed only with python 2.1

--

-- 
Best regards,
 Yury                            mailto:yura@...
Indrek Järve | 2 Apr 2003 17:38
Picon

Re: RELEASE: psycopg 1.1.3

> big changes in future releases will be:
> 
>      2. dropping support for python 2.1 (unless somebody really needs
>         it)

May I ask, what is the reasoning behind this change?
If this item would be up for a vote, I'd vote to keep it, as I still
have several systems running Debian stable (Python 2.1.3) and even the
latest Zope (2.6.1) binary package comes with 2.1.

Regards,
Indrek.
Federico Di Gregorio | 2 Apr 2003 17:28
Favicon
Gravatar

Re: RELEASE: psycopg 1.1.3

Il mer, 2003-04-02 alle 17:23, Yury Don ha scritto:
> Hello Federico,
> 
> Wednesday, April 2, 2003, 9:09:03 PM, you wrote:
> 
> FDG> big changes in future releases will be:
> 
> FDG>      1. moving away from autotools (entering setup.py)
> FDG>      2. dropping support for python 2.1 (unless somebody really needs
> FDG>         it)
> 
> But what about those who use it with zope???? Zope still
> work quaranteed only with python 2.1

you can always use older 1.0.x or 1.1.3. hey are both quite stable and i
don't plan any enhancements for ZPsycopgDA (so you won't lose anything).
--

-- 
Federico Di Gregorio
Debian GNU/Linux Developer                                fog@...
INIT.D Developer                                           fog@...
  99.99999999999999999999% still isn't 100% but sometimes suffice. -- Me

Federico Di Gregorio | 2 Apr 2003 17:30
Favicon
Gravatar

Re: RELEASE: psycopg 1.1.3

Il mer, 2003-04-02 alle 17:38, Indrek Järve ha scritto:
> > big changes in future releases will be:
> > 
> >      2. dropping support for python 2.1 (unless somebody really needs
> >         it)
> 
> May I ask, what is the reasoning behind this change?
> If this item would be up for a vote, I'd vote to keep it, as I still
> have several systems running Debian stable (Python 2.1.3) and even the
> latest Zope (2.6.1) binary package comes with 2.1.

mm.. two instant negative answers. ok, item 2 is cancelled.

--

-- 
Federico Di Gregorio
Debian GNU/Linux Developer                                fog@...
INIT.D Developer                                           fog@...
                              Viviamo in un mondo reale, Ciccio. -- Lucy
Charlie Clark | 3 Apr 2003 10:07

re: Future versions


On 2003-04-03 at 06:31:57 [+0200], psycopg-request@... wrote:
>      2. dropping support for python 2.1 (unless somebody really needs
>         it)
>      3. using builtin datetime objects in python 2.3

2.3 is still in development and 2.1.3 is what I have on my server which is 
controlled by the ISP so a move isn't easy for me. Furthermore, I'm falling 
further behind with my Windows version (1.0.12) which I need for 
development and demonstration. I know Federico can't produce a windows 
binary driver, is there anyone else on the list who needs it?

Charlie

Gmane