BUG #14800: substring produces different results with similar types

From: kostin(dot)artem(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Cc: kostin(dot)artem(at)gmail(dot)com
Subject: BUG #14800: substring produces different results with similar types
Date: 2017-09-06 13:21:56
Message-ID: 20170906132156.25639.91622@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14800
Logged by: Артём Костин
Email address: kostin(dot)artem(at)gmail(dot)com
PostgreSQL version: 9.4.11
Operating system: Win 10
Description:

These two commands produce different results with similar types
select substring(cast(' 2345 ' as character(16)), 1, 7) || '?',
substring(cast(' 2345 ' as varchar(16)), 1, 7) || '?';

" 2345?";" 2345 ?"

Should it work in this way or not?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2017-09-06 13:27:38 Re: Old row version in hot chain become visible after a freeze
Previous Message Marcin Gozdalik 2017-09-06 12:33:55 "Error could not open relation with OID ..." when selecting from pg_views