[SQL] Disable trigger with Postgresql 7.4.x?

2004-08-24 Thread Philippe Lang
Hello, I read in an old thread http://archives.postgresql.org/pgsql-hackers/2002-08/msg00079.php ... that starting with Postgresql 7.3, there is a new way to disable and enable triggers in Postgresql. The "old" way was: update pg_class set reltriggers=0 where relname = 'YOUR_TABLE_NAME'; update

[SQL] stored procedures and type of returned result.

2004-08-24 Thread Patrice OLIVER
*** Aucun virus n'a été détecté dans la pièce-jointe no filename --- No virus was detected in the attachment no filename Votre courrier a été inspecté par InterScan Messaging Security Suite --- Your mail has been scanned by InterScan MSS. *** Hello, I'm new i

Re: [SQL] stored procedures and type of returned result.

2004-08-24 Thread Richard Huxton
Patrice OLIVER wrote: Hello, I'm new in PostgreSQL. It's very cool. Hello, and yes it is isn't it :-) I would like to know how to return a set of records from a stored procedure. For example, i would like to execute these sql command from a stored procedure : select t.typnum, t.typcom, t.typcat

Re: [SQL] stored procedures and type of returned result.

2004-08-24 Thread Philippe Lang
Patrice, You might have a look at "views" as well. That's not strictily speaking a stored procedure, but maybe it's what you are searching for? Philippe Lang -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Richard Huxton Envoyé : mardi, 24. août 2004 1

Re: [SQL] stored procedures and type of returned result.

2004-08-24 Thread Richard Huxton
Patrice OLIVER wrote: Hello, I got this error message : ERROR: set-valued function called in context that cannot accept a set CONTEXT: PL/pgSQL function "lsttable" line 5 at return next You need to treat set-returning functions as though they are tables. SELECT * FROM lsttable(); NOT SELECT l

Re: [SQL] Disable trigger with Postgresql 7.4.x?

2004-08-24 Thread Bruce Momjian
Philippe Lang wrote: > Hello, > > I read in an old thread > > http://archives.postgresql.org/pgsql-hackers/2002-08/msg00079.php > > ... that starting with Postgresql 7.3, there is a new way to disable and > enable triggers in Postgresql. The "old" way was: > > update pg_class set reltriggers=0

[SQL] Possible rounding error of large float values?

2004-08-24 Thread Adam Lancaster
Title: Possible rounding error of large float values? When setting a float column to this value: 9223372036854775807 It gets selected out as: 9.22337203685478E18 Which appears to be rounded. When we cast it to numeric type we get: 922337203685478 Which also is rounded. It is s

Re: [SQL] Possible rounding error of large float values?

2004-08-24 Thread Josh Berkus
Adam, > 9223372036854775807 > > It gets selected out as: > > 9.22337203685478E18 This is a property of FLOAT data types. They round. > Which appears to be rounded. When we cast it to numeric type we get: > > 922337203685478 > > Which also is rounded. It is still possible to find the row usi

Re: [SQL] Possible rounding error of large float values?

2004-08-24 Thread Oliver Elphick
On Tue, 2004-08-24 at 20:52, Josh Berkus wrote: > Adam, > > > 9223372036854775807 > > > > It gets selected out as: > > > > 9.22337203685478E18 > > This is a property of FLOAT data types. They round. > > > Which appears to be rounded. When we cast it to numeric type we get: > > > > 9223372036854

Re: [SQL] Possible rounding error of large float values?

2004-08-24 Thread Jan Wieck
On 8/24/2004 4:21 PM, Oliver Elphick wrote: On Tue, 2004-08-24 at 20:52, Josh Berkus wrote: Adam, > 9223372036854775807 > > It gets selected out as: > > 9.22337203685478E18 This is a property of FLOAT data types. They round. > Which appears to be rounded. When we cast it to numeric type we get: >

Re: [SQL] Possible rounding error of large float values?

2004-08-24 Thread Iain
(B# select 9223372036854775807 = 9223372036854775807::float; (B ?column? (B-- (B t (B(1 row) (B (B# select 9223372036854775807 = 9223372036854775807.0::float; (B ?column? (B-- (B t (B(1 row) (B (B# select 9223372036854775807 = 9223372036854775807.::numeric; (B ?co

Re: [SQL] Possible rounding error of large float values?

2004-08-24 Thread Stephan Szabo
On Wed, 25 Aug 2004, Iain wrote: > > # select 9223372036854775807 = 9223372036854775807::float; > ?column? > -- > t > (1 row) > This and the fact that it's still possible to find the row using the > original value would seem to indicate that the rounding is just a display > artifact..

Re: [SQL] Possible rounding error of large float values?

2004-08-24 Thread Iain
> I don't think that's true since the number ending in 807 is equal to a > version ending in 808. > > sszabo=# select 9223372036854775807 = 9223372036854775808::float; > ?column? > -- > t > (1 row) Good point. I think that the problems with using floats are well documented (I particulary