Re: Custom Insert function - Mailing list pgsql-general

From Jan Wieck
Subject Re: Custom Insert function
Date
Msg-id 200109210608.f8L68Ca01506@saturn.jw.home
Whole thread Raw
In response to Custom Insert function  ("Brian C. Doyle" <bcdoyle@mindspring.com>)
List pgsql-general
Brian C. Doyle wrote:
> Hello all,
>
> Is it possible to create a function that would look like
> this_function('file.csv');
>
> and make it run
> COPY this_table FROM '/this/location/file.csv' USING DELIMITERS ',';
>
> Thus eliminating alot of repeated work each time???
>
> if so what would I put on the returns

    Looks like a job for PL/TclU. It could read an external file,
    do all the necessary conversions with Tcl's enhanced  regular
    expressions  and  execute  inserts  unsing  a prepared INSERT
    plan.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


pgsql-general by date:

Previous
From: "Karen Ellrick"
Date:
Subject: Re: Second byte of multibyte characters causing trouble
Next
From: R Talbot
Date:
Subject: Problem: Failed Make on Linux Pgres v. 7.1.2