Re: Changing column types...

From: Thomas Lockhart <thomas(at)fourpalms(dot)org>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: lockhart(at)fourpalms(dot)org, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Changing column types...
Date: 2002-04-05 04:40:31
Message-ID: 3CAD2ABF.E93DFDDB@fourpalms.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > A few integer values are reserved values in abstime, to allow
> > implementation of infinity, -infinity, etc.
> Does this mean that hacking the type of an int4 column to become abstime is
> a bad idea?
> Yes in theory - no in practice?

Hmm. I assume that this is in the context of an "officially supported"
conversion strategy? I'm afraid I am not recalling the details of these
threads; my brain does not hold as much as it used to ;)

Anyway, if we are thinking of allowing some types to be converted in
place without actually modifying the contents of tuples, then for this
case the risks are relatively small afaicr. The reserved values are at
the high and low ends of the integer range, so there are some large (in
the absolute sense) integer values which would take on some unexpected
interpretations for an abstime value.

That said, I'm not sure why we would want to bother with hacking things
in this way (but if I recalled the details of the threads maybe I
would?).

istm that the general strategy for changing column types would require
marking a column as dead and adding a new column to replace it, or
writing an atomic copy / modify / replace operation for tables which
modifies tuples as it proceeds, or ?? Just because we may allow a hack
for text types because they happen to have a similar/identical storage
structure doesn't necessarily mean that it is a good design for the
general case. But you've probably already covered that territory...

- Thomas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2002-04-05 04:55:42 Re: Changing column types...
Previous Message Bruce Momjian 2002-04-05 03:22:57 Re: timeout implementation issues