Re: [HACKERS] typemode for variable types

2014-02-25 Thread Greg Stark
Also keep in mind that the system doesn't always retain the typmod. So the datum should be possible to interpret without the typmod. Incidental effects such as length limits or precision displayed are ok but the meaning shouldn't be changed. -- greg On 24 Feb 2014 20:34, Tom Lane

Re: [HACKERS] typemode for variable types

2014-02-24 Thread Bruce Momjian
On Sun, Feb 23, 2014 at 07:50:08AM +0330, Mohsen SM wrote: Hello. I have a new type similar to varchar. I want to fine how did I can to calculate typemod and where must I calculate typemod for this type. Well, typmods are type-specific, so there is no official way to calculate it. I would

Re: [HACKERS] typemode for variable types

2014-02-24 Thread Alvaro Herrera
Bruce Momjian escribió: On Sun, Feb 23, 2014 at 07:50:08AM +0330, Mohsen SM wrote: Hello. I have a new type similar to varchar. I want to fine how did I can to calculate typemod and where must I calculate typemod for this type. Well, typmods are type-specific, so there is no official

Re: [HACKERS] typemode for variable types

2014-02-24 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Bruce Momjian escribió: Well, typmods are type-specific, so there is no official way to calculate it. I would look at how an existing type uses typmod and copy that. Our system is pretty neat. See a complex example here:

[HACKERS] typemode for variable types

2014-02-22 Thread Mohsen SM
Hello. I have a new type similar to varchar. I want to fine how did I can to calculate typemod and where must I calculate typemod for this type. thanks.