Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XbsSH-0001PG-Lp for pgsql-performance@arkaria.postgresql.org; Wed, 08 Oct 2014 14:43:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XbsSH-00026f-69 for pgsql-performance@arkaria.postgresql.org; Wed, 08 Oct 2014 14:43:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XbsSG-00026Z-BH for pgsql-performance@postgresql.org; Wed, 08 Oct 2014 14:43:04 +0000 Received: from oldperseverance.encs.concordia.ca ([132.205.96.92]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XbsS9-0005Vu-2P for pgsql-performance@postgresql.org; Wed, 08 Oct 2014 14:43:02 +0000 Received: from cacao.encs.concordia.ca (emilu@cacao.encs.concordia.ca [132.205.47.225]) by oldperseverance.encs.concordia.ca (envelope-from emilu@encs.concordia.ca) (8.13.7/8.13.7) with ESMTP id s98EgtZj009392; Wed, 8 Oct 2014 10:42:55 -0400 Message-ID: <54354D6F.1080002@encs.concordia.ca> Date: Wed, 08 Oct 2014 10:42:55 -0400 From: Emi Lu Reply-To: emilu@encs.concordia.ca User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.1 MIME-Version: 1.0 To: Andrew Dunstan CC: "pgsql-performance@postgresql.org" Subject: Re: char(N), varchar(N), varchar, text References: <543548B4.4060700@encs.concordia.ca> <54354A73.6030607@dunslane.net> In-Reply-To: <54354A73.6030607@dunslane.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.58 on oldperseverance.encs.concordia.ca at 2014-10-08 10:42:55 EDT X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org > >> >> For performance point of view, are there big differences between: >> char(N), varchar(N), varchar, text? >> >> Some comments from google shows: >> No difference, under the hood it's all varlena. Check this article >> from Depesz: >> http://www.depesz.com/index.php/2010/03/02/charx-vs-varcharx-vs-varchar-vs-text/ >> A couple of highlights: >> >> To sum it all up: >> >> * char(n) – takes too much space when dealing with values >> shorter than n, and can lead to subtle errors because of >> adding trailing spaces, plus it is problematic to change the >> limit >> * varchar(n) – it's problematic to change the limit in live >> environment >> * varchar – just like text >> * text – for me a winner – over (n) data types because it lacks >> their problems, and over varchar – because it has distinct name >> >> So, can I assume no big performance differences? >> Thanks alot! >> Emi >> > > > Why do you need to ask if you already have the answer? Depesz is right. Good to hear this. Well, sorry I saw the time is:/2010/03 (might changes for diff/newer versions). Thank you for the confirmation. Emi -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance