I have found that the varchar() change I made requires a new
pg_attribute field, so I am rolling back the change until I get a fully
working patch.

-- 
Bruce Momjian
maillist@candle.pha.pa.us

Wed, 7 Jan 1998 22:03:22 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
rollback varchar change
Bruce Momjian wrote:
> 
> I have found that the varchar() change I made requires a new
> pg_attribute field, so I am rolling back the change until I get a fully
  ^^^^^^^^^^^^^^^^^^

Please try some other way. As I remember, you said about breaking
vl_len into 2 parts - very nice for me, but I'd recommend to leave
varlena as is and add new structure - for compatibility and to allow
text (etc) be longer 2^16 someday (multi-representation feature).
Just like attlen -1 is used in many parts of code to flag varlena,
you could use -2 to flag new structure.

> working patch.

Vadim

Thu, 08 Jan 1998 11:47:36 +0700
"Vadim B. Mikheev" <vadim@sable.krasnoyarsk.su>
Re: [HACKERS] rollback varchar change
> 
> Bruce Momjian wrote:
> > 
> > I have found that the varchar() change I made requires a new
> > pg_attribute field, so I am rolling back the change until I get a fully
>   ^^^^^^^^^^^^^^^^^^
> 
> Please try some other way. As I remember, you said about breaking
> vl_len into 2 parts - very nice for me, but I'd recommend to leave
> varlena as is and add new structure - for compatibility and to allow
> text (etc) be longer 2^16 someday (multi-representation feature).
> Just like attlen -1 is used in many parts of code to flag varlena,
> you could use -2 to flag new structure.

OK, I have now figured out that my original idea was sound.  The only
problem is that I started using VARSIZE in varchar.c instead of the old
vcTruelen() function.  It turns out that constants have the full length
of the type with trailing nulls, and the disk data doesn't.  I put the
old comparison function back, and it seems to be working just fine now.

I will look through the code some more to make sure we are safe.  The
regression tests pass, so it must be working pefectly :-)  The attlen
field must contain -1 so it knows it is a varlena, and just references
the real attribute length when it needs to do some creation things.

That works fine for my purposes.

-- 
Bruce Momjian
maillist@candle.pha.pa.us

Thu, 8 Jan 1998 00:07:05 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] rollback varchar change
Bruce Momjian wrote:
> 
> >
> > Bruce Momjian wrote:
> > >
> > > I have found that the varchar() change I made requires a new
> > > pg_attribute field, so I am rolling back the change until I get a fully
> >   ^^^^^^^^^^^^^^^^^^
> >
> > Please try some other way. As I remember, you said about breaking
> > vl_len into 2 parts - very nice for me, but I'd recommend to leave
> > varlena as is and add new structure - for compatibility and to allow
> > text (etc) be longer 2^16 someday (multi-representation feature).
> > Just like attlen -1 is used in many parts of code to flag varlena,
> > you could use -2 to flag new structure.
> 
> OK, I have now figured out that my original idea was sound.  The only

Having new column in pg_attribute I'm not sure that we need in new
structure...

Vadim

Thu, 08 Jan 1998 12:54:15 +0700
"Vadim B. Mikheev" <vadim@sable.krasnoyarsk.su>
Re: [HACKERS] rollback varchar change