Re: Table with Field Serial - Problem

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Table with Field Serial - Problem
Дата
Msg-id CA+bJJbw5tTBpChfAKPAOgK5H1c0a5Cfva9zUyVapBRDCq697JQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Table with Field Serial - Problem  (Adrian Klaver <adrian.klaver@gmail.com>)
Ответы Re: Table with Field Serial - Problem  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
On Thu, Oct 31, 2013 at 5:13 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
>> Table1
>>   Column  |       Type        |                          Modifiers
>>
>> ----------+-------------------__+-----------------------------__------------------------------__--
>>
>>   id   | integer           | not null default
>> nextval('test_table_id_fld___seq'::regclass)
>>
>>
>> Table2
>> Column  |       Type        |                      related
>>
>> ----------+-------------------__+-----------------------------__------------------------------__--
>>
>>   id_table1   | integer           |  FK of Table1.id
>>   id_lang       | integer          |  FK of lang.id <http://lang.id>
>>   name         |  varchar
>>
>
> I may be having one of my dumb moments, but what does the above accomplish
> that including the serial column in Table2 does not?

The default constraint puzzles me a bit, but you can have duplicate
values in table2 and check they are in t1. Imagine something like
this. You store message ids and translations. When a new message is
needed you insert it into t1, put this id wherever it's needed, and
comunicate the id to the translators, which then can insert the
translations in t2 at their pace. It has it uses.

Francisco Olarte.


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

Предыдущее
От: Frank Church
Дата:
Сообщение: How can I run a PostgreSQL database outside /var/run/postgresql?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Table with Field Serial - Problem