BUG #3771: function pg_catalog.btrim(numeric, unknown) does not exist

Поиск
Список
Период
Сортировка
От Oliver Artelt
Тема BUG #3771: function pg_catalog.btrim(numeric, unknown) does not exist
Дата
Msg-id 200711211321.lALDLdFS085326@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #3771: function pg_catalog.btrim(numeric, unknown) does not exist  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      3771
Logged by:          Oliver Artelt
Email address:      oli@cubeoffice.de
PostgreSQL version: 8.3-beta2
Operating system:   Win XP, SP 2, 32b
Description:        function pg_catalog.btrim(numeric, unknown) does not
exist
Details:

definition:

CREATE OR REPLACE FUNCTION saufschlagreihe(integer, smallint)
  RETURNS text AS
$BODY$
DECLARE

    LEID    ALIAS FOR $1;
    iFormat ALIAS FOR $2;

    sResult text;
    s       text;
    r       record;
    d       numeric;

BEGIN

    s := 'SELECT AufschlagNameKurz,AufschlagProz,AufschlagZeit FROM
tblAufschlag INNER JOIN tblAufschlagTyp ON Key_AufschlagTyp =
ID_AufschlagTyp WHERE Key_LE = ' || LEID;
    sResult = '';

    FOR r IN EXECUTE s LOOP


        ---------
        --Kurzbez
        ---------
        if iFormat = 0 then

            sResult := sResult || ', ' || r.AufschlagNameKurz;

        ------------------
        --Kurzbez, Prozent
        ------------------
        elsif iFormat = 1 then

            sResult := sResult || ', ' || r.AufschlagNameKurz || ' (' ||
r.AufschlagProz || '%)';

        -----------------------------
        --Kurzbez, Zeitdauer, Prozent
        -----------------------------
        else

            d := r.AufschlagZeit;
            If d > 0 Then

                sResult := sResult || ', ' || r.AufschlagNameKurz || ' (';
                if d / 60 = (d / 60)::int4 then
                    sResult := sResult || trim(to_char(d / 60, '990'));
                else
                    sResult := sResult || trim(to_char(d / 60, '990.00'));
                end if;
                sResult := sResult || 'h * ' || trim(both '0' from
r.AufschlagProz) || '%)';

            End If;
        end If;

    end Loop;


    return trim(overlay(sResult placing '  ' from 1));

END;
$BODY$
  LANGUAGE 'plpgsql' STABLE
  COST 100;


call:


select saufschlagreihe(69128, 2::smallint);


msg:



ERROR:  function pg_catalog.btrim(numeric, unknown) does not exist
LINE 1: SELECT   $1  || 'h * ' || trim(both '0' from  $2 ) || '%)'
                                  ^
HINT:  No function matches the given name and argument types. You might need
to add explicit type casts.
QUERY:  SELECT   $1  || 'h * ' || trim(both '0' from  $2 ) || '%)'
CONTEXT:  PL/pgSQL function "saufschlagreihe" line 47 at assignment

********** Fehler **********

ERROR: function pg_catalog.btrim(numeric, unknown) does not exist
SQL Status:42883
Hinweis:No function matches the given name and argument types. You might
need to add explicit type casts.
Kontext:PL/pgSQL function "saufschlagreihe" line 47 at assignment



works on 8.2.4 and older



regards, oli

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

Предыдущее
От: "CN"
Дата:
Сообщение: BUG #3769: Fail to make bcc32.mak for libpq
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #3771: function pg_catalog.btrim(numeric, unknown) does not exist