提交 55c42f0b authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Extract Constants.PG_VERSION

上级 bfdfcceb
......@@ -992,7 +992,7 @@ public class Parser {
buff.append("'ISO' AS DATESTYLE FROM DUAL");
} else if (readIf("SERVER_VERSION")) {
// for PostgreSQL compatibility
buff.append("'8.2.23' AS SERVER_VERSION FROM DUAL");
buff.append("'" + Constants.PG_VERSION + "' AS SERVER_VERSION FROM DUAL");
} else if (readIf("SERVER_ENCODING")) {
// for PostgreSQL compatibility
buff.append("'UTF8' AS SERVER_ENCODING FROM DUAL");
......
......@@ -525,6 +525,11 @@ public class Constants {
*/
public static final int QUERY_STATISTICS_MAX_ENTRIES = 100;
/**
* Announced version for PgServer.
*/
public static final String PG_VERSION = "8.2.23";
private Constants() {
// utility class
}
......
......@@ -392,7 +392,7 @@ public class PgServer implements Service {
* @return the server name and version
*/
public static String getVersion() {
return "PostgreSQL 8.2.23 server protocol using H2 " +
return "PostgreSQL " + Constants.PG_VERSION + " server protocol using H2 " +
Constants.getFullVersion();
}
......
......@@ -33,6 +33,7 @@ import java.util.Properties;
import org.h2.command.CommandInterface;
import org.h2.engine.ConnectionInfo;
import org.h2.engine.Constants;
import org.h2.engine.SysProperties;
import org.h2.jdbc.JdbcConnection;
import org.h2.jdbc.JdbcPreparedStatement;
......@@ -949,7 +950,7 @@ public class PgServerThread implements Runnable {
sendParameterStatus("integer_datetimes", "off");
sendParameterStatus("is_superuser", "off");
sendParameterStatus("server_encoding", "SQL_ASCII");
sendParameterStatus("server_version", "8.2.23");
sendParameterStatus("server_version", Constants.PG_VERSION);
sendParameterStatus("session_authorization", userName);
sendParameterStatus("standard_conforming_strings", "off");
// TODO PostgreSQL TimeZone
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论