Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5CB1D1337B92 for ; Wed, 23 Mar 2011 20:05:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 90002-02 for ; Wed, 23 Mar 2011 23:05:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 34F471337B8B for ; Wed, 23 Mar 2011 20:05:24 -0300 (ADT) Received: by vws1 with SMTP id 1so6072971vws.19 for ; Wed, 23 Mar 2011 16:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=uXEn+AaS7N6yNALx2KG73f3KcocJ74IVMIOJQdOSMHk=; b=LGhm3BIy01uKCXUvLHqBBGkNfODi55rkSGWQWHzTX/oFbyZDYR7l0v3+RKr6RYrv/W Yg4m5hZSsJVLm/Z/Py0IEZACAPPXmpZ94lhham0CcFeu3/mwbtN2W/CmjBVTOq2KJDiS Ras9FTpQP4hX2uuJnxDdCkY5yGjzoMyw++GKQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Z4Gb8XWUuJ3ao68HnyttZg4cxQhQ+utFI0EV/unEC4u3hWDDooLLS5OeBFZVbUSwu4 o4b3j5HLtTc9e36L6F3swkriRJ0KQV61nirfWTgdZAQvMJ7aEhczkV7U6BmIFoIgTDS6 3GrrHYm+QMHdpQ4/aJ+EV5tgDlfxEMFEA0ntY= MIME-Version: 1.0 Received: by 10.52.18.44 with SMTP id t12mr7559525vdd.274.1300921524292; Wed, 23 Mar 2011 16:05:24 -0700 (PDT) Received: by 10.220.193.133 with HTTP; Wed, 23 Mar 2011 16:05:24 -0700 (PDT) Date: Thu, 24 Mar 2011 00:05:24 +0100 Message-ID: Subject: pg_attributte, data types From: =?UTF-8?Q?Viktor_Bojovi=C4=87?= To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=20cf30549f59560e05049f2e6523 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.588 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201103/36 X-Sequence-Number: 35238 --20cf30549f59560e05049f2e6523 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable while listing data types i have noticed that some types have underscore prefix but i don't know why is that. so im asking if somene can tell me. These are type examples: _char _float4 _int2 _oid _regtype _text _varchar select distinct typname from ( SELECT attname AS name, attnum , typname, atttypmod - 4 as length, attnotnull AS notnull, atthasdef AS def, c.oid AS tbloid, d.adsrc AS defval, ds.description, attndims AS dimnum, attstattarget, attislocal, attinhcount FROM pg_attribute a INNER JOIN pg_class c ON a.attrelid =3D c.oid INNER JOIN pg_type t ON a.atttypid =3D t.oid LEFT OUTER JOIN pg_attrdef d ON d.adrelid =3D c.oid AND d.adnum =3D a.attnu= m LEFT OUTER JOIN pg_description ds ON ds.objoid =3D c.oid AND ds.objsubid = =3D a.attnum INNER JOIN pg_namespace n ON t.typnamespace =3D n.oid WHERE attnum > 0 AND attisdropped <> 't' ORDER BY a.attnum ) as foo --=20 --------------------------------------- Viktor Bojovi=C4=87 --------------------------------------- Wherever I go, Murphy goes with me --20cf30549f59560e05049f2e6523 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
while listing data types i have noticed that some types have underscor= e prefix but i don't know why is that. so im asking if somene can tell = me.
These are type examples:

_char
_float4
_int2
_oid
_regtype
_text
_varchar


select distinct typname
from
(
SELECT attname AS nam= e,
attnum ,
typname,
atttypmod - 4 as length,=
attnotnull AS notnull,
atthasdef AS def,
c.oid A= S tbloid,
d.adsrc AS defval,
ds.description,
= attndims AS dimnum,
attstattarget,
attislocal,
= attinhcount

FROM pg_attribute a
INNER JOIN pg_class c ON a.attrelid =3D c.o= id
INNER JOIN pg_type t ON a.atttypid =3D t.oid
LEFT OUTER = JOIN pg_attrdef d ON d.adrelid =3D c.oid AND d.adnum =3D a.attnum
L= EFT OUTER JOIN pg_description ds ON ds.objoid =3D c.oid AND ds.objsubid =3D=
a.attnum
INNER JOIN pg_namespace n ON t.typnamespace =3D n.oi= d
WHERE attnum > 0 AND
attisdropped <> 't'
= ORDER BY a.attnum
) as foo


--
---------------------------------------
Viktor Bojovi=C4=87
--= -------------------------------------
Wherever I go, Murphy goes with me=
--20cf30549f59560e05049f2e6523--