unsubscribe - Mailing list pgsql-docs

From Zinchik
Subject unsubscribe
Date
Msg-id 13043476738925@MEGAHERTZ.NET
Whole thread Raw
List pgsql-docs
At 11:00 PM 2/18/99 -0500, you wrote:
>
>pgsql-docs-digest     Thursday, February 18 1999     Volume 01 : Number 411
>
>
>
>Index:
>
>A little nitpick correction
>Can this be added to manual?
>
>----------------------------------------------------------------------
>
>Date: Thu, 18 Feb 1999 15:34:33 +0100
>From: Hans de Goede <j.w.r.degoede@et.tudelft.nl>
>Subject: A little nitpick correction
>
>Hi all,
>
>Well you said you wanted to know any errors int he docs:
>In the tutorial chapter 3 getting started:
>in Managing a database:
>The followign example code is given:
>- ---
>% psql mydb
>
>You will be greeted with the following message:
>
>Welcome to the POSTGRESQL interactive sql monitor:
>  Please read the file COPYRIGHT for copyright terms of POSTGRESQL
>
>   type \? for help on slash commands
>   type \q to quit
>   type \g or terminate with semicolon to execute query
> You are currently connected to the database: template1
>
>mydb=>
>- ---
>Template 1 should of course be mydb over here.
>since I'm just learning postgress I'm digging through the tutorial. I'll
>lett you know
>if I find more mistakes.
>
>Regards,
>Hans
>
>------------------------------
>
>Date: Thu, 18 Feb 1999 20:56:06 -0500
>From: Fred Wilson Horch <fhorch@ecoaccess.org>
>Subject: Can this be added to manual?
>
>I found this to be an extremely useful message to help understand how
>aggregates and joins work.  Can this be included in the manual for 6.5?
>
>In particular, the following commands would be nice to use as examples
>in the chapters on joins and using aggregates:
>
>> -- all that have ever existed (most recent)
>> SELECT * from stuff* s1 WHERE d = (SELECT MAX(d) FROM stuff* s2 WHERE
>> s1.id = s2.id);
>> -- records @ or before '2/2/1999 13:50:00'
>> SELECT * from stuff* s1 WHERE d = (SELECT MAX(d) FROM stuff* s2 WHERE
>> s1.id = s2.id and s2.d <= '2/2/1999 13:50:00');
>
>Just a suggestion,
>- --Fred
>
>Full message:
>
>> RE: [GENERAL] Missing features ?
>>
>>      From: "Jackson, DeJuan" <djackson@cpsgroup.com>
>>      To: Remigiusz Sokolowski <rems@gdansk.sprint.pl>, Joerg
>>      Huettmann <joerg.huettmann@informatik.tu-chemnitz.de>
>>      Subject: RE: [GENERAL] Missing features ?
>>      Date: Tue, 2 Feb 1999 13:55:39 -0600
>>
>> [Time travel] was depreciated because of it's high overhead verses it's
>> utility.  In other words not enough people were using it to make it
>> worth the cost in everyone's database.  There are many way that you can
>> design the same type of system in your own database.  I suggest using
>> inheritance and RULES. Example (assuming id is PRIMARY KEY):
>>
>> CREATE TABLE stuff (
>>  id INT,
>>  t TEXT,
>>  d DATETIME DEFAULT(DATETIME(NOW()))
>> );
>> CREATE UNIQUE INDEX stuff_pkey ON stuff(id);
>> CREATE TABLE old_stuff () INHERITS (stuff);
>> CREATE RULE del_stuff AS ON DELETE TO stuff DO
>>  INSERT INTO old_stuff SELECT old.*;
>> CREATE RULE up_stuff AS ON UPDATE TO stuff DO
>>  INSERT INTO old_stuff SELECT old.*;
>> INSERT INTO stuff (id, t) VALUES (1, 'Hello there.');
>> INSERT INTO stuff (id, t) VALUES (2, 'Hi there.');
>> INSERT INTO stuff (id, t) VALUES (3, 'Hello there again.');

>> INSERT INTO stuff (id, t) VALUES (4, 'Hi there once more.');
>> INSERT INTO stuff (id, t) VALUES (5, 'Hello there.');
>> UPDATE stuff SET d=now(), t='Hi' WHERE t='Hello there.';
>> DELETE FROM stuff WHERE id=2;
>> DELETE FROM stuff WHERE id=5;
>> -- current snapshot
>> SELECT * from stuff;
>> -- all that have ever existed (most recent)
>> SELECT * from stuff* s1 WHERE d = (SELECT MAX(d) FROM stuff* s2 WHERE
>> s1.id = s2.id);
>> -- records @ or before '2/2/1999 13:50:00'
>> SELECT * from stuff* s1 WHERE d = (SELECT MAX(d) FROM stuff* s2 WHERE
>> s1.id = s2.id and s2.d <= '2/2/1999 13:50:00');
>>
>> I think you get the idea.  If you want to store the date an item was
>> delete/updated rather than when it was inserted the rules become:
>> CREATE RULE del_stuff AS ON DELETE TO stuff DO
>>  INSERT INTO old_stuff SELECT old.id, old.t, datetime(now());
>> CREATE RULE up_stuff AS ON UPDATE TO stuff DO
>>  INSERT INTO old_stuff SELECT old.id, old.t, datetime(now());
>>
>> Hope this helps,
>>         -DEJ
>
>------------------------------
>
>End of pgsql-docs-digest V1 #411
>********************************
>
http://www.zinchik.net
 * Tell a man that there are 400 billion stars and he'll believe
   you. Tell him a bench has wet paint and he has to touch it.

pgsql-docs by date:

Previous
From: Fred Wilson Horch
Date:
Subject: Can this be added to manual?
Next
From: Bruno Bonnefoy
Date:
Subject: a few questions