Problem with sql ant task

From: "Alejandra Juarez D'Aquino" <alejandradaquino(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Problem with sql ant task
Date: 2011-09-02 18:58:11
Message-ID: CAOUzaq4010-9gJE2AM=3NokVG1YVw4mYR+PuHBGZMq=A4evNMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi, I'm new using Posgres and in Ant as well.
I'm trying to use an ant task (sql) to run ours sql scripts to update the
database... The test should be re-runnables, so, I was looking for a way to
do it and I found this

create or replace function execute(TEXT) RETURNS VOID AS $$ BEGIN EXECUTE
$1; END ;

$$ LANGUAGE plpgsql STRICT;

select execute('create table CLIENTES.TEST (x int4); ') where not exsist...;

but when I try to do something like that

select execute($$'create table CLIENTES.TEST (
important_field text not null default 's'
); '$$);

I am suposed to use $$, however the ant task throws the following exception
org.postgresql.util.PSQLException: ERROR: error de sintaxis en o cerca de
«$»

Any Idea why is this happening? in pgAdmin it runs ok.

Thanks very much...

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message ml-tb 2011-09-03 13:47:42 Re: Problem with sql ant task
Previous Message Maciek Sakrejda 2011-08-31 18:47:08 Re: time zone setting.