gavo.adql.morphpg module

Morphing ADQL into queries that postgres/pgSphere can understand.

For most of ADQL, Postgres supports most of the stuff out of the box, with perhaps a few syntactic differences.

Spherical geometry is morphed rather extensively, mainly to pgsphere. There is support for legacy q3c, but since q3c will always be inadequate for full ADQL geometry support, we’ll phase this out (although it’s a good deal faster when it works).

class gavo.adql.morphpg.PgSphereCode(cooSys, content, original=None)[source]

Bases: object

A node that contains serialized pgsphere expressions plus a coordinate system id for cases in which we must conform.

Pass the optional original (the node that generates the stuff) to allow code like the q3c booleanizer above to still work on things if necessary.

flatten()[source]
iterAttributes()[source]
iterTree()[source]
type = 'pgsphere literal'
exception gavo.adql.morphpg.PostgresMorphError(msg: str = '', hint: Optional[str] = None)[source]

Bases: MorphError

gavo.adql.morphpg.getOriginal(node)[source]

returns the node.original if it exists, node itself otherwise.

This is to undo pgsphere morphing when pgsphereCode has been inserted.