Newbee question "Types"

From: "Ken Godee" <ken(at)perfect-image(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Newbee question "Types"
Date: 2002-12-05 17:59:56
Message-ID: 3DEF31AA.26423.359062@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-12-05 18:40:24 Re: passwords in pg_shadow (duplicate).
Previous Message Francisco Reyes 2002-12-05 17:57:16 Re: Size for vacuum_mem