pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: News Subsystem <news@news.hub.org>
Date: Tue, 18 Dec 2012 19:15:42 -0400 (AST)
Message-ID: <201212182315.qBINFgMU011248@news.hub.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

        Tue, 18 Dec 2012 15:15:41 -0800 (PST)
Received: by 10.50.5.174 with SMTP id t14mr1993997igt.11.1355872541437; Tue,
 18 Dec 2012 15:15:41 -0800 (PST)
X-Newsgroups: pgsql.general
Date: Tue, 18 Dec 2012 15:15:41 -0800 (PST)
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=67.217.89.1; posting-account=lOEuBgoAAAD6Qw4dpoqeBAJHKoD58tcK
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6087737c-f946-4698-92f0-3ea72a56aa2b@googlegroups.com>
Subject: question about varchar
From: Rui Li <rui.vapps@gmail.com>
Injection-Date: Tue, 18 Dec 2012 23:15:41 +0000
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
To: pgsql-general@postgresql.org

In postgresql, we can create column as =93varchar(n)=94 where n is the size=
 of the char, or we can just define column as =93varchar=94
rli=3D# CREATE TABLE test (v1 varchar(100), v2 varchar);
CREATE TABLE
rli=3D# \d test
             Table "public.test"
Column |          Type          | Modifiers
--------+------------------------+-----------
v1     | character varying(100) |
v2     | character varying      |

so my question is: why should we even declare character varying(n) in postg=
resql when there=92s an easier options to declaring character varying (with=
out n)=20
is there any performance different between it? or some other reason we shou=
ld use varchar(n) instead of just varchar?

thanks for any help


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (2+ messages)  latest in thread

Message-ID: <201212182315.qBINFgMU011248@news.hub.org>
Permalink:  ../201212182315.qBINFgMU011248@news.hub.org/
Also on:    postgresql.org/message-id/201212182315.qBINFgMU011248@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: news@news.hub.org
  Subject: Re: 
  In-Reply-To: <201212182315.qBINFgMU011248@news.hub.org>
  References: <201212182315.qBINFgMU011248@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox