All Products
Search
Document Center

PolarDB:ST_RasterDrivers

Last Updated:Mar 28, 2026

Returns all raster drivers supported by Ganos, along with their capabilities for reading, exporting, and file conversion. Use the can_read, can_export, and can_asfile output columns to determine which drivers are compatible with a specific function before calling it.

Syntax

setof record ST_RasterDrivers(out idx integer,
                     out short_name text,
                     out long_name text,
                     out can_read boolean,
                     out can_export boolean,
                     out can_asfile boolean,
                     out create_options text);

Parameters

ParameterTypeDescription
idxintegerThe driver ID.
short_nametextThe abbreviated driver name.
long_nametextThe full driver name.
can_readbooleantrue if the driver's file formats can be used with ST_CreateRast and ST_ImportFrom. Calling those functions with a false driver raises an error.
can_exportbooleantrue if the driver's file formats can be used with ST_ExportTo, which exports a raster object to Object Storage Service (OSS). Calling that function with a false driver raises an error.
can_asfilebooleantrue if the driver's file formats can be used with ST_AsDatasetFile, which converts a raster object to a BYTEA binary file. Calling that function with a false driver raises an error.
create_optionstextThe creation options for this driver, returned as XML. The XML structure is CreationOptionList/Option, where each Option element has a name, an optional type and description, and optional Value child elements. Pass individual option names and values in the create_option parameter of ST_ExportTo and ST_AsDatasetFile.

Examples

Query drivers compatible with specific functions

Filter by the boolean capability columns to find drivers supported by a given function.

-- Drivers that can be used with ST_ImportFrom and ST_CreateRast
SELECT short_name FROM st_rasterdrivers()
WHERE can_read = true;

-- Drivers that can be used with ST_ExportTo
SELECT short_name FROM st_rasterdrivers()
WHERE can_export = true;

-- Drivers that can be used with ST_AsDatasetFile
SELECT short_name FROM st_rasterdrivers()
WHERE can_asfile = true;

Inspect a specific driver

Retrieve the full record for the netCDF driver, including its creation options.

SELECT * FROM st_rasterdrivers()
WHERE short_name = 'netCDF';

Example output:

 idx | short_name |         long_name          | can_read | can_export | can_asfile | create_options
-----+------------+----------------------------+----------+------------+------------+----------------
  36 | netCDF     | Network Common Data Format | t        | t          | t          | <CreationOptionList>
                                                                                      <Option name='FORMAT' type='string-select' default='NC'>
                                                                                        <Value>NC</Value>
                                                                                        <Value>NC2</Value>
                                                                                        <Value>NC4</Value>
                                                                                        <Value>NC4C</Value>
                                                                                      </Option>
                                                                                      <Option name='COMPRESS' type='string-select' default='NONE'>
                                                                                        <Value>NONE</Value>
                                                                                        <Value>DEFLATE</Value>
                                                                                      </Option>
                                                                                      ...
                                                                                    </CreationOptionList>