File: sfuncs.rst

package info (click to toggle)
pglast 7.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,368 kB
  • sloc: python: 13,349; sql: 2,405; makefile: 159
file content (23 lines) | stat: -rw-r--r-- 997 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.. -*- coding: utf-8 -*-
.. :Project:   pglast — Special functions documentation
.. :Created:   mer 22 nov 2017 09:04:18 CET
.. :Author:    Lele Gaifax <lele@metapensiero.it>
.. :License:   GNU General Public License version 3 or later
.. :Copyright: © 2017, 2018, 2024 Lele Gaifax
..

===============================================================
 :mod:`pglast.printers.sfuncs` --- Special function printers
===============================================================

The PostgreSQL parser *translates* some ``SQL`` constructs into function calls, for example the
expression ``EXTRACT(YEAR FROM date_column)`` is represented the same as
``pg_catalog.date_part('year', date_column)``.

This module declares some of those equivalences, implementing alternative printers that will be
used when the option `special_functions` of the :class:`output stream <.printer.RawStream>` is
set to ``True``.

.. automodule:: pglast.printers.sfuncs
   :synopsis: Special function printers
   :members: