Database Reference
In-Depth Information
get_us_zip_validation_status
------------------------------
Non-US Zip Code
(1 row)
root=# SELECT
get_us_zip_validation_status('3467');
get_us_zip_validation_status
------------------------------
Not enough digits.
(1 row)
Logging to a file
The
RAISE
statement expression can be sent to a logfile using
log_min_messages
. This parameter is set in
postgresql.conf
. The valid val-
ues are:
debug5
,
debug4
,
debug3
,
debug2
,
debug1
,
info
,
notice
,
warning
,
error
,
log
,
fatal
, and
panic
.
The default logging level is packaging system dependent. On Ubuntu, the default
logging level is
info
. The logging levels correspond to the same expressions for the
RAISE
statement. As a developer, you can raise any of the messages that are avail-
able and have them recorded in the file log for later analysis.
The simplest way to post a message to the PostgreSQL daemon logfile is with
RAISE LOG
:
RAISE LOG 'Why am I doing this?';
This logfile is usually located with the rest of the system logfiles under
/var/log
.
On Ubuntu, this is
/var/log/postgresql/postgresql-9.1-main.log
.