why do i get 2 as answer for select length('aa '::char(6));

From: john snow <ofbizfanster(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: why do i get 2 as answer for select length('aa '::char(6));
Date: 2018-01-17 01:59:57
Message-ID: CAE67tvV20x9GtyPqfZdoK+WxxKYLC3SEjovw+xwGkVKcMqzsow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

as well as select length('aa'::char(6));

i thought if the string to be stored is shorter than specified length , it
will be padded with spaces?

i'm using version 10.0 on windows 10

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Andrej 2018-01-17 02:14:48 Re: why do i get 2 as answer for select length('aa '::char(6));
Previous Message Purav Chovatia 2018-01-16 14:50:55 symlinks in pg_xlog to wal of previous timeline, after a failover