Re: [GENERAL] Versioning Schema SQL ideas needed

2015-02-02 Thread Jim Nasby
On 1/26/15 4:38 PM, Tim Smith wrote: 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_gro

Re: [GENERAL] Versioning Schema SQL ideas needed

2015-01-27 Thread Tim Smith
> DISTINCT ON is my favorite lesser-known Postgres feature. You said it ! There I was, trying and failing to make "DISTINCT" work for me, little did I know that the little word ON was missing from my Postgresql vocabulary ! Thanks ! On 27 January 2015 at 02:24, Maciek Sakrejda wrote: > On Mon

Re: [GENERAL] Versioning Schema SQL ideas needed

2015-01-26 Thread Maciek Sakrejda
On Mon, Jan 26, 2015 at 2:38 PM, Tim Smith wrote: > 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); > > Would I need to resort to using a CTE or subquery to make this sort

[GENERAL] Versioning Schema SQL ideas needed

2015-01-26 Thread Tim Smith
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