Re: Why does this not work? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Why does this not work?
Date
Msg-id 200204111859.06242.richardh@archonet.com
Whole thread Raw
In response to Why does this not work?  ("Johann Zuschlag" <zuschlag@online.de>)
List pgsql-general
On Thursday 11 April 2002 17:38, Johann Zuschlag wrote:

>   "test1" varchar(10)

> CREATE FUNCTION "laenge"() RETURNS "opaque" AS '
> begin
> if length(new.test1) > 10 then
...
> insert into test (test1) values  ('0123456789012');
>
> value too long for type character varying(10)

I believe it's the parser being helpful and checking data-types as early as
possible. You can see why - if "new.test1" is a varchar(10) how _can_ it hold
any more.

You might want to look in the mail archives. Someone mentioned this very
problem not long ago.

- Richard Huxton

pgsql-general by date:

Previous
From: "Mr. Wobbet"
Date:
Subject: help me please...
Next
From: Oliver Elphick
Date:
Subject: Re: How do I list all users and all databases.