Re: [HACKERS] Changing column types...

2002-04-05 Thread Tom Lane
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

Re: [HACKERS] Changing column types...

2002-04-05 Thread Tom Lane
"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

Re: [HACKERS] Changing column types...

2002-04-04 Thread Gavin Sherry
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

Re: [HACKERS] Changing column types...

2002-04-04 Thread Thomas Lockhart
> > 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

Re: [HACKERS] Changing column types...

2002-04-04 Thread Christopher Kings-Lynne
> > 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

Re: [HACKERS] Changing column types...

2002-04-04 Thread Christopher Kings-Lynne
> > 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

Re: [HACKERS] Changing column types...

2002-04-04 Thread Thomas Lockhart
> 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),

Re: [HACKERS] Changing column types...

2002-04-04 Thread Tom Lane
"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()

[HACKERS] Changing column types...

2002-04-03 Thread Christopher Kings-Lynne
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?