pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: How to insert from linux to postgreSQL
Date: Mon, 8 Apr 2019 14:18:18 -0500
Message-ID: <ecfa6666-5334-7811-8328-2a953b76c932@gmail.com> (raw)
In-Reply-To: <4FB9BF8B-D26C-40FB-9A9C-DEB4FB016292@illinois.edu>
References: <4FB9BF8B-D26C-40FB-9A9C-DEB4FB016292@illinois.edu>

On 4/8/19 2:03 PM, Campbell, Lance wrote:
>
> PostgreSQL 10.x
>
> Use case:
>
> I want to read a log file on my linux server and write each line out to a 
> row in a postgreSQL table.
>

Presumably some manipulations need to be performed so that you can't just do 
COPY FROM STDIN?

> When I do inserts however I want to make sure I am using prepared 
> statements to avoid SQL injections.  I know how to do this is Java but I 
> have not found an example using a linux bash scripts.
>
> Does anyone have an example they could point me to?
>

I think the problem is that you need an open connection to use prepared 
statements, and you can't do that in bash.  What about using Python?  (After 
all, that's a scripting language, too.)


-- 
Angular momentum makes the world go 'round.

view thread (6+ messages)  latest in thread

Message-ID: <ecfa6666-5334-7811-8328-2a953b76c932@gmail.com>
Permalink:  ../ecfa6666-5334-7811-8328-2a953b76c932@gmail.com/
Also on:    postgresql.org/message-id/ecfa6666-5334-7811-8328-2a953b76c932@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: How to insert from linux to postgreSQL
  In-Reply-To: <ecfa6666-5334-7811-8328-2a953b76c932@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox