Re: Altering a column if it exists

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Altering a column if it exists
Дата
Msg-id 1389221010412-5785954.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Altering a column if it exists  (David Johnston <polobo@yahoo.com>)
Ответы Re: Altering a column if it exists  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
David Johnston wrote
>
> 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.

Not sure what I was thinking here but the space-issue cannot be right though
the "END" does need a semi-colon to be valid pl/pgsql.  Normally after the
semi-colon you would have a newline and then the closing dollar-quotes.
That layout is what I was looking for but mis-translated it into a
white-space error which is obviously wrong since $$somevalue$$ is indeed
valid.

David J.





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


В списке pgsql-novice по дате отправления:

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: Altering a column if it exists
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Altering a column if it exists