Re: [HACKERS] 7.3 -> pg_atoi: zero-length string

From: "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Larry Rosenman" <ler(at)lerctr(dot)org>
Cc: "Lee Kindness" <lkindness(at)csl(dot)co(dot)uk>, "postgresql" <pgsql-general(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] 7.3 -> pg_atoi: zero-length string
Date: 2002-12-03 17:17:08
Message-ID: 004501c29aef$cf858310$aa0f5ac2@canaan.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Well I already fixed all my application, it was quiet easy though more code
was entered :(

like:

if ( !is_numeric($var) )
$var = 0;

I hope the other projects will fix compliance fast.

maybe this feature should be enabled when compiling ?

----- Original Message -----
From: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Larry Rosenman" <ler(at)lerctr(dot)org>
Cc: "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il>; "Lee Kindness"
<lkindness(at)csl(dot)co(dot)uk>; "postgresql" <pgsql-general(at)postgresql(dot)org>;
<pgsql-hackers(at)postgresql(dot)org>
Sent: Tuesday, December 03, 2002 7:12 PM
Subject: Re: [HACKERS] [GENERAL] 7.3 -> pg_atoi: zero-length string

>
> If we had received more complaints about the change during beta, we
> would have added a mention that the change would be in 7.4. As we got
> few complaints, the change went into 7.3, and it is mentioned in the
> porting section of the release notes (last item):
>
> * An empty string ('') is no longer allowed as the input into an
> integer field. Formerly, it was silently interpreted as 0.
>
> --------------------------------------------------------------------------
-
>
> Larry Rosenman wrote:
> >
> >
> > --On Tuesday, December 03, 2002 11:21:04 -0500 Bruce Momjian
> > <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> >
> > > Ben-Nes Michael wrote:
> > >> Then Why not set it to NULL
> > >
> > > Well, it is not NULL, though, it is ''. They are not the same in
> > > strings (though for some dbms's they are), so I don't see why we would
> > > do that for numerics.
> > >
> > >> Seems logic as there is nothing between ''
> > >>
> > >> What is the solution of other dbs ( oracle, db2 .. ) to:
> > >> insert into table (num) value (''); ?
> > >
> > > I assume they would fail too.
> > >
> > >> Who knows how many application will suffer becouse of this.
> > >
> > > Yours is the first, or perhaps second to bring up this issue.
> > > I am sure it is a pain, but it does tighten up some cases where we
were
> > > silently mapping '' to 0, and we don't exactly have a flood of problem
> > > reports.
> > He's at least the 2nd. I have one, that I've complained to the
> > PHPGroupware folks (which
> > BREAKS severely with this change).
> >
> > LER
> >
> > >
> > > --
> > > Bruce Momjian | http://candle.pha.pa.us
> > > pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> > > + If your life is a hard drive, | 13 Roberts Road
> > > + Christ can be your backup. | Newtown Square, Pennsylvania
> > > 19073
> > >
> > > ---------------------------(end of
broadcast)---------------------------
> > > TIP 4: Don't 'kill -9' the postmaster
> > >
> >
> >
> >
> > --
> > Larry Rosenman http://www.lerctr.org/~ler
> > Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
> > US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
> >
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> >
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania
19073
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Prachi Jain 2002-12-03 17:28:55 Regarding connection thru web application
Previous Message Bruce Momjian 2002-12-03 17:12:12 Re: [HACKERS] 7.3 -> pg_atoi: zero-length string

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-12-03 17:38:44 Re: 7.4 Wishlist
Previous Message Bruce Momjian 2002-12-03 17:12:12 Re: [HACKERS] 7.3 -> pg_atoi: zero-length string