Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> I'm still not convinced what you think the problematic situation is. > > > I believe Alvaros point is that several different GetLastError codes map > > to the same errno code, making it impossible to see the difference > > between those errors. > > (1) If we need to know the difference, then we shouldn't be mapping them > to the same thing.
I totally agree with that, but the problem is the API is not very flexible in this regard. We can only use error codes that strerror() is going to recognize. A radical idea would be to store the Windows error code from GetLastError in a new field in ErrorData, and display it in the next ereport(). Perhaps use a special error callback to add an errcontext in the possibly problematic cases. > (2) Do we have any live cases where we must know this? Much less enough > cases to justify a global increase in the log chattiness? It's not like > we cannot get the information if we really need it. Yes. This thread shows the problem: http://archives.postgresql.org/pgsql-es-ayuda/2007-11/msg00354.php Basically he is getting this error: 2007-11-16 14:54:16 ERROR: could not open relation 1663/16403/16487: Invalid argument and no further indication of what's going on. I did some searching a couple of days ago and none of the cases I could find got a resolution. http://archives.free.net.ph/message/20060930.223306.6ac7d657.en.html http://www.mydatabasesupport.com/forums/postgresql/314656-general-postgre-crash-currval-problem-help.html -- Alvaro Herrera http://www.advogato.org/person/alvherre "Doing what he did amounts to sticking his fingers under the hood of the implementation; if he gets his fingers burnt, it's his problem." (Tom Lane) ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate