Versioning Schema SQL ideas needed

Поиск
Список
Период
Сортировка
От Tim Smith
Тема Versioning Schema SQL ideas needed
Дата
Msg-id CA+HuS5EfWg7+2xt0OrkGGfkiebGgm42NbESWUrbHeU60uGNvYQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Versioning Schema SQL ideas needed  (Maciek Sakrejda <maciek@heroku.com>)
Re: Versioning Schema SQL ideas needed  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-general
Hi,

I've spent too long staring at code today and am facing a bit of a
block when trying to figure out how to best implement the following.

I'm basically looking at tracking versions of some configuration items
saved in a database table.  My thinking of the table is something
along the following :

create table templates(
   template_id int not null primary key,
   template_groupid int not null,
   template_version int not null
   template_text text not null);

My thinking on the above is :
- template_id is a unique ID for that version
- template_groupid identifies the set the template belongs to
- version is the version

Would I need to resort to using a CTE or subquery to make this sort of
thing work ?  I can't seem to make it work with group by since group
by expects aggregation. Surely I don't need to normalise it into a
couple of tables ?

Sorry if its a silly question !

Tim


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

Предыдущее
От: Tim Uckun
Дата:
Сообщение: Re: Postgres seems to use indexes in the wrong order
Следующее
От: Tim Uckun
Дата:
Сообщение: Re: Postgres seems to use indexes in the wrong order