Re: User defined types -- Social Security number...

Поиск
Список
Период
Сортировка
От Chris Browne
Тема Re: User defined types -- Social Security number...
Дата
Msg-id 60y8qjkvg1.fsf@dev6.int.libertyrms.info
обсуждение исходный текст
Ответ на Re: User defined types -- Social Security number...  ("Greg Patnude" <gpatnude@hotmail.com>)
Список pgsql-hackers
"Greg Patnude" <gpatnude@hotmail.com> writes:
> It would be really sweet in postgreSQL if we could apply the
> equivalent of a printf(columnname) to the table definition -- MS
> Access has what they call an "input mask" and it comes in really
> handy -- however -- I havent used Access for anthing serious for
> about 4 years...

Hmm.  

% man "create type"

NAME      CREATE TYPE - define a new data type

SYNOPSIS      CREATE TYPE name AS          ( attribute_name data_type [, ... ] )
      CREATE TYPE name (          INPUT = input_function,          OUTPUT = output_function          [ , RECEIVE =
receive_function]          [ , SEND = send_function ]          [ , INTERNALLENGTH = { internallength | VARIABLE } ]
    [ , PASSEDBYVALUE ]          [ , ALIGNMENT = alignment ]          [ , STORAGE = storage ]          [ , DEFAULT =
default]          [ , ELEMENT = element ]          [ , DELIMITER = delimiter ]      )
 

"input_function" and "output_function" sure _sound_ like what you're
looking for.

They would make your imagined issue of "missing leading zeros" go
away.

I think that CREATE TYPE has been around for a goodly few years now;
it is not impossible that this functionality has been around longer
than MS Access (which is saying something!).
-- 
output = reverse("gro.mca" "@" "enworbbc")
http://www3.sympatico.ca/cbbrowne/x.html
Rules of the Evil Overlord #116.  "If I capture the hero's starship, I
will keep it in  the landing bay with the ramp down,  only a few token
guards on  duty and a ton  of explosives set to  go off as  soon as it
clears the blast-range." <http://www.eviloverlord.com/>


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

Предыдущее
От: Edgar Mares
Дата:
Сообщение: grants
Следующее
От: "Simon Riggs"
Дата:
Сообщение: Re: PITR Functional Design v2 for 7.5