Re: Porting from Mysql to Postgres

Поиск
Список
Период
Сортировка
От Bob Kline
Тема Re: Porting from Mysql to Postgres
Дата
Msg-id Pine.LNX.4.10.10102011444130.25673-100000@rksystems.com
обсуждение исходный текст
Ответ на Porting from Mysql to Postgres  (Dror Matalon <dror@matal.com>)
Список pgsql-jdbc
On Thu, 1 Feb 2001, Dror Matalon wrote:

> 1. When I insert a CHAR field and then fetch it, I find out that the
> server padded it with spaces to the size of the field.

This is correct behavior, according to the SQL standard.

> This happens in Postgres but not in MySQL.

Actually, it happens in MySQL, too, sometimes, but it's not always easy
to predict intuitively when it will happen.

> I'm using String.trim() on it on the Java side. Is there a better
> way to do this, like setting a flag to tell the server to trim?

You could use VARCHAR instead of CHAR, but the approach you're using is
probably fine, because most (all?) Java runtimes perform that operation
very efficiently, without any unnecessary allocation/copying.

--
Bob Kline
mailto:bkline@rksystems.com
http://www.rksystems.com


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

Предыдущее
От: Dror Matalon
Дата:
Сообщение: Porting from Mysql to Postgres
Следующее
От: Peter T Mount
Дата:
Сообщение: Re: [INTERFACES] JDBC APPLET Problem