Search Postgresql Archives

Re: reduce number of multiple values to be inserted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 30, 2018 at 8:40 AM, Rob Sargent <robjsargent@xxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux