Re: Functions with COPY - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Functions with COPY
Date
Msg-id 20031128180256.GJ24094@ns.snowman.net
Whole thread Raw
In response to Re: Functions with COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Functions with COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> > No, I'm interested, as I discussed in my message[1], in the ability to
> > use functions in a copy statement to allow me to specify the conversion
> > from text to the appropriate data type.
>
> COPY is not intended to be that flexible; it's intended to be fast.

I wouldn't expect much of a speed difference between to_date() and
cast(text as date).  Is there some reason I'm not seeing to expect it to
be much slower?  My guess was that supporting this wouldn't involve
that much code change either but I'm probably wrong.

> You can do any amount of processing you want in an INSERT statement,
> though.

Certainly, but for bulk loads that requires more pre-processing work for
the user and I believe results in more work for the server too (it
certainly takes longer...).
Stephen

pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: about explain analyze
Next
From: Teodor Sigaev
Date:
Subject: Re: about explain analyze