Next: , Up: Postgresql   [Index]


7.1 Representation in Octave of types specific to Postgresql

For the general types, defined by SQL and potentially available in each database implementation, see SQL data types.

The last column indicates whether the SQL type is automatically deduced by this packages functions from the representation of the data in Octave. If not, the correct SQL type must be specified by the user if the data is sent from Octave to the database.

PostgresqlOctaveauto
oiduint32 scalaryes
textstringyes
namestring of length < NAMEDATALEN (often 64)no
moneyint64 scalar, which is 100 times the currency value to enable storing the ’small currency’ (e.g. Cent) fraction in the last two digitsno
pointgeometric point data for one point (see below)yes
lseggeometric point data for two points (see below)yes
line (not yet implemented by postgresql-9.2.4)as lsegno
boxas lsegno
circlereal vector (but the restrictions for type uint8 as in geometric element type apply, as explained below) with 3 elements, no. 1 and 2 centre coordinates, no. 3 radiusyes
polygongeometric point data (see below)no
pathstructure with fields closed (boolean, is path closed?) and path (geometric point data, see below).no
inetuint8 array of 4 or 5 elements for IPv4 or uint16 array of 8 or 9 elements for IPv6. 5th or 9th element, respectively, contain number of set bits in network mask, the default (if there are only 4 or 8 elements, respectively) is all bits set.no
cidras inetno
macaddruint8 array of 6 elementsno
uuiduint8 array of 16 elementsno
any enum typestringno

The 8-byte-time value (see time types in SQL data types) can be an int64 scalar, representing microseconds, if the Postgresql server is configured for integer date/time, or a double scalar, representing seconds, if the server is configured for float date/time (deprecated). One can use pq_conninfo to query the respective server configuration.

Geometric point data: if converting from Octave data, any real array (but if of type uint8, the geometric type name must always be specified, for otherwise uint8 would be considered as bytea) with even number of elements. Two adjacent elements (adjacent if indexed with a single index) define a pair of 2D point coordinates. In converting from Postgresql data, dimensions of Octave geometric point data will be chosen to be (2, n_points) and elements will be of format double.


Next: , Up: Postgresql   [Index]