Re: ISO something like "#if 0 ... #endif" for SQL code

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: ISO something like "#if 0 ... #endif" for SQL code
Date: 2008-03-11 11:17:55
Message-ID: 20080311111755.GR1653@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 10, 2008 at 10:50:26AM -0500, Kynn Jones wrote:
> Hi! When it comes to programming SQL, my newbie approach is to write my
> code in a file test.sql, which I test from within psql by using
>
> my_db=> \i /some/path/test.sql
>
> ...and (once I'm satisfied with the code) copy and paste it to a different
> file that has the SQL I've written so far for the project.

I'm not quite sure if this would help your use case, but a few editors
allow you to send blocks of text to other processes. For example, under
Emacs I can hit Ctrl+C twice and it will grab the current paragraph
and send it off to psql, showing the results in another window. Once
I'm happy with the statement I leave it and move on to the next job
(committing changes to some SCM when appropriate).

Sam

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message André Volpato 2008-03-11 13:07:19 Re: PostgreSQL and MOLAP ?
Previous Message longlong 2008-03-11 10:55:29 Re: gsoc ideas