[SQL] function to format floats as money?

2001-04-17 Thread Mark Stosberg
Hello, I'm curious to know if there is a function available in Postgres 7.0.3 (or 7.1) that will format a float style number as "money". I understand that the money type is going away in the future, so using a float type that is sometimes formatted like money seems like a good alternative. So

Re: [SQL] function to format floats as money?

2001-04-17 Thread Peter Eisentraut
Mark Stosberg writes: > I'm curious to know if there is a function available in Postgres 7.0.3 > (or 7.1) that will format a float style number as "money". I understand > that the money type is going away in the future, so using a float type > that is sometimes formatted like money seems like a

Re: [SQL] Re: Using Random Sequence as Key

2001-04-17 Thread Josh Berkus
Bernardo, > I needed the random field because if I use serial and the user gets a > 34203 > he's sure that 34202 exists, and that (probably, there where 34202 > inserts > before him (or at least an offset + some)). Using a random just makes > the > user totally blind. > As I said I could use a se

Re: [SQL] Cursors in plpgsql

2001-04-17 Thread Josh Berkus
Preeti, > Is there a command in plpgsql similar to %NOTFOUND of oracle? Cursors are not currently supported for PL/pgSQL. There are plans to include them for and upcoming version of Postgres. But dont' wait your application on it. > i want to write a load script which takes each row from the

Re: [SQL] function to format floats as money?

2001-04-17 Thread Mark Stosberg
Peter Eisentraut wrote: > > Mark Stosberg writes: > > > I'm curious to know if there is a function available in Postgres 7.0.3 > > (or 7.1) that will format a float style number as "money". I understand > > that the money type is going away in the future, so using a float type > > that is some

Re: [SQL] RTREE on points

2001-04-17 Thread Jeff Hoffmann
Tom Lane wrote: > BTW, you should also look at the GIST stuff and figure out whether > it might not be better to develop a GIST opclass instead of rtree. > In the long run I suspect GIST will be better supported than rtree, > since it's more general. > > regards, tom lane

[SQL] drastic reduction in speed of inserts as the table grows

2001-04-17 Thread Rini Dutta
Hi, I was comparing speed of inserts in C vs JDBC and found that as the table size increases the speed differential decreases till there is no difference (no problem). However inserts kept getting slower and slower as the table size increased and the performance became quite poor. Here is the dat

Re: [GENERAL] drastic reduction in speed of inserts as the table grows

2001-04-17 Thread Tom Lane
Rini Dutta <[EMAIL PROTECTED]> writes: > Here is the performance statistics on the same table. > Note the fall in performance as the test proceeds. Try 7.1. I think you are running into the lots-of-pending-triggers problem that was found and fixed awhile back. regards, t

[SQL] Re: [GENERAL] drastic reduction in speed of inserts as the table grows

2001-04-17 Thread Rini Dutta
--- Tom Lane <[EMAIL PROTECTED]> wrote: > Rini Dutta <[EMAIL PROTECTED]> writes: > > Here is the performance statistics on the same > table. > > Note the fall in performance as the test proceeds. > > Try 7.1. I think you are running into the > lots-of-pending-triggers > problem that was found a

[SQL] Re: [GENERAL] drastic reduction in speed of inserts as the table grows

2001-04-17 Thread Tom Lane
Rini Dutta <[EMAIL PROTECTED]> writes: > I'll try it out. Just for my understanding, is the > 'lots-of-pending-triggers' problem related to indexes, > or to foreign keys ? Foreign keys. Does your speed problem go away if the table being inserted into has no foreign keys?

Re: [SQL] RTREE on points

2001-04-17 Thread Jeff Hoffmann
Tom Lane wrote: > > I don't recall any such thing having been removed, but it does seem > peculiar that there are no GIST opclasses in the standard distribution. > How the heck did the GIST index code get developed/tested without some > opclasses? doing some digging at berkeley, i found the orig

Re: [SQL] function to format floats as money?

2001-04-17 Thread Ross J. Reedstrom
On Tue, Apr 17, 2001 at 10:31:49AM -0500, Mark Stosberg wrote: > Peter Eisentraut wrote: > > > > Mark Stosberg writes: > > > > > I'm curious to know if there is a function available in Postgres 7.0.3 > > > (or 7.1) that will format a float style number as "money". I understand > > > that the m

Re: [SQL] RTREE on points

2001-04-17 Thread Tom Lane
Jeff Hoffmann <[EMAIL PROTECTED]> writes: > I know there are a couple of GiST examples in contrib (seg, cube & > intarray), but i thought there used to be at least a gist_box_ops. I don't recall any such thing having been removed, but it does seem peculiar that there are no GIST opclasses in the

Re: [SQL] RTREE on points

2001-04-17 Thread Tom Lane
Jeff Hoffmann <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> How the heck did the GIST index code get developed/tested without some >> opclasses? > doing some digging at berkeley, i found the original pggist patch file > that created the gist access method & gist_box_ops opclass (among > others

[SQL] any proper benchmark scripts?

2001-04-17 Thread clayton cottingham
hello: im try to find out how mysql or postgresql perform i was wondering if there are any benchmarking scripts out there? if so please lemme see em try em etc!! ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] function to format floats as money?

2001-04-17 Thread John Hasler
Ross writes: > But seriously, numeric(10,2) (or whatever precision and scale is correct > for your application) is the standard answer. Floats are fine for money as long as you only add and subtract and don't deal in amounts that won't fit in the mantissa. -- John Hasler [EMAIL PROTECTED] (John

[SQL] is this proper sql?

2001-04-17 Thread clayton cottingham
hi one of the developers here at work say this should work insert into detail (det_id,det_mas_id,det_date,det_amt) values (0,0,now(),'0'), (1,1,now(),'1'); but when i try that in postgres like: insert into detail (det_id,det_mas_id,det_date,det_amt) values (0,0,datetime'now','0'), (1,1,date

Re: [SQL] RTREE on points

2001-04-17 Thread Oleg Bartunov
GiST is great ! You may look at http://www.sai.msu.su/~megera/postgres/gist/ for GiST implementation of RTree - it could be not compiled with 7.1 release due to some api changes, but it's not difficult to do. If somebody want it I could contribute it to contrib area. Tom, what we need to do to i

Re: [SQL] function to format floats as money?

2001-04-17 Thread Ross J. Reedstrom
On Tue, Apr 17, 2001 at 01:52:16PM -0500, John Hasler wrote: > Ross writes: > > But seriously, numeric(10,2) (or whatever precision and scale is correct > > for your application) is the standard answer. > > Floats are fine for money as long as you only add and subtract and don't > deal in amounts

Re: [SQL] is this proper sql?

2001-04-17 Thread Stephan Szabo
On Tue, 17 Apr 2001, clayton cottingham wrote: > hi one of the developers here at work say this should work > insert into detail (det_id,det_mas_id,det_date,det_amt) values > (0,0,now(),'0'), (1,1,now(),'1'); > > > > but when i try that in postgres like: > insert into detail (det_id,det_ma

Re: [SQL] is this proper sql?

2001-04-17 Thread David Olbersen
On Tue, 17 Apr 2001, clayton cottingham wrote: > now i personally dont think this is real sql > anyone? Nope, not real. Although that type of syntax would be handy IMHO. -- Dave ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] function to format floats as money?

2001-04-17 Thread John Hasler
I wrote: > Floats are fine for money as long as you only add and subtract and don't > deal in amounts that won't fit in the mantissa. Ross writes: > Or you're writing software in Germany (all of the EU now?) that _might_ get > used in an offical capacity. I was referring to what actually works,

Re: [SQL] is this proper sql?

2001-04-17 Thread Tom Lane
clayton cottingham <[EMAIL PROTECTED]> writes: > hi one of the developers here at work say this should work > insert into detail (det_id,det_mas_id,det_date,det_amt) values > (0,0,now(),'0'), (1,1,now(),'1'); Multiple rows in INSERT ... VALUES are legal according to the SQL92 spec, but we don't

Re: [SQL] RTREE on points

2001-04-17 Thread Jeff Hoffmann
Oleg Bartunov wrote: > > GiST is great ! > > You may look at http://www.sai.msu.su/~megera/postgres/gist/ > for GiST implementation of RTree - it could be not compiled with 7.1 > release due to some api changes, but it's not difficult to do. it looks like i just wasted a good couple of hours tr

Re: [SQL] is this proper sql?

2001-04-17 Thread Peter Eisentraut
clayton cottingham writes: > hi one of the developers here at work say this should work > insert into detail (det_id,det_mas_id,det_date,det_amt) values > (0,0,now(),'0'), (1,1,now(),'1'); This is real SQL (except for the now() function) but it isn't supported in PostgreSQL yet. -- Peter Eise

Re: [SQL] RTREE on points

2001-04-17 Thread Oleg Bartunov
On Tue, 17 Apr 2001, Jeff Hoffmann wrote: > Oleg Bartunov wrote: > > > > GiST is great ! > > > > You may look at http://www.sai.msu.su/~megera/postgres/gist/ > > for GiST implementation of RTree - it could be not compiled with 7.1 > > release due to some api changes, but it's not difficult to do.

[SQL] Another qs Re: [GENERAL] drastic reduction in speed of inserts as the table grows

2001-04-17 Thread Rini Dutta
--- Tom Lane <[EMAIL PROTECTED]> wrote: > Rini Dutta <[EMAIL PROTECTED]> writes: > > Here is the performance statistics on the same > table. > > Note the fall in performance as the test proceeds. > > Try 7.1. I think you are running into the > lots-of-pending-triggers > problem that was found a

[SQL] Where are the 7.1 RPM's?

2001-04-17 Thread Lonnie Cumberland
Hello All, I have been using the 7.0.2 version of PostgreSQL which came with my Mandrake Linux and now want to do a fresh install of the 7.1 version because I think that there are many things fixed since then. Do anyone know where the 7.1 RPM's are so that I can install them? Cheers, Lonnie _

[SQL] Re: DB porting questions...

2001-04-17 Thread Vivek Khera
> "JD" == Jeffrey Diehl <[EMAIL PROTECTED]> writes: JD> I'm in the final stages of migrating from mysql to postgres and have a few JD> more questions... I'm just starting, but I've got two questions. I've found some scripts out there that claim to do the conversion of the SQL create command

[SQL] Re: Same question about PostgreSql

2001-04-17 Thread Nils Zonneveld
Josh Berkus wrote: > Full stored procedures are planned for Postgres, but not for a couple of > versions. > I always thought that Pl/PgSQL functions where 'stored procedures'. Probably I'm wrong, but whats the difference between a Pl/PgSQL function and a stored procedure? (just curious). Reg

Re: [SQL] Re: Using Random Sequence as Key

2001-04-17 Thread Brook Milligan
It is a good way to solve it but since I don't want/can't use cookies in my application I could use only the random key but it would have to be unique or the where key=$key could refer to multiple lines or I would have to ask for the user to input both the random and the serial number

Re: [SQL] Where are the 7.1 RPM's?

2001-04-17 Thread clayton
Lonnie Cumberland wrote: > Hello All, > > I have been using the 7.0.2 version of PostgreSQL which came with my Mandrake > Linux and now want to do a fresh install of the 7.1 version because I think > that there are many things fixed since then. > > Do anyone know where the 7.1 RPM's are so that

Re: [SQL] Re: DB porting questions...

2001-04-17 Thread Roberto Mello
On Tue, Apr 17, 2001 at 11:45:08AM -0400, Vivek Khera wrote: > I'm just starting, but I've got two questions. I've found some > scripts out there that claim to do the conversion of the SQL create > commands, but none does the right thing it seems. Please help better these scripts then.

Re: [SQL] Where are the 7.1 RPM's?

2001-04-17 Thread Roberto Mello
On Tue, Apr 17, 2001 at 04:30:43PM -0700, Lonnie Cumberland wrote: > Hello All, > > I have been using the 7.0.2 version of PostgreSQL which came with my Mandrake > Linux and now want to do a fresh install of the 7.1 version because I think > that there are many things fixed since then. > > Do an

Re: [SQL] Where are the 7.1 RPM's?

2001-04-17 Thread Mike Castle
On Tue, Apr 17, 2001 at 06:12:40PM -0700, clayton wrote: > if a spec file was made avail we could all make rpms! You too can ./configure ; make ; make install !! -- Mike Castle Life is like a clock: You can work constantly [EMAIL PROTECTED] and be right all the time, or not work

Re: [SQL] Re: Same question about PostgreSql

2001-04-17 Thread Josh Berkus
Nils, > I always thought that Pl/PgSQL functions where 'stored procedures'. > Probably I'm wrong, but whats the difference between a Pl/PgSQL > function > and a stored procedure? (just curious). Postgres functions have really expanded the concept of function, to the point of *almost* being store