datatype: not variable, not fixed length

Поиск
Список
Период
Сортировка
Искать

datatype: not variable, not fixed length

От:
Moritz Sinn <moritz@freesources.org>
Дата:

hi,

i'd like to write a datatype which is similar to varchar, i want the
programmer be able to set its length when he creates the table. but
it seems that there are only 2 options: completely variable or fixed.
so do i have to write an new basic type and recompile postgresql?

thanks,
 moritz

-- 

Re: datatype: not variable, not fixed length

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:

Well variable is defined at creation time, see char() and varchar(). 
text data type is truely variable.  pg_attribute.atttypmod has info
about the lenght.

---------------------------------------------------------------------------

Moritz Sinn wrote:
> 
> hi,
> 
> i'd like to write a datatype which is similar to varchar, i want the
> programmer be able to set its length when he creates the table. but
> it seems that there are only 2 options: completely variable or fixed.
> so do i have to write an new basic type and recompile postgresql?
> 
> thanks,
>  moritz
> 
> -- 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
FAQ