Newbee question "Types"

Поиск
Список
Период
Сортировка
От Ken Godee
Тема Newbee question "Types"
Дата
Msg-id 3DEF31AA.26423.359062@localhost
обсуждение исходный текст
Ответы Re: Newbee question "Types"  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
I'm just starting to build the data structure to
switch over an existing database to postgres and
I keep going back and forth with the column types and
wanted to see if any body had some foresite on this.

1. Using column type "char" vs "varchar" vs "text"
   I understand the documented differences, but Why wouldn't
   someone just use varchar(x) instead of plain char(x)? It's
   definitely more flexable. Or would using char(x) just help one
   stay in sql conformity? How about performance differences?
   Disk space differences? Would not varchar(45) vs char(45)
   consume less space if used with less than 45 characters?

2. Column type money depreciated, so use ie. numeric(6,2)
    ok, no problem, but does this mean everytime I do a select
   statement I have to "to_char(column, 'FM$9999.99')" to
   get a nice formated output? That's ok by me, just wondering if
   I'm missing something? It would seem nice to have a currency/money
   type that would handle this automagically. Oh, and I guess I missed
   even trying to input "$xx.xx" into a numeric field, which I presume I'll
   have to convert first from text to integer?

3. Ok, this is not a type question but......
    It seems my systems (Rh7.3) postmaster init scripts are not calling the
   postgres users ".bashprofile", haven't had time to track
   it down yet, but is there any problem with just setting the PG exports
   in the system profile as I've been doing for now?

TIA




В списке pgsql-general по дате отправления:

Предыдущее
От: "Francisco Reyes"
Дата:
Сообщение: Re: Size for vacuum_mem
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: passwords in pg_shadow (duplicate).