Query languages

The CARS@AIP services run with PostgreSQL database which you can access through the Query interface. To retrieve data from the tables, the tables are queried. An SQL statement is used to do this. For each query you can choose which SQL language to use. The new Django Daiquiri framework supports ADQL and PostgreSQL.

The ADQL or Astronomical Data Query Language was designed specifically for astronomy and comes with statements that facilitate cone-search queries and other positional selections. It is developed by the Virtual Observatory (VO) to represent astronomical queries send to IVOA services.

All ADQL queries that are submitted for the execution are translated to PostgreSQL dialect before they are passed to the database server. Users can also choose to write their queries in the PostgreSQL directly. In some cases this is more desirable since the ADQL does not support all features that are available in PostgreSQL, namely working with array structures.

The SQL queries must be either in ADQL or PostgreSQL depending on the task. For example, ADQL will provide some specific geometry functions, which other SQL languages do not have. On the other hand, some common SQL syntax will not work with ADQL and you will have to switch to PostgreSQL.

Please take a look at the Query examples to find examples of queries for the CARS data set.

ADQL

Additional information on ADQL you can find here:

For the complete documentation and specification of ADQL please look up IVOA ADQL documentation.

PostgreSQL

PostgresQL uses SQL dialect to query the data in the database.