From: | Melvin Davidson <melvin6925(at)gmail(dot)com> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
Cc: | Frank Millman <frank(at)chagford(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Difficulty modelling sales taxes |
Date: | 2017-01-02 16:02:03 |
Message-ID: | CANu8Fixjb7HPNEkGnbLzen9RkNVhGrZ78ybf-WRp2ffz1FJPLw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, Jan 2, 2017 at 9:58 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:
> On 01/02/2017 06:38 AM, Melvin Davidson wrote:
>
>>
>> On Mon, Jan 2, 2017 at 6:29 AM, Frank Millman <frank(at)chagford(dot)com
>> <mailto:frank(at)chagford(dot)com>> wrote:
>>
>>
>> *From:* amul sul
>> *Sent:* Monday, January 02, 2017 12:42 PM
>> *To:* Frank Millman
>> *Cc:* pgsql-general
>> *Subject:* Re: [GENERAL] Difficulty modelling sales taxes
>>
>> > On Mon, Jan 2, 2017 at 4:03 PM, Frank Millman <frank(at)chagford(dot)com
>> <mailto:frank(at)chagford(dot)com>> wrote:
>> >
>> > Hi all
>> >
>> >
>> >
>> > It is a bit ugly, because I have to use the ‘NVARCHAR code’ column
>> from
>> >
>> > tax_codes, not the primary key, but I think it would work.
>> >
>> >
>> >
>> NVARCHAR ? Are you using PostgreSQL as database server?
>> >
>>
>>
>> Oops, sorry.
>>
>> I am testing with PostgreSQL and with SQL Server, so I was in the
>> wrong mindset when I posted.
>>
>> I should have said VARCHAR.
>>
>> Frank
>>
>>
>>
>>
>>
>> *First, there is no need to make row_id's when you already have a valid
>> primary key.
>>
>
> In a perfect world yes, but this is a world with ORM's as I found out the
> hard way:
>
> https://docs.djangoproject.com/en/1.10/ref/models/fields/#primary-key
>
> "The primary key field is read-only. If you change the value of the
> primary key on an existing object and then save it, a new object will be
> created alongside the old one."
>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>
*>https://docs.djangoproject.com/en/1.10/ref/models/fields/#primary-key
<https://docs.djangoproject.com/en/1.10/ref/models/fields/#primary-key>*
*You are quoting from a django document. Please don't muddle the waters.So
you are saying this will not work?UPDATE mytable SET mykey = 'new_value'
WHERE mykey = 'old_value';DELETE FROM mytable WHERE mykey = 'old_value';*
*Happy New Year Adrian*
--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2017-01-02 16:17:07 | Re: Difficulty modelling sales taxes |
Previous Message | Andy Colson | 2017-01-02 15:43:59 | Re: Queries on very big table |