Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hyNHX-0007ux-2N for pgsql-general@arkaria.postgresql.org; Thu, 15 Aug 2019 21:27:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hyNHV-0004T7-8a for pgsql-general@arkaria.postgresql.org; Thu, 15 Aug 2019 21:27:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hyNHU-0004Sz-V3 for pgsql-general@lists.postgresql.org; Thu, 15 Aug 2019 21:27:37 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hyNHO-000191-9B for pgsql-general@postgresql.org; Thu, 15 Aug 2019 21:27:36 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id EC706993A2 for ; Thu, 15 Aug 2019 14:27:26 -0700 (PDT) Date: Thu, 15 Aug 2019 14:27:26 -0700 (PDT) From: Rich Shepard To: pgsql-general@postgresql.org Subject: Re: Variable constants ? In-Reply-To: <20190815205657.GA2593@panix.com> Message-ID: References: <20190815205657.GA2593@panix.com> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 15 Aug 2019, stan wrote: > I need to put a few bossiness constants, such as a labor rate multiplier > in an application. I am adverse to hard coding these things. The best plan > i have come up with so far is to store them in a table, which would have > only 1 row, and a column for each needed constant. > > Anyone have a better way to do this? > > Failing a better way is there some way I can limit this table to only > allow one row to exist? Stan, I've resolved similar issues with changing regulatory agency staff. For your application(s) I suggest a table like this: create table labor_rate_mult ( rate real primary_key, start_date date not null, end_date date ) This provides both a history of labor rate multipliers and the ability to select either the most current one or a previous one. If other factors affect the rate, add attribute columns for them. Regards, Rich