ADQL and PostgreSQL

The LIneA services utilize a PostgreSQL database, accessible via a Query interface. Data retrieval from the tables is accomplished using SQL statements. Users can select between different SQL languages for their queries. The Django Daiquiri framework supports both ADQL and PostgreSQL.

ADQL, or Astronomical Data Query Language, is specifically tailored for astronomy, featuring statements for cone-search queries and other positional selections. Developed by the Virtual Observatory (VO), it enables astronomical queries to be sent to IVOA services.

All ADQL queries are translated into the PostgreSQL dialect before execution on the database server. Alternatively, users can write queries directly in PostgreSQL, which can offer more functionality, such as working with array structures.

Example Queries

A wealth of query examples is at your disposal. To peruse a selection, click the "Examples" button located at the upper right corner of the page https://userquery.linea.org.br/cms/services/adql-postgresql/, as depicted in the illustration below:

example 1


By double-clicking or hovering the mouse over an example, you can unveil the details of the query, which you may then customize to suit your specific needs.

example 2


SQL Query Selection

Choose SQL dialect based on your task: ADQL offers specific geometry functions not found in other SQL languages, while PostgreSQL supports more common SQL syntax.

Resources

ADQL:

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

PostgreSQL:

Interoperability and Performance

ADQL is a common language across IVOA services, ideal for interoperability and reproducibility. Publishing SQL queries in ADQL is recommended.

LIneA Services use PgSphere columns for efficient coordinate searches, combining ra and dec into a single indexed column. While PostgreSQL constructs are recommended for execution, use ADQL for scientific publication.