%TYPE

Поиск
Список
Период
Сортировка
От Ged
Тема %TYPE
Дата
Msg-id 65ca86740708221942u57477844x52772e68fc38f38@mail.gmail.com
обсуждение исходный текст
Ответы Re: %TYPE
Список pgsql-general
Checking out a bug in my code I find in my table definition:

CREATE TABLE publications
(
    ...
    name character varying(60) NOT NULL,
    ...
);

while in the function I use to populate the web page, which
amalgamates info from several sources, I have:

CREATE TYPE npc_page_details_type AS
(
    ...
    instance_name character varying(40),
    ...
);

(where instances inherits name from publications). In other words, I
changed one definition and forgot to change the other.

I've been looking to see if postgresql allows type definitions like
the ones I'm used to from Oracle, where I can say:

CREATE TYPE npc_page_details_type AS
(
    ...
    instance_name instances.name%type,
    ...
);

and it will pick up the current type of instances.name when the user
type gets compiled. However I haven't been able to find anything. Is
anything like that available? Or should I just update my definitions
and grit my teeth and carry on?


Cheers,
G.

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: reporting tools
Следующее
От: Jeff Amiel
Дата:
Сообщение: pg_dump causes postgres crash