[HACKERS] Adding a typmod field to Const et al

2007-03-16 Thread Tom Lane
A month or so back I wrote: BTW, I think a good case could be made that the core of the problem is exactly that struct Const doesn't carry typmod, and thus that we lose information about constructs like 'foo'::char(7). We should fix that, and also anywhere else in the expression tree

Re: [HACKERS] Adding a typmod field to Const et al

2007-03-16 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: ArrayExpr: should adopt the same behavior as Coalesce and similar nodes, ie, if all the elements show the same type/typmod then return that typmod instead of -1 ... Comments,

Re: [HACKERS] Adding a typmod field to Const et al

2007-03-16 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: I'm not entirely convinced by this one. Does that mean expressions like this would throw an error if col1 was declared as a numeric(1)? ARRAY[col1] || 10 No, because the result of the || operator won't have a specific typmod.