3.2.6 Environment Variables

The SQL engine comes with a limited set of environment variables to control its behavior. They come in two sets, one for the MonetDB kernel, they are readonly, and one for the SQL session. They can be obtained as follows:

     sql> select * from env();
     +-------------------+---------------------------------------------------------+
     | name              |value                                                    |
     +===================+=========================================================+
     | gdk_arch          |64bitx86_64-unknown-linux-gnu                            |
     | gdk_version       |1.25.0                                                   |
      ...
     | monet_version     |5.7.0                                                    |
     +-------------------+---------------------------------------------------------+
     sql> select * from var();
     +------------------+
     | name             |
     +==================+
     | debug            |
     | current_schema   |
     | current_user     |
     | current_role     |
     | optimizer        |
     | current_timezone |
     | cache            |
     +------------------+

The 'debug' variable takes an integer and sets the Mserver global debug flag. (See MonetDB kernel documentation.)

By default all remaining variables are stored as strings and any type analysis is up to the user. The can be freely used by the SQL programmer for inclusion in his queries.

The limited number of built-in variables defined above are strongly typed the hard way.