From: | Willy-Bas Loos <willybas(at)gmail(dot)com> |
---|---|
To: | Rémi Cura <remi(dot)cura(at)gmail(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: importing a messy text file |
Date: | 2014-04-30 09:50:06 |
Message-ID: | CAHnozTgmzDWsz+-3-g2W=UnhBAYTuBXAaUQb8w1m_6Rn_DHDXQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Apr 30, 2014 at 11:06 AM, Rémi Cura <remi(dot)cura(at)gmail(dot)com> wrote:
> with latest version 9.3 you can use a copy from with a programm as
> argument.
> You can use the unix | pipe for most of the stuff.
>
> If you have an older version you can use the mkfifo command to "trick"
> postgres into believing he will copy from a file.
>
>
Hi, you're right i can see the new feature in the docs.
But since i am working from the (bash) command line already, i don't see
any use for this.
I already pass the data like this:
cat <file> |psql -c "copy <table> from stdin NULL ''" <db> > <file>.log 2>&1
It's especially handy if you want to stay in sql(transaction), i gues.
Cheers,
--
Willy-Bas Loos
From | Date | Subject | |
---|---|---|---|
Next Message | Hello World | 2014-04-30 10:19:31 | Re: Security Issues: Allowing Clients to Execute SQL in the Backend. |
Previous Message | Albe Laurenz | 2014-04-30 09:44:04 | Re: Security Issues: Allowing Clients to Execute SQL in the Backend. |