Re: [BUGS] BUG #5484: sum() bug

2010-06-01 Thread Kevin Grittner
Robert Haas wrote: > On Tue, Jun 1, 2010 at 9:24 AM, viras wrote: >> What type of the data is better for using? Numbers up to 10 >> and accuracy of 2 fractional signs. > > numeric is a good choice to avoid loss of precision, but can be a > bit slower. > > You could also try float8. Yeah

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-01 Thread Bruce Momjian
Robert Haas wrote: > On Mon, May 31, 2010 at 10:11 AM, Bruce Momjian wrote: > > Robert Haas wrote: > >> On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: > >> > I have updated the patch, attached, to clarify that this returns text > >> > arrays, and that you can force it to always return one

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-01 Thread Bruce Momjian
Tom Lane wrote: > Robert Haas writes: > > But actually here's an even simpler workaround, which is IMHO less > > ugly than the original one: > > > SELECT foo, bar, (SELECT regexp_matches(bar, pattern)) FROM table; > > Doesn't that blow up if the subselect returns more than one row? > > I think

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-01 Thread Tom Lane
Robert Haas writes: > But actually here's an even simpler workaround, which is IMHO less > ugly than the original one: > SELECT foo, bar, (SELECT regexp_matches(bar, pattern)) FROM table; Doesn't that blow up if the subselect returns more than one row? I think you could make it work by wrapping

Re: [BUGS] BUG #5469: regexp_matches() has poor behaviour and more poor documentation

2010-06-01 Thread Robert Haas
On Mon, May 31, 2010 at 10:11 AM, Bruce Momjian wrote: > Robert Haas wrote: >> On Sat, May 29, 2010 at 5:00 PM, Bruce Momjian wrote: >> > I have updated the patch, attached, to clarify that this returns text >> > arrays, and that you can force it to always return one row using >> > COALESCE() and

Re: [BUGS] BUG #5484: sum() bug

2010-06-01 Thread Robert Haas
On Tue, Jun 1, 2010 at 9:24 AM, viras wrote: > megafon=# \d aaa > Table "public.aaa" > Column | Type | Modifiers > +--+--- > num | real | > > Yes, really, on smaller quantity of digits of errors is not present. > What type of the data is better for using? Numbers up to 10 a

Re: [BUGS] BUG #5484: sum() bug

2010-06-01 Thread viras
megafon=# \d aaa Table "public.aaa" Column | Type | Modifiers +--+--- num | real | Yes, really, on smaller quantity of digits of errors is not present. What type of the data is better for using? Numbers up to 10 and accuracy of 2 fractional signs. 30.05.10, 21:43, "Tom La

Re: [BUGS] BUG #5487: dblink failed with 63 bytes connection names

2010-06-01 Thread Heikki Linnakangas
On 01/06/10 05:55, Takahiro Itagaki wrote: "Takahiro Itagaki" wrote: Contib/dblink module seems to have a bug in handling connection names in NAMEDATALEN-1 bytes. Here is a patch to fix the bug. I think it comes from wrong usage of snprintf(NAMEDATALEN - 1). It just copies 62 bytes + \0. In