From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: reduce number of multiple values to be inserted
Date: Tue, 29 May 2018 18:40:23 -0600
Message-ID: <61b9cfc8-6cc7-ba64-1ca0-628ff65e1710@gmail.com> (raw)
In-Reply-To: <364282d1-ee65-544e-cd12-aae964db3f4e@aklaver.com>
References: <CAA6wQLLRSCkVrxmo23pc1sbyW0rr5SQX8bTfMXA3WpgmH=48rQ@mail.gmail.com>
<364282d1-ee65-544e-cd12-aae964db3f4e@aklaver.com>
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)? ;)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: robjsargent@gmail.com
Subject: Re: reduce number of multiple values to be inserted
In-Reply-To: <61b9cfc8-6cc7-ba64-1ca0-628ff65e1710@gmail.com>
References: <CAA6wQLLRSCkVrxmo23pc1sbyW0rr5SQX8bTfMXA3WpgmH=48rQ@mail.gmail.com> <364282d1-ee65-544e-cd12-aae964db3f4e@aklaver.com> <61b9cfc8-6cc7-ba64-1ca0-628ff65e1710@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox