3.1. Supported data types

Table 3-1. Overview of Firebird data type support in libfq

Data typeFirebird versionSupported?Notes
BIGINT yes 
BINARY(n) yes 
BLOB partialsubtype TEXT only
BOOLEAN3.0yes 
CHAR(n) yes 
DATE yes 
DECFLOAT4.0no 
DECIMAL yes 
DOUBLE PRECISION yes 
FLOAT yes 
INT yes 
INT1284.0yes 
NUMERIC yes 
SMALLINT yes 
TIME [WITHOUT TIME ZONE] yes 
TIME WITH TIME ZONE4.0yes 
TIMESTAMP [WITHOUT TIME ZONE] yes 
TIMESTAMP WITH TIME ZONE4.0yes 
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 typeFirebird versionSynonym for
FLOAT(bin_prec) FLOAT or DOUBLE PRECISION
REAL FLOAT

3.1.1. Array support

The Firebird array documentation chapter states:

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.

Given this statement, array support in libfq is not considered a priority.

3.1.2. isql-compatible output

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.