Thomas Lockhart <[EMAIL PROTECTED]> writes:
> 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 ?? J
"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes:
>> Hmm. Seems like that case, and the various ones involving adjustment of
>> char/varchar length by hacking atttypmod, would be useful to support via
>> ALTER COLUMN even if we don't have a full implementation. Essentially
>> this would be t
On Fri, 5 Apr 2002, Christopher Kings-Lynne wrote:
> > > 2. Since int4 and abstime are binary compatible (ie
> > int4::abstime works), is
> > > there any serious problem with updating a pg_attribute row for
> > an int4 and
> > > changing it to and abstime? My experiments seem to work.
> >
> > A
> > 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 "official
> > 4. Is there any worth in me submitting a patch that will allow
> rudimentary
> > column type changing, so long as the types are binary compatible???
>
> Hmm. Seems like that case, and the various ones involving adjustment of
> char/varchar length by hacking atttypmod, would be useful to suppo
> > 2. Since int4 and abstime are binary compatible (ie
> int4::abstime works), is
> > there any serious problem with updating a pg_attribute row for
> an int4 and
> > changing it to and abstime? My experiments seem to work.
>
> A few integer values are reserved values in abstime, to allow
> impl
> 1. What is the difference between abstime and timestamp - they seem to
> display equally...
abstime is four bytes with a range of +/- 68 years. timestamp is eight
bytes with a range from 4212BC to way into the future.
> 2. Since int4 and abstime are binary compatible (ie int4::abstime works),
"Christopher Kings-Lynne" <[EMAIL PROTECTED]> writes:
> 3. Is there any way of checking pg_type to check that two types are binary
> compatible and can be substiuted in this way?
Binary compatibility is not represented in pg_type (which is a shortcoming).
You have to use the IsBinaryCompatible()
Hi all,
Some questions:
1. What is the difference between abstime and timestamp - they seem to
display equally...
2. Since int4 and abstime are binary compatible (ie int4::abstime works), is
there any serious problem with updating a pg_attribute row for an int4 and
changing it to and abstime?