Re: psql scripting tutorials

From: Blazej <bl(dot)oleszkiewicz(at)gmail(dot)com>
To: Artacus <artacus(at)comcast(dot)net>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql scripting tutorials
Date: 2008-09-12 20:37:09
Message-ID: 819df3760809121337o4fc71affn34e39b485154af7f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Ok then. Does anyone have any tips or best practices for scripting psql?
>
> I'll probably write some bash scripts to pull csv files over then script
> psql to do a COPY into an import schema then run a pl/pgsql procedure, er
> function, to do all ETL.
>
> Who else is doing something like this? Can psql access environmental
> variables or command line params? Or do I have to have my bash script write
> a psql script every time?
>

Maybe you should try pltcl/pltclu - it's very powerfull (and my
favorite) language for ETL within PostgreSQL server (read files, TCP,
regular expresion etc.). If you have XWindow based boxes you may use
tk package and even to use graphical user interface (for example
DialogBox as parameters input) on remotex boxes from pltclu (sometimes
I do that).

For external ETL I am using Java Eclipse or Eclipse RCP Framework and
embeded python language (formaly jython) - very important fact is that
jython scripts may controlled Eclipse widgets (for example
ProgressBar).

Regards,
Blazej

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2008-09-12 20:56:19 Re: Fastest way to restore a database
Previous Message Tom Lane 2008-09-12 19:55:46 Re: Fastest way to restore a database