On 1/16/06, Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> I have added the following documentation addition to suggest this usage
> for constraint names.
> ---------------------------------------------------------------------------
> --- 293,304 ----
>      <term><literal>CONSTRAINT <replaceable 
> class="PARAMETER">constraint_name</replaceable></literal></term>
>      <listitem>
>       <para>
> !       An optional name for a column or table constraint.  If the
> !       constraint is violated, the constraint name is present in error 
> messages,
> !       so constraint names like <literal>"col must be positive"</> can be 
> used
> !       to communicate helpful constraint information to client applications.
> !       (Double-quotes are required for constraint names that contain spaces.)
> !       If not specified, the system generates a name.
>       </para>
>      </listitem>
>     </varlistentry>

a lot better... thanx...

what about lower the context part of the messages for plpgsql
functions? that seems debug info for me... just an idea ;)

pruebas=# select prueba();
ERROR:  new row for relation "foo" violates check constraint "foo_fld_check"
CONTEXT:  SQL statement "insert into foo values (-1)"
PL/pgSQL function "prueba" line 2 at SQL statement

Jaime Casanova
(DBA: DataBase Aniquilator ;)

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not

Reply via email to