From sgnerd@yahoo.com.sg Tue Jan 20 07:14:52 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id ED8FFD1CCA8 for ; Tue, 20 Jan 2004 07:14:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 44591-06 for ; Tue, 20 Jan 2004 03:14:23 -0400 (AST) Received: from smtp103.mail.sc5.yahoo.com (smtp103.mail.sc5.yahoo.com [66.163.169.222]) by svr1.postgresql.org (Postfix) with SMTP id 85B40D1CC94 for ; Tue, 20 Jan 2004 03:14:20 -0400 (AST) Received: from unknown (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp103.mail.sc5.yahoo.com with SMTP; 20 Jan 2004 07:14:18 -0000 Message-ID: <005101c3df24$2662ed20$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "psql" Subject: Fetching a single column from a record returning function Date: Tue, 20 Jan 2004 11:42:54 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004A_01C3DF4A.8A7BF7E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_40_50 X-Spam-Level: X-Archive-Number: 200401/174 X-Sequence-Number: 16567 This is a multi-part message in MIME format. ------=_NextPart_000_004A_01C3DF4A.8A7BF7E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Friends, Postgres 7.3.4 on RH Linux 7.2 I am using a record variable inside a functions and fetch the result via th= e follow command select * from .fn_email(1)=20 as (email_folder_id int4,email_folder_name varchar,descrip varchar,msgcount= int8,unreadcount int8,size int8); Is it possible to fetch only one column (the 'msgcount') from the function.= Because I am interested in SUM(msgcount). Please shed some light. Regards kumar ------=_NextPart_000_004A_01C3DF4A.8A7BF7E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Friends,
 
Postgres 7.3.4 on RH Linux 7.2
 
I am using a record variable inside a functions and&nbs= p;fetch=20 the result via the follow command
 
select * from .fn_email(1)
as (email_folder_id=20 int4,email_folder_name varchar,descrip varchar,msgcount int8,unreadcount=20 int8,size int8);
 
 
Is it possible to fetch only one column (the 'msgcount'= ) from=20 the function. Because I am interested in SUM(msgcount).  Please shed s= ome=20 light.
 
Regards
kumar

------=_NextPart_000_004A_01C3DF4A.8A7BF7E0-- From tgl@sss.pgh.pa.us Tue Jan 20 15:58:32 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1746AD1CB56 for ; Tue, 20 Jan 2004 15:58:32 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 56069-02 for ; Tue, 20 Jan 2004 11:58:05 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B88DAD1B47D for ; Tue, 20 Jan 2004 11:58:00 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id i0KFw5pH024271; Tue, 20 Jan 2004 10:58:05 -0500 (EST) To: "Kumar" Cc: "psql" Subject: Re: Fetching a single column from a record returning function In-reply-to: <005101c3df24$2662ed20$7502a8c0@hdsc.com> References: <005101c3df24$2662ed20$7502a8c0@hdsc.com> Comments: In-reply-to "Kumar" message dated "Tue, 20 Jan 2004 11:42:54 +0530" Date: Tue, 20 Jan 2004 10:58:04 -0500 Message-ID: <24270.1074614284@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/186 X-Sequence-Number: 16579 "Kumar" writes: > select * from fn_email(1) > as (email_folder_id int4,email_folder_name varchar,descrip varchar,msgcount > int8,unreadcount int8,size int8); > Is it possible to fetch only one column (the 'msgcount') from the function.= > Because I am interested in SUM(msgcount). Please shed some light. select sum(msgcount) from fn_email(1) as (email_folder_id int4,email_folder_name varchar,descrip varchar,msgcount int8,unreadcount int8,size int8); regards, tom lane From mail@joeconway.com Tue Jan 20 16:15:22 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1ED6DD1D437 for ; Tue, 20 Jan 2004 16:15:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 59462-07 for ; Tue, 20 Jan 2004 12:14:50 -0400 (AST) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 4D3FAD1E7F1 for ; Tue, 20 Jan 2004 12:14:49 -0400 (AST) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 779323; Tue, 20 Jan 2004 08:11:52 -0800 Message-ID: <400D539D.9090102@joeconway.com> Date: Tue, 20 Jan 2004 08:13:17 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kumar Cc: psql Subject: Re: Fetching a single column from a record returning function References: <005101c3df24$2662ed20$7502a8c0@hdsc.com> In-Reply-To: <005101c3df24$2662ed20$7502a8c0@hdsc.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/187 X-Sequence-Number: 16580 Kumar wrote: > select * from .fn_email(1) as (email_folder_id int4,email_folder_name > varchar,descrip varchar,msgcount int8,unreadcount int8,size int8); > > Is it possible to fetch only one column (the 'msgcount') from the > function. Because I am interested in SUM(msgcount). Please shed some > light. What's wrong with: select msgcount from fn_email(1) as (email_folder_id int4,email_folder_name varchar,descrip varchar,msgcount int8,unreadcount int8,size int8); ? Try showing us more detail about what you want to do and why it isn't currently working. Joe From sgnerd@yahoo.com.sg Wed Jan 21 07:06:24 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D6B99D1B4D1 for ; Wed, 21 Jan 2004 07:06:24 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 57829-01 for ; Wed, 21 Jan 2004 03:05:54 -0400 (AST) Received: from smtp106.mail.sc5.yahoo.com (smtp106.mail.sc5.yahoo.com [66.163.169.226]) by svr1.postgresql.org (Postfix) with SMTP id 207DFD1B45A for ; Wed, 21 Jan 2004 03:05:52 -0400 (AST) Received: from unknown (HELO IVESIA67) (sgnerd@203.196.190.138 with login) by smtp106.mail.sc5.yahoo.com with SMTP; 21 Jan 2004 07:05:51 -0000 Message-ID: <002e01c3dfec$200d6310$7502a8c0@hdsc.com> Reply-To: "Kumar" From: "Kumar" To: "Tom Lane" Cc: "psql" References: <005101c3df24$2662ed20$7502a8c0@hdsc.com> <24270.1074614284@sss.pgh.pa.us> Subject: Re: Fetching a single column from a record returning function Date: Wed, 21 Jan 2004 11:59:02 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/189 X-Sequence-Number: 16582 Yes it worked. Thanks ----- Original Message ----- From: "Tom Lane" To: "Kumar" Cc: "psql" Sent: Tuesday, January 20, 2004 9:28 PM Subject: Re: [SQL] Fetching a single column from a record returning function > "Kumar" writes: > > select * from fn_email(1) > > as (email_folder_id int4,email_folder_name varchar,descrip varchar,msgcount > > int8,unreadcount int8,size int8); > > > Is it possible to fetch only one column (the 'msgcount') from the function.= > > Because I am interested in SUM(msgcount). Please shed some light. > > select sum(msgcount) from fn_email(1) > as (email_folder_id int4,email_folder_name varchar,descrip varchar,msgcount > int8,unreadcount int8,size int8); > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings