Re: Question on ThrowErrorData
| От | Tom Lane | 
|---|---|
| Тема | Re: Question on ThrowErrorData | 
| Дата | |
| Msg-id | 200981.1760961928@sss.pgh.pa.us обсуждение исходный текст  | 
		
| Ответ на | Question on ThrowErrorData (正华吕 <kainwen@gmail.com>) | 
| Ответы | 
                	
            		Re: Question on ThrowErrorData
            		
            		 | 
		
| Список | pgsql-hackers | 
=?UTF-8?B?5q2j5Y2O5ZCV?= <kainwen@gmail.com> writes:
>      Inside errfinish, it just does a simple pointer assignment to set
>      filename and funcname field (via function set_stack_entry_location()).
Please note the comment on struct ErrorData:
 * ErrorData holds the data accumulated during any one ereport() cycle.
 * Any non-NULL pointers must point to palloc'd data.
 * (The const pointers are an exception; we assume they point at non-freeable
 * constant strings.)
...
    const char *filename;       /* __FILE__ of ereport() call */
...
    const char *funcname;       /* __func__ of ereport() call */
In practice these are always pointing at compiler-generated
constant strings.
            regards, tom lane
		
	В списке pgsql-hackers по дате отправления: