Re: reduce number of multiple values to be inserted

From: tango ward <tangoward15(at)gmail(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: reduce number of multiple values to be inserted
Date: 2018-05-30 00:49:27
Message-ID: CAA6wQLLg1KT=2uzrLtNQhjxENnBeg2w7ensKmLBZJSqXYxTRGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, May 30, 2018 at 8:40 AM, Rob Sargent <robjsargent(at)gmail(dot)com> wrote:

>
>
>
> On 05/29/2018 06:36 PM, Adrian Klaver wrote:
>
>> On 05/29/2018 05:10 PM, tango ward wrote:
>>
>>>
>>> Hi,
>>>
>> Not sure where you are pulling the data from and how it is ordered, but
>> an outline:
>>
>> data_input (Assuming sorted by village and then age)
>>
>> for village in data_input:
>> for age in village:
>> curr_pgsql.execute('''
>> INSERT INTO student (created, modified, name,
>> address, age, level)
>> VALUES(current_timezone, current_timezone,
>> %s, %s, %s, 2)''', (name, village, age))
>>
>>
>>>
>>> Thanks,
>>> J
>>>
>>>
>>
>> You might need random(name)? ;)

Noted. Thank you Sirs. I love you both.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2018-05-30 00:53:12 Re: found xmin from before relfrozenxid on pg_catalog.pg_authid
Previous Message Rob Sargent 2018-05-30 00:40:23 Re: reduce number of multiple values to be inserted