Re: Extract created and last modified data
От | Oliveiros d'Azevedo Cristina |
---|---|
Тема | Re: Extract created and last modified data |
Дата | |
Msg-id | 07AF2300D72042C4BF9FC9D897CEFC15@marktestcr.marktest.pt обсуждение исходный текст |
Ответ на | Extract created and last modified data (Gordon McVey <grj.mcvey@googlemail.com>) |
Список | pgsql-sql |
I have a CMS with a table of items, and another table serving as a log
of operations performed on the items. The revelent table structure is
as follows:items
itm_id | usr_id_create | itm_date_create | usr_id_modify |
itm_date_modify | .....itm_id is a serial primary key.
usr_id_* are the keys of the users who created and last modified the
item.item_date_* are timestamps for creation and last modification times.
changelog
itm_id | usr_id | log_timestamp | log_opitm_id and usr_id are foreign keys into the respective item and user
tables. log_timestamp is when the last change was made and log_op was
the operation performed..
Can anybody help with writing the query to get a view that replicates
the items table except with the create and last modified user IDs and
timestamps loaded from the changelog table? If there is anybody who
has actually implemented something similar, what kind of performance
impact would it have?
В списке pgsql-sql по дате отправления: