Re: [HACKERS] Number of index fields configurable - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Number of index fields configurable
Date
Msg-id 3039.947516818@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Number of index fields configurable  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [HACKERS] Number of index fields configurable
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I will tweek the code to properly check for trailing numbers.  Right now
> multiple spaces cause problems, and trailing numbers are ignored.  With
> oidn, we can get away with trailing zeros because an oid of 0 is
> invalid, but with int2n, a zero is valid, so I think we can't just ignore
> extra trailing zeros.  We can pad with zeros, however.  Comments?

For the primary use of these things, which is attribute numbers in
pg_index, padding or dropping zeroes is correct behavior --- unused
positions in the vector will have zero values, same as for the oid
vector.  I think it's OK to define the type's behavior suitably for
the system's use, because it's not intended as a general-purpose user
type; users oughta be using int2[].  (Really, the only reason we have
these types at all is that we depend on having compile-time-constant
field sizes in the system catalogs that are accessed via
include/catalog/'s struct declarations...)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Number of index fields configurable
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Shared library version