X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2A8889DC9CB for ; Thu, 16 Feb 2006 05:39:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39544-03 for ; Thu, 16 Feb 2006 05:39:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx1.hive.is (scania.ipf.is [85.197.192.147]) by postgresql.org (Postfix) with SMTP id 7449F9DC840 for ; Thu, 16 Feb 2006 05:39:52 -0400 (AST) Received: (qmail 37940 invoked by uid 1010); 16 Feb 2006 09:39:58 -0000 Received: from 85.197.216.186 by scania.ipf.is (envelope-from , uid 1009) with qmail-scanner-1.25-st-qms (clamdscan: 0.88/1283. spamassassin: 3.1.0. perlscan: 1.25-st-qms. Clear:RC:1(85.197.216.186):SA:0(-4.4/4.0):. Processed in 0.28505 secs); 16 Feb 2006 09:39:58 -0000 X-Antivirus-HIVE-Mail-From: gnari@hive.is via scania.ipf.is X-Antivirus-HIVE: 1.25-st-qms (Clear:RC:1(85.197.216.186):SA:0(-4.4/4.0):. Processed in 0.28505 secs Process 37929) Received: from dsl-216-186.hive.is (HELO ?192.168.1.34?) (85.197.216.186) by mx1.hive.is with SMTP; 16 Feb 2006 09:39:57 -0000 Subject: Re: [SQL] to count no of columns in a table From: Ragnar To: AKHILESH GUPTA Cc: pgsql-general@postgresql.org, pgsql-sql@postgresql.org In-Reply-To: References: Content-Type: text/plain Date: Thu, 16 Feb 2006 09:40:36 +0000 Message-Id: <1140082836.32324.38.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.218 required=5 tests=[AWL=0.218] X-Spam-Score: 0.218 X-Spam-Level: X-Archive-Number: 200602/660 X-Sequence-Number: 91325 On fim, 2006-02-16 at 14:43 +0530, AKHILESH GUPTA wrote: > i just want to know one thing that is there any function in PGSQL > which gives me the total number of columns in a table. > OR > just like we are using count(*), it gives us total number or rows in a > table, just like i want to know the total number of columns present in > the table this is the kind of thing the information_schema is for select count(*) from information_schema.columns where table_name='x'; gnari