Re: insert aborted commands ignored

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Pepe TD Vo <pepevo(at)yahoo(dot)com>
Cc: Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Scott Ribe <scott_ribe(at)elevated-dev(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: insert aborted commands ignored
Date: 2019-02-06 15:18:30
Message-ID: CAKFQuwbF8bkHb7F_F2NEC6mzFb4fopTd+rNWvrBB8OV-tH1YCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Feb 6, 2019 at 8:05 AM Pepe TD Vo <pepevo(at)yahoo(dot)com> wrote:
> get another error, "value too long for type character varying(34). How do I know which table

How many tables in your schema are defined with a column having a type
of "character varying(34)"?

To narrow down if >1 you'd need to trace the load script and see at
what point it is failing; or change half of them to "text", try again,
change some back to varchar(34), try again repeat until only one of
them is "text" and that is your culprit.

Or just get rid of "varchar(n)" columns, make them all text and, for
those were you really want to keep length limits, add explicit
constraints.

There have been discussions somewhat recently to make the error
message itself more helpful but I don't believe anyone is actively
working on it. Its better, IMO, to avoid using "varchar(n)" in your
schema anyway. More precise check constraints are a better option not
the least of which is because they can be named and self-identify with
the table to which they are attached.

David J.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Pepe TD Vo 2019-02-06 19:59:07 Re: insert aborted commands ignored
Previous Message frederic Etter 2019-02-06 15:09:35 Quit Channel