1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

Update FAQ_DEV: elog => ereport.

This commit is contained in:
Bruce Momjian
2003-10-30 02:40:29 +00:00
parent d46f9cd3bd
commit 60b198a768
2 changed files with 21 additions and 20 deletions

View File

@ -1,7 +1,7 @@
Developer's Frequently Asked Questions (FAQ) for PostgreSQL Developer's Frequently Asked Questions (FAQ) for PostgreSQL
Last updated: Mon Jun 2 00:34:39 EDT 2003 Last updated: Wed Oct 29 21:40:18 EST 2003
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us) Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
@ -34,7 +34,7 @@
2.3) Why do we use Node and List to make data structures? 2.3) Why do we use Node and List to make data structures?
2.4) I just added a field to a structure. What else should I do? 2.4) I just added a field to a structure. What else should I do?
2.5) Why do we use palloc() and pfree() to allocate memory? 2.5) Why do we use palloc() and pfree() to allocate memory?
2.6) What is elog()? 2.6) What is ereport()?
2.7) What is CommandCounterIncrement()? 2.7) What is CommandCounterIncrement()?
_________________________________________________________________ _________________________________________________________________
@ -687,20 +687,21 @@ List *i, *list;
are special non-query contexts that memory can be allocated in. These are special non-query contexts that memory can be allocated in. These
affect when the allocated memory is freed by the backend. affect when the allocated memory is freed by the backend.
2.6) What is elog()? 2.6) What is ereport()?
elog() is used to send messages to the front-end, and optionally ereport() is used to send messages to the front-end, and optionally
terminate the current query being processed. The first parameter is an terminate the current query being processed. The first parameter is an
elog level of DEBUG (levels 1-5), LOG, INFO, NOTICE, ERROR, FATAL, or ereport level of DEBUG (levels 1-5), LOG, INFO, NOTICE, ERROR, FATAL,
PANIC. NOTICE prints on the user's terminal and the postmaster logs. or PANIC. NOTICE prints on the user's terminal and the postmaster
INFO prints only to the user's terminal and LOG prints only to the logs. INFO prints only to the user's terminal and LOG prints only to
server logs. (These can be changed from postgresql.conf.) ERROR prints the server logs. (These can be changed from postgresql.conf.) ERROR
in both places, and terminates the current query, never returning from prints in both places, and terminates the current query, never
the call. FATAL terminates the backend process. The remaining returning from the call. FATAL terminates the backend process. The
parameters of elog are a printf-style set of parameters to print. remaining parameters of ereport are a printf-style set of parameters
to print.
elog(ERROR) frees most memory and open file descriptors so you don't ereport(ERROR) frees most memory and open file descriptors so you
need to clean these up before the call. don't need to clean these up before the call.
2.7) What is CommandCounterIncrement()? 2.7) What is CommandCounterIncrement()?

View File

@ -12,7 +12,7 @@
<H1>Developer's Frequently Asked Questions (FAQ) for <H1>Developer's Frequently Asked Questions (FAQ) for
PostgreSQL</H1> PostgreSQL</H1>
<P>Last updated: Mon Jun 2 00:34:39 EDT 2003</P> <P>Last updated: Wed Oct 29 21:40:18 EST 2003</P>
<P>Current maintainer: Bruce Momjian (<A href= <P>Current maintainer: Bruce Momjian (<A href=
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR> "mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR>
@ -61,7 +61,7 @@
should I do?<BR> should I do?<BR>
<A href="#2.5">2.5</A>) Why do we use <I>palloc</I>() and <A href="#2.5">2.5</A>) Why do we use <I>palloc</I>() and
<I>pfree</I>() to allocate memory?<BR> <I>pfree</I>() to allocate memory?<BR>
<A href="#2.6">2.6</A>) What is elog()?<BR> <A href="#2.6">2.6</A>) What is ereport()?<BR>
<A href="#2.7">2.7</A>) What is CommandCounterIncrement()?<BR> <A href="#2.7">2.7</A>) What is CommandCounterIncrement()?<BR>
<BR> <BR>
@ -833,11 +833,11 @@
memory can be allocated in. These affect when the allocated memory memory can be allocated in. These affect when the allocated memory
is freed by the backend.</P> is freed by the backend.</P>
<H3><A name="2.6">2.6</A>) What is elog()?</H3> <H3><A name="2.6">2.6</A>) What is ereport()?</H3>
<P><I>elog()</I> is used to send messages to the front-end, and <P><I>ereport()</I> is used to send messages to the front-end, and
optionally terminate the current query being processed. The first optionally terminate the current query being processed. The first
parameter is an elog level of <I>DEBUG</I> (levels 1-5), <I>LOG,</I> parameter is an ereport level of <I>DEBUG</I> (levels 1-5), <I>LOG,</I>
<I>INFO,</I> <I>NOTICE,</I> <I>ERROR,</I> <I>FATAL,</I> or <I>INFO,</I> <I>NOTICE,</I> <I>ERROR,</I> <I>FATAL,</I> or
<I>PANIC.</I> <I>NOTICE</I> prints on the user's terminal and the <I>PANIC.</I> <I>NOTICE</I> prints on the user's terminal and the
postmaster logs. <I>INFO</I> prints only to the user's terminal and postmaster logs. <I>INFO</I> prints only to the user's terminal and
@ -845,10 +845,10 @@
from <I>postgresql.conf.</I>) <I>ERROR</I> prints in both places, from <I>postgresql.conf.</I>) <I>ERROR</I> prints in both places,
and terminates the current query, never returning from the call. and terminates the current query, never returning from the call.
<I>FATAL</I> terminates the backend process. The remaining <I>FATAL</I> terminates the backend process. The remaining
parameters of <I>elog</I> are a <I>printf</I>-style set of parameters of <I>ereport</I> are a <I>printf</I>-style set of
parameters to print.</P> parameters to print.</P>
<P><I>elog(ERROR)</I> frees most memory and open file descriptors so <P><I>ereport(ERROR)</I> frees most memory and open file descriptors so
you don't need to clean these up before the call.</P> you don't need to clean these up before the call.</P>
<H3><A name="2.7">2.7</A>) What is CommandCounterIncrement()?</H3> <H3><A name="2.7">2.7</A>) What is CommandCounterIncrement()?</H3>