Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WEogD-0004v2-3N for pgsql-sql@arkaria.postgresql.org; Sat, 15 Feb 2014 23:29:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WEogC-0005Tw-KK for pgsql-sql@arkaria.postgresql.org; Sat, 15 Feb 2014 23:29:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WEogB-0005Tq-VB for pgsql-sql@postgresql.org; Sat, 15 Feb 2014 23:29:52 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WEog4-0004lu-0i for pgsql-sql@postgresql.org; Sat, 15 Feb 2014 23:29:51 +0000 Received: by mail-pa0-f43.google.com with SMTP id rd3so13745985pab.16 for ; Sat, 15 Feb 2014 15:29:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=73cmgPsK4Zzo4m2ejLIGyE8gPrT+gKOcP2oIKXuG4dY=; b=scheqVvqbcsj75VarEaC+VdzqrzZ3qAtFqQhD7U3LkzTt1jNnZyVsJr7Y+J6KkSK+r /0shadqB+X+M5Ru04zv2Rya6B/FilXt8X/cpQ1svHmVeycB9N6mRozveqTaTG1TNRlt2 wHxSsv5zOjrg8ykqh9AO++Kxo3IMDgQ7zxFCX246Rfe2jSkaJrZlPxRZu+df+u2DIFTv Nl/Elf1av2BZWPdWCkHtGG3J3jFeutTMfLs/E1gFzxYQOI0sPj8pupr8y1i7FSajq61Z 2ePiE3dEjNYM/XVr64QHILzmStjzGdRDZ3hYlEkvUdqndcr0vFx2QEDHhwAQpfO02nQF 4KtA== X-Received: by 10.68.137.195 with SMTP id qk3mr17740678pbb.9.1392506982062; Sat, 15 Feb 2014 15:29:42 -0800 (PST) Received: from panda.site (65-102-185-39.tukw.qwest.net. [65.102.185.39]) by mx.google.com with ESMTPSA id ja8sm30744575pbd.3.2014.02.15.15.29.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Feb 2014 15:29:41 -0800 (PST) Message-ID: <52FFF863.5060508@gmail.com> Date: Sat, 15 Feb 2014 15:29:39 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: James Sharrett , pgsql-sql@postgresql.org Subject: Re: dynamically referencing a column name in a function References: <52FFE6CC.8090605@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 02/15/2014 02:41 PM, James Sharrett wrote: > Thanks Adrian. The problem is that the data query will return many > columns all of which I need in later operations. For this specific block > in the process, I need to take a pair of columns, based on user inputs, > and run their values them thru the operations performed in the sub > function to perform some operations and return the results and I need the > values I pass into the parameter to be in sync with the recordset which > will have many records with the same values for the column pairs so > keeping the whole record being operated on in line with the values passed > to the sub-function becomes the difficult part. Iım trying to avoid using > a cursor but even with that I think I may run into similar issues. > Well I did say it probably would not scale:) Without a concrete example of the actual process it would be hard to offer any specific advice. -- Adrian Klaver adrian.klaver@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql