Re: [HACKERS] update_pg_pwd - Mailing list pgsql-hackers

From wieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] update_pg_pwd
Date
Msg-id m11xTo1-0003kGC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: [HACKERS] update_pg_pwd  (Peter Eisentraut <e99re41@DoCS.UU.SE>)
Responses Re: [HACKERS] update_pg_pwd
Re: [HACKERS] update_pg_pwd
List pgsql-hackers
Peter Eisentraut wrote:

> On Mon, 13 Dec 1999, Jan Wieck wrote:
>
> I'm not sure I'm following you, but why would a function that doesn't have
> a useful return value return one?

    AFTER  ROW  triggers  indeed  have  no  useful  return value,
    because it is ignored for now. But  IMHO  they  still  should
    follow the trigger programming guidelines.

    That means, the declaration should read

        HeapTuple funcname(void);

    Then they should contain

        TriggerData *trigdata;
        ...
        trigdata = CurrentTriggerData;
        CurrentTriggerData = NULL;

    and if they do not want to manipulate the actual action, just
    to get informed that it happened, return

        trigdata->tg_trigtuple;

    I'll make these changes to update_pg_pwd(), now that  I  know
    for sure what it is.

    One last point though. The comment says it's using lower case
    name now to be callable from SQL, what it  isn't  because  of
    it's Opaque return type in pg_proc.

        pgsql=> select update_pg_pwd();
        ERROR:  typeidTypeRelid: Invalid type - oid = 0

    Is  that  a  wanted  (needed)  capability  or should I better
    change the comment to reflect it's real nature?


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Datatype MONEY
Next
From: Karel Zak - Zakkr
Date:
Subject: Re: [HACKERS] Datatype MONEY