Re: Why does this not work?

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: Why does this not work?
Дата
Msg-id 200204111853.g3BIr1P05854@saturn.janwieck.net
обсуждение исходный текст
Ответ на Re: Why does this not work?  ("Johann Zuschlag" <zuschlag@online.de>)
Список pgsql-general
Johann Zuschlag wrote:
> On Thu, 11 Apr 2002 10:54:42 -0700 (PDT), Stephan Szabo wrote:
>
> >> -- Trigger: laenge_trig ON test
> >> CREATE TRIGGER "laenge_trig" BEFORE INSERT OR UPDATE ON "test" FOR
> >> EACH ROW EXECUTE PROCEDURE laenge();
> >>
> >> insert into test (test1) values  ('0123456789012');
> >>
> >> value too long for type character varying(10)
> >
> >The value is being coerced into the type before your trigger
> >runs to be put into the values you're testing and it fails
> >at that point.
>
> Is there a solution for such a problem?
> Let's assume you can't be sure whether you get
> the appropriate length in an insert.

    Create the table field as VARCHAR without a maximum size.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



В списке pgsql-general по дате отправления:

Предыдущее
От: Fran Fabrizio
Дата:
Сообщение: Re: where to find info about data types?
Следующее
От: "Johann Zuschlag"
Дата:
Сообщение: Re: Why does this not work? (finally)