Alias for data types?

Поиск
Список
Период
Сортировка
От Matt Clark
Тема Alias for data types?
Дата
Msg-id 200303311616.h2VGG7S20265@rushe.aero.org
обсуждение исходный текст
Ответы Re: Alias for data types?  (Joe Conway <mail@joeconway.com>)
Re: Alias for data types?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Is there a way to define an alias or synonym for a data type?

I have an existing schema (from a Sybase DB), which defines a datatype via the
SQLServer method:

EXEC sp_addtype XID, 'numeric(16,0)' , 'NULL';


Then throughout the rest of the TABLE definitions, uses XID as a type, as in

CREATE TABLE foo ( fooid      XID not null,......
CREATE TABLE bar ( barid      XID not null,......
etcetera


Of course, I could edit all of the SQL to replace occurrences of XID with the
desired type; but that would require a lot of editing, say if I needed to change
the type again.

I've not found any hints in the documentation which describe this capability.
And I'm trying to maintain the existing SQL as much as possible.  I'm currently
using Postgresqkl-7.3

Any suggestions are appreciated.....

Thanks,

Matt


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

Предыдущее
От: Tony Holmes
Дата:
Сообщение: Re: Modifying WHERE input conditions for a VIEW
Следующее
От: "Delao, Darryl W"
Дата:
Сообщение: Re: Postgres logs