Re: Altering a column if it exists - Mailing list pgsql-novice

From David Johnston
Subject Re: Altering a column if it exists
Date
Msg-id 1389220319470-5785949.post@n5.nabble.com
Whole thread Raw
In response to Re: Altering a column if it exists  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Altering a column if it exists  (David Johnston <polobo@yahoo.com>)
List pgsql-novice
Tom Lane-2 wrote
>> END$$;
>
> If you dig down through all the Java noise, the problem reported by the
> database server is:
>
>> org.postgresql.util.PSQLException: ERROR: unterminated dollar-quoted
>> string
>
> So apparently something on the client side is splitting this into more
> than one command to be sent to the server; it looks like that something
> thinks the first semicolon terminates the command, even though it's inside
> a quoted string.  Most likely, that code doesn't understand dollar-quoting
> at all.

More likely it is the fact that you do not have a space between "END" and
the "$$".

In certain situations there can be a problem using dollar-quoting with JDBC
- mainly in regards to JDBC-compliant escaping but I do not recall the
specifics at the moment - but a straight literal $$...$$ block works just
fine.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Altering-a-column-if-it-exists-tp5785924p5785949.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Altering a column if it exists
Next
From: David Johnston
Date:
Subject: Re: Altering a column if it exists