Re: dsm_unpin_segment - Mailing list pgsql-hackers

From Robert Haas
Subject Re: dsm_unpin_segment
Date
Msg-id CA+TgmoauY7CSXaNngQ22ZdsqaUkM1eWvqRu6KTmDStHKtQ7RZw@mail.gmail.com
Whole thread Raw
In response to Re: dsm_unpin_segment  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: dsm_unpin_segment  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Sat, Aug 20, 2016 at 7:37 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> 2.
> + if (dsm_control->item[seg->control_slot].pinned)
> + elog(ERROR, "cannot pin a segment that is already pinned");
>
> Shouldn't this be a user facing error (which means we should use ereport)?

Uh, certainly not.  This can't happen because of SQL the user enters;
it can only happen because of a C coding error.  elog() is the
appropriate tool for that case.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Improving planner's checks for parallel-unsafety
Next
From: Craig Ringer
Date:
Subject: Re: Logical decoding restart problems