libfq 0.6.1 Documentation | |||
---|---|---|---|
Prev | Up | Chapter 3. libfq data type support | Next |
Table 3-1. Overview of Firebird data type support in libfq
Data type | Firebird version | Supported? | Notes |
---|---|---|---|
BIGINT | yes | ||
BINARY(n) | yes | ||
BLOB | partial | subtype TEXT only | |
BOOLEAN | 3.0 | yes | |
CHAR(n) | yes | ||
DATE | yes | ||
DECFLOAT | 4.0 | no | |
DECIMAL | yes | ||
DOUBLE PRECISION | yes | ||
FLOAT | yes | ||
INT | yes | ||
INT128 | 4.0 | yes | |
NUMERIC | yes | ||
SMALLINT | yes | ||
TIME [WITHOUT TIME ZONE] | yes | ||
TIME WITH TIME ZONE | 4.0 | yes | |
TIMESTAMP [WITHOUT TIME ZONE] | yes | ||
TIMESTAMP WITH TIME ZONE | 4.0 | yes | |
VARBINARY(n) | yes | ||
VARCHAR | yes |
The following data types are synonyms for another type. Refer to the base type's entry in the preceding table for information about their support status.
Table 3-2. Synonym data types
Data type | Firebird version | Synonym for |
---|---|---|
FLOAT(bin_prec) | FLOAT or DOUBLE PRECISION | |
REAL | FLOAT |
The Firebird array documentation chapter states:
Given this statement, array support in libfq is not considered a priority.Firebird does not offer much in the way of language or tools for working with the contents of arrays, and there are no plans to improve this. This limits the usefulness and accessibility of array types. Therefore, the general advice is: do not use arrays.
For (presumably) historical reasons, isql displays FLOAT and DOUBLE PRECISION data types slightly differently to other clients, e.g.:
SQL> CREATE TABLE isql_output ( CON> float_val FLOAT, CON> double_precision_val DOUBLE PRECISION CON> ); SQL> INSERT INTO isql_output VALUES (1245.678911111222222, 999.1); SQL> SELECT * FROM isql_output; FLOAT_VAL DOUBLE_PRECISION_VAL ============== ======================= 1245.6790 999.1000000000000
libfq, and some other Firebird clients such as the Perl DBD::Firebird driver, would output these values as:
float_val | double_precision_val ------------------+---------------------------- 1245.67895507812 | 999.1
If required, libfq can be configured to emit output in the same way as isql by either calling FQconnectdbParams() with isql_values set to true, or executing the function FQsetIsqlValues().
Note that floating point output is a tricky field of endeavour and the libfq implementation may contain errors and/or be subject to change in future releases.