Re: How to efficiently duplicate a whole schema?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to efficiently duplicate a whole schema?
Дата
Msg-id 7406.1060198163@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to efficiently duplicate a whole schema?  ("scott.marlowe" <scott.marlowe@ihs.com>)
Ответы Re: How to efficiently duplicate a whole schema?  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-performance
"scott.marlowe" <scott.marlowe@ihs.com> writes:
> On Wed, 6 Aug 2003, Tom Lane wrote:
>> One obvious question is whether you have your foreign keys set up
>> efficiently in the first place.  As a rule, the referenced and
>> referencing columns should have identical datatypes and both should
>> be indexed.  (PG will often let you create foreign key constraints
>> that don't meet these rules ... but performance will suffer.)

> Is this one of those things that should spit out a NOTICE when it happens?
> I.e. when a table is created with a references and uses a different type
> than the parent, would it be a good idea to issue a "NOTICE: parent and
> child fields are not of the same type"

I could see doing that for unequal data types, but I'm not sure if it's
reasonable to do it for lack of index.  Usually you won't have created
the referencing column's index yet when you create the FK constraint,
so any warning would just be noise.  (The referenced column's index *is*
checked for, since we require it to be unique.)

            regards, tom lane

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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: How to efficiently duplicate a whole schema?
Следующее
От: "Wilson A. Galafassi Jr."
Дата:
Сообщение: partitioning for postgresql