Re: psql is slow and it does not take much resources - Mailing list pgsql-general

From Alban Hertroys
Subject Re: psql is slow and it does not take much resources
Date
Msg-id 4459C33B.7010502@magproductions.nl
Whole thread Raw
In response to Re: psql is slow and it does not take much resources  ("Javier de la Torre" <jatorre@gmail.com>)
List pgsql-general
Javier de la Torre wrote:
> Great! Then there will be no problems.
>
> I would use COPY but I think I can not. While moving from MySQL to
> PostgreSQL I am also transforming a pair of fields, latitude,
> longitude, into a geometry field, POINT, that is understood for
> Potgis. I though I will not be able to use COPY when inserting data
> with functions.

I think you'd get better results COPYing into a (temporary) table (say
it's called 'fish') and then inserting your data into your table using
INSERT (...) SELECT ... FROM fish; with the necessary conversions.

I think it'll be still faster than a couple million seperate INSERTs,
and it gives you the opportunity to fix mistakes if you issue the above
command inside a transaction.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: The planner chooses seqscan+sort when there is an
Next
From: Gavin Hamill
Date:
Subject: Segfaults with 8.1.3 on amd64