Re: [HACKERS] Checking for overflow of integer arithmetic

2004-10-03 Thread Gaetano Mendola
Tom Lane wrote: { int32 arg1 = PG_GETARG_INT32(0); int32 arg2 = PG_GETARG_INT32(1); + int32 result; ! result = arg1 * arg2; ! /* ! * Overflow check. We basically check to see if result / arg2 gives ! * arg1 again. There are two cases where this fails: arg2 = 0 (which ! * ca

Re: [HACKERS] Checking for overflow of integer arithmetic

2004-10-03 Thread Bruno Wolff III
On Sun, Oct 03, 2004 at 15:38:52 -0400, Tom Lane <[EMAIL PROTECTED]> wrote: > 1. Does anyone object to applying this for 8.0? I think we already had > consensus that it's a good idea, but if not now's the time to speak up. > (There are a couple of regression tests that fail and will need to be >

Re: [HACKERS] Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd timestamp index possible?)

2004-10-03 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > Tom Lane <[EMAIL PROTECTED]> writes: >> The reason the "char" arithmetic operators are dangerous is that they are >> the only ones of those names in the STRING type category. > What would happen if "char" were just removed from the STRING type category? Wh

[HACKERS] External Tabular Data Via SQL

2004-10-03 Thread David Fetter
Kind people, Please find enclosed an example of what I hope to make into a generalized way of accessing external tabular data via SQL. It is written in PL/PerlU for portability reasons, although it could probably be re-written in C at the cost of some large amount of effort. It depends on having

Re: [HACKERS] Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd timestamp index possible?)

2004-10-03 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> What I'm inclined to do with these is change pg_proc.h but not force > >> an initdb. Does anyone want to argue for an initdb to force it to be > >> fixed in 8.0? We've lived with the wron

Re: [HACKERS] AIX and V8 beta 3

2004-10-03 Thread Bruce Momjian
OK, that 8.0beta config file should find all your thread flags and define them as PTHREAD_* in Makefile.global. --- Christopher Browne wrote: > After a long battle with technology, [EMAIL PROTECTED] (Bruce Momjian), an > ea

Re: Stable function semantics (was Re: [HACKERS] Mislabeled timestamp functions)

2004-10-03 Thread Tom Lane
Oliver Jowett <[EMAIL PROTECTED]> writes: > Bruno Wolff III wrote: >> I should have said within a single statement instead of within a single >> transaction. > As I understand Tom's earlier explanation of this, the definition is > even more narrow: stable functions only need to return the same va

Re: [HACKERS] slow count() was: tsearch2 poor performance

2004-10-03 Thread Oleg Bartunov
Magnus On Sun, 3 Oct 2004, Magnus Hagander wrote: > >> Hey all, its me again. If I do not do a count(product_id) on my > >> tsearch2 queries, its actually really fast, for example; > >> > > > >Hmm, I also really want to know what's the difference ? > >Postgresql 8.0beta3 on Linux 2.4.25 > > >

Re: [HACKERS] slow count() was: tsearch2 poor performance

2004-10-03 Thread Magnus Hagander
>> Hey all, its me again. If I do not do a count(product_id) on my >> tsearch2 queries, its actually really fast, for example; >> > >Hmm, I also really want to know what's the difference ? >Postgresql 8.0beta3 on Linux 2.4.25 > >tsearchd=# explain analyze select body from txt where >fts_index @@

[HACKERS] slow count() was: tsearch2 poor performance

2004-10-03 Thread Oleg Bartunov
On Fri, 1 Oct 2004, Kris Kiger wrote: > Hey all, its me again. If I do not do a count(product_id) on my > tsearch2 queries, its actually really fast, for example; > Hmm, I also really want to know what's the difference ? Postgresql 8.0beta3 on Linux 2.4.25 tsearchd=# explain analyze select bod

Re: [HACKERS] Checking for overflow of integer arithmetic

2004-10-03 Thread Dave Page
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Tom Lane > Sent: 03 October 2004 20:39 > To: [EMAIL PROTECTED] > Subject: [HACKERS] Checking for overflow of integer arithmetic > > 2. For the int2 and int8 operators, should we stick to a > one-si

[HACKERS] Checking for overflow of integer arithmetic

2004-10-03 Thread Tom Lane
I'm working on a patch to detect overflow in the integer-arithmetic operators. The first stage, covering the basic int4 operators, is attached if anyone wants to comment on details. A couple of general questions though: 1. Does anyone object to applying this for 8.0? I think we already had cons

Re: [HACKERS] OT moving from MS SQL to PostgreSQL

2004-10-03 Thread Scott Marlowe
On Sun, 2004-10-03 at 06:33, stig erikson wrote: > Hello. > i have an slightly off topic question, but i hope that somebody might know. > > at the moment we have a database on a MS SQL 7 server. > This data will be transfered to PostgreSQL 7.4.5 or PostgreSQL 8 (when > it is released). so far so

Re: [HACKERS] Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd timestamp index possible?)

2004-10-03 Thread Mike Rylander
Not that my 2c is worth 1c, but I second this. I'd rather initdb now than get bitten by some catalog difference when I move my DB into production. :) --miker On Sat, 02 Oct 2004 14:22:50 -0400, Tom Lane <[EMAIL PROTECTED]> wrote: [...] > > > I'd prefer if all users of 8.0 were guaranteed to hav

Re: [HACKERS] SQL-Invoked Procedures for 8.1

2004-10-03 Thread Gavin Sherry
On Sat, 2 Oct 2004, Josh Berkus wrote: > Gavin, > > > I agree that packages give us something like classes in that we can define > > related functions/procs into a single namespace. They provide other > > features like package level variables and public/private functionality. I > > think they majo

Re: [HACKERS] AIX and V8 beta 3

2004-10-03 Thread Christopher Browne
After a long battle with technology, [EMAIL PROTECTED] (Bruce Momjian), an earthling, wrote: > config/acx_pthread.m4 should be testing all those thread flags and > defining proper Makefile.global values for them. Do you want to > send me your config.log offline or check ourself why the tests > ar

[HACKERS] OT moving from MS SQL to PostgreSQL

2004-10-03 Thread stig erikson
Hello. i have an slightly off topic question, but i hope that somebody might know. at the moment we have a database on a MS SQL 7 server. This data will be transfered to PostgreSQL 7.4.5 or PostgreSQL 8 (when it is released). so far so good. the question now arises, this current database is used

Re: [HACKERS] SQL-Invoked Procedures for 8.1

2004-10-03 Thread Gavin Sherry
On Sat, 2 Oct 2004, Joe Conway wrote: > Gavin Sherry wrote: > > That's fairly bizarre (at least to my view of the world). Say we could > > have OUT parameters which were of some SETOF style type I think that would > > solve the same problem. > > That won't satify people moving over from MSSQL/Syba

Re: [HACKERS] SQL-Invoked Procedures for 8.1

2004-10-03 Thread Gavin Sherry
On Sat, 2 Oct 2004, Tom Lane wrote: > Gavin Sherry <[EMAIL PROTECTED]> writes: > >> I concur with Grant Finnemore's objection as well: people expect > >> procedures to be able to return resultsets, ie SETOF something, > >> not only scalar values. Whether this is what SQL2003 says is not > >> real

Re: [HACKERS] Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd

2004-10-03 Thread Gaetano Mendola
Bruno Wolff III wrote: On Sat, Oct 02, 2004 at 15:04:51 -0500, Bruno Wolff III <[EMAIL PROTECTED]> wrote: On Sat, Oct 02, 2004 at 10:43:01 +0200, There has been such a distinction for a major release or two. "Stable" is how you mark a function that will return the same value within a single trans