Re: [SQL] question about partitioning

2010-06-24 Thread Petru Ghita
summing up the values of 10 ids takes about 2.5 seconds, which looks to me like a quite a nice performance. Petru Ghita On 24/06/2010 15:05, Joshua Gooding wrote: > rules for 0x7CF29D04.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature

Re: [SQL] string functions and operators

2010-03-22 Thread Petru Ghita
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 For the record if you'd like to use regexp: select substring('201.123' from $$[0-9]*$$); and select substring('201.1232' from $$\.([0-9]*)$$); On 23/03/2010 4:42, Petru Ghita wrote: > > select 0.341*pow(10,len

Re: [SQL] string functions and operators

2010-03-22 Thread Petru Ghita
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 select 0.341*pow(10,length(0.341::text)-2); 2 is a constat that stands for the '0.' part of the string representing the decimal part of the number. Petru Ghita On 23/03/2010 3:16, Neil Stlyz wrote: > This is good, however, I

Re: [SQL] string functions and operators

2010-03-22 Thread Petru Ghita
? - -- 0.912 (1 row) On 23/03/2010 2:50, Petru Ghita wrote: > That field of yours... what type is it? Is it TEXT? is it a numeric > type? If it's TEXT, why don't you make it say... NUMERIC(/10/, > /6///)? > > http://www.postgresql.org/docs/8.4/interactive/datatype-nume

Re: [SQL] string functions and operators

2010-03-22 Thread Petru Ghita
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 That field of yours... what type is it? Is it TEXT? is it a numeric type? If it's TEXT, why don't you make it say... NUMERIC(/10/, /6///)? http://www.postgresql.org/docs/8.4/interactive/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL On 23/03/2010 2

Re: [SQL] list of all months

2010-03-15 Thread Petru Ghita
ld provided a more complete description of what you are trying to achive I might be able to further help. Petru Ghita On 08/03/2010 13:25, query wrote: > Hi, > > I want to display data for all days in a month even if no data > exists for that month. Some of the days in a month might

Re: [SQL] Does IMMUTABLE property propagate?

2010-03-06 Thread Petru Ghita
esults of functions. The immutable > property is used top determine if it's safe to use indexes or other > plans that avoid evaluating an expression repeatedly. > >> On 6 Mar 2010 02:45, "Petru Ghita" > <mailto:petr...@venaver.info>> wrote: >> > Gi

[SQL] Does IMMUTABLE property propagate?

2010-03-05 Thread Petru Ghita
the recommended way to proceed? Thank you! Petru Ghita -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuRwYQACgkQt6IL6XzynQTHEgCffi2QMWkkvTIsuglsanvcUyRB I+wAoKr22B7FJJVDCssGKGwB8zr4NjQG =V/BS -END

Re: [SQL] Create functions using a function

2010-03-01 Thread Petru Ghita
docs/8.2/static/plpgsql-statements.html under "37.6.5. Executing Dynamic Commands" Petru Ghita Gianvito Pio wrote: > Hi all, is there a way to define functions and/or triggers in a > function? > > For example, can I create a function that takes an argument and > defines a funct

[SQL] Date comparison, user defined operators and magic

2010-02-26 Thread Petru Ghita
re as the function is not commutative one, add a NEGATOR, define the > operator and do the same, and then go for the = operator and so on. But the thing is it's working... So question is: Is it this normal behavior? Could someone please give a working example or a pointe