Re: Does PLPythonU support COPY table FROM string? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Does PLPythonU support COPY table FROM string?
Date
Msg-id 55E0EFF1.4090802@aklaver.com
Whole thread Raw
In response to Re: Does PLPythonU support COPY table FROM string?  (Dominik Czarnota <dominik.b.czarnota@gmail.com>)
Responses Re: Does PLPythonU support COPY table FROM string?
List pgsql-general
On 08/28/2015 10:12 AM, Dominik Czarnota wrote:
> Oh... I have copied stacktrace generated from Python script which
> connects to the db using psycopg2 driver, so that's where this
> misleading psycopg2 error came from...
>
> About the list origin - I have to calculate a lot of stuff for each
> stock on stock exchange market. Each calculation requires quotes from
> the database - so to reduce io and not to fetch them everytime from
> Python, I've created a plpythonu function that calculates everything for
> each stock.
> As the results also have to stay in the database, I need to use the
> fastest possible method to insert a lot of data.

This means moving the results to another table?

Have you looked at plpy.cursor here:

http://www.postgresql.org/docs/9.4/interactive/plpython-database.html
>
> Another problem for those calculations would be parallelizing them
> somehow (I hope postgres clustering will do the work), but that's
> totally unrelated to the problem we are discussing now.
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: wal files stay in the pg_xlog dir
Next
From: Adrian Klaver
Date:
Subject: Re: Re: ERROR: collation "latin1_general_ci" for encoding "UTF8" does not exist