Skip site navigation (1) Skip section navigation (2)

Re: [QUESTIONS] Re: [HACKERS] text should be a blob field

From: jwieck(at)debis(dot)com (Jan Wieck)
To: maillist(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian)
Cc: psqlhack(at)maidast(dot)demon(dot)co(dot)uk, Andreas(dot)Zeugswetter(at)telecom(dot)at, pgsql-hackers(at)hub(dot)org
Subject: Re: [QUESTIONS] Re: [HACKERS] text should be a blob field
Date: 1998-03-04 16:40:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Bruce wrote:

> > 1. Is there a call made by the backend to each datatype when a row is
> >    deleted? I can't see one.
> Well, you could have a RULE that deletes the large object at row
> deletion time.  However, if two rows point to the same large object, the
> first one deleting it would delete the large object for the other.  The
> only solution to this is to have a separate large object table, and use
> reference counts so only the last user of the object deletes it.

    I think triggers are more appropriate.

    On INSERT check that the large object referenced exists.

    On  UPDATE  if large object reference changes, check that new
    large object exists and  check  if  old  large  object  isn't
    referenced  any more in which case drop the old large object.

    On DELETE check if large object isn't referenced any more ...

    Yes - I like triggers :-)



# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #

In response to


pgsql-hackers by date

Next:From: Darren KingDate: 1998-03-04 17:12:29
Subject: Re: [HACKERS] PostgreSQL - the Linux of Databases...
Previous:From: Bruce MomjianDate: 1998-03-04 16:30:10
Subject: Re: [HACKERS] Speedups

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group