Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why char datatype is converted to bpchar automatically?

Is there any possible to convert CHAR datatype into bpchar automatically?

We have seen the scenario which selected column datatype is CHAR from application end but database level bpchar got created.

Can anyone help me on this?

like image 829
Ram Avatar asked Jul 19 '18 11:07

Ram


People also ask

What is datatype Bpchar?

The BPCHAR function returns a varying-length character string representation of a value of a different data type. BPCHAR ( expression ) The schema is SYSIBM. The BPCHAR scalar function is a synonym for the VARCHAR scalar function.

What is Bpchar data type in PostgreSQL?

Bpchar (Blank Padded Character): The blank padded character is the concept of PostgreSQL, or Oracle used for character data type, i.e., char(n). You can say that it is an inside name for the data type char(n). As we know, blank means empty or hollow.

What is maximum length of CHARACTER VARYING Postgres?

What is PostgreSQL Varchar datatype? In PostgreSQL, the Varchar data type is used to keep the character of infinite length. And it can hold a string with a maximum length of 65,535 bytes.


1 Answers

https://www.postgresql.org/docs/current/static/datatype-character.html

character(n), char(n) fixed-length, blank padded

Effectively in bpchar b stands for blank and p stands for padded and bpchar is same as char(n) or character(n), a blank padded to n length string...

More quotes:

https://www.postgresql.org/docs/current/static/typeconv-query.html

bpchar (“blank-padded char”, the internal name of the character data type)

like image 66
Vao Tsun Avatar answered Sep 17 '22 15:09

Vao Tsun