Re: Geographic data sources, queries and questions

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "John D(dot) Burger" <john(at)mitre(dot)org>, "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Geographic data sources, queries and questions
Date: 2007-06-01 12:53:13
Message-ID: 133DE50E-F6FC-447B-9257-786ADD26A1A3@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On May 30, 2007, at 11:51 , Gregory Stark wrote:

> Firstly trying to update such a key you'll immediately bump into
> the practical
> reasons why it doesn't work well. You have to update every record
> everywhere
> in the database that references that key which represents a lot of
> potential
> work.

As I mentioned earlier, if you plan on updating keys, you'd have ON
UPDATE CASCADE set, so there shouldn't be any work here. There may be
performance issues as those changes propagate, however.

> But secondly, what happens to applications that have read that
> value into
> their local state and then try to operate on it? When they return
> to perform a
> second operation and use the primary key to specify the record they
> wish to
> operate on they'll find it gone.

This is an interesting point. What this boils down to is having a
method of cascade the key changes outside of the database. Depending
on how long the data is cached and how gracefully the application
deals with errors when the lookup value is no longer present. In a
case where you know primary keys are going to be updating, you'd
probably want some additional key attribute that *is* stable for use
outside of the database. Anyway, thanks for the food for thought!

Michael Glaesemann
grzm seespotcode net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Teodor Sigaev 2007-06-01 12:58:09 Re: warm standby server stops doing checkpoints afterawhile
Previous Message Richard Huxton 2007-06-01 12:50:26 Re: ERROR: domain domain1 does not allow null values