PostgreSQL is an open source, highly functional and popular relational database. Here are points to note when using PostgreSQL.

  • The maximum length of table name (Wagby's model name) is 63 characters.
  • The maximum length of column name (Wagby's model item name) is 30 characters.
  • When using UTF - 8 for database character encoding, please use version 8.1.7 or later or 8.2.2 or later version.Surrogate pair character adopted in Windows VistaYou can register.[More ...]

Settings required for PostgreSQL 9.1 or later

From PostgreSQL 9.1, a specification change that does not escape SQL backslashes was done. Therefore, when using from Wagby, please change the setting file postgresql.conf as follows.

Standard_conforming_strings = off escape_string_warning = off

Please restart PostgreSQL after changing the configuration file.

This makes it possible to have the same behavior as the previous PostgreSQL.

When it does not correspond

At run time an error message similar to the following is logged:

[ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelperlogExceptions] ERROR: Invalid escape sequence Hint: Escape character must be empty or one character.

Confirm whether the setting was reflected correctly

Execute the following SQL from pgAdmin or psql to confirm the setting.

show standard_conforming_strings;

If the output result is "off", the setting change is reflected.

The type specified by Wagby is handled as follows in the database.

Integer type int4
String type varchar(255)
String type (text area) text (1GB)
Date type date
Time type time
Date Time Type timestamp
File type (file name) varchar(255)
1 byte integer int2
2 byte integer int2
4 byte integer int4
8 byte integer int8
4 byte floating point number float4
8 byte floating point number float8
Fixed value (creation date / update date) timestamp
Other (URL type / mail address type etc.) varchar(255)
  • For model reference, it follows the type of the primary key of the referenced model.
  • Developers can also change the type.For details, refer to "Repository> Definition of model item> Database detailsPlease read.
The number specified by varchar type is "byte" or "character" unit.It depends on the character encoding of the table to be created.With SQL_ASCII, byte unit, UNICODE, SJIS, EUC_JP will be in character units.Please check the PostgreSQL manual for details.

9.1.0

Since PostgreSQL 9.1.0, the default value of standard_conforming_strings in postgresql.conf has been changed to on.

If you leave the default, you will get an error when referring to the character string, so please change the setting value and escape_string_warning to off.