Subject: Re: Some more questions on DB schema

From: "Dave Page" <[email-masked]>
Date: Tue, 27 Apr 2004 16:03:37 +0100

> -----Original Message-----
> From: Alexey Borzov [mailto:[email-masked]] 
> Sent: 27 April 2004 15:35
> To: [email-masked]
> Subject: [pgsql-www] Some more questions on DB schema
> 
> Greetings.
> 
> 1) What is the table 'dellog' for?

It's a leftover from the old search engine iirc. I assume there's noting
interesting in it? If not, it can go.

> 2) Why 'comments' table does not have a foreign key on 'docs'?

Oversight I guess. Feel free to add one.

Regards, Dave.

---

From: Alexey Borzov <[email-masked]>
Date: Wed, 28 Apr 2004 16:39:06 +0400

Hi!

> interesting in it? If not, it can go.

Yep, the table is empty.

> Oversight I guess. Feel free to add one.

There are some problems with this... Run the following query

SELECT id, version, file
FROM comments c
WHERE NOT EXISTS (
     SELECT id
     FROM docs d
     WHERE d.version = c.version AND
           d.file = c.file
);

and observe the comments that are linked to non-existant pages of 
documentation. Someone'll have to fix these before adding a foreign key 
will be possible.