Re: Chante domain type - Postgres 9.2 - Mailing list pgsql-general

From Tom Lane
Subject Re: Chante domain type - Postgres 9.2
Date
Msg-id 998.1474901921@sss.pgh.pa.us
Whole thread Raw
In response to Re: Chante domain type - Postgres 9.2  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-general
Rob Sargent <robjsargent@gmail.com> writes:
> On 09/26/2016 08:14 AM, Adrian Klaver wrote:
>> https://www.postgresql.org/docs/9.5/static/datatype-character.html
>> ".. If character varying is used without length specifier, the type
>> accepts strings of any size. The latter is a PostgreSQL extension."

> Does that trick remove the overhead (length check) Tom mentioned upstream?

Partly.  It should get rid of actual calls to the varchar length checking
function.  There's still some distributed overhead arising from the fact
that text, not varchar, is the native string type in Postgres.  So for
example anyplace you apply a concatenation operator, varchar inputs have
to be casted to text, and the result has to be casted to varchar if it's
being stored into a varchar field.  I've never seen any serious attempt
to quantify how much that costs, but it's not zero.

            regards, tom lane


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Chante domain type - Postgres 9.2
Next
From:
Date:
Subject: Re: Stats update difference between VACUUM ANALYZE and ANALYZE in 9.2?