Search Postgresql Archives

Re: [HACKERS] 'a' == 'a '

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Travers <chris@xxxxxxxxxxxxxxxxxx> writes:
> IIrc, varchar and bpchar are stored in a similar way, but are presented 
> differently when retrieved.  I.e. storage is separate from presentation 
> in this case.  I.e. the padding in bpchar occurs when it is presented 
> and stripped when it is stored.

This is not so, although I've occasionally wondered whether we shouldn't
try to make it so.  Certainly we don't rely on char(N) to be physically
fixed-width (and can't, at least not with variable-width character
encodings) so there can be no performance advantage to actually storing
the insignificant spaces.  The hard part would be in figuring out how
the output routine could know how many spaces to add back.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux