Re: [HACKERS] update_pg_pwd

From: wieck(at)debis(dot)com (Jan Wieck)
To: peter_e(at)gmx(dot)net
Cc: wieck(at)debis(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] update_pg_pwd
Date: 1999-12-13 11:38:17
Message-ID: m11xTo1-0003kGC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak - Zakkr 1999-12-13 12:13:55 Re: [HACKERS] Datatype MONEY
Previous Message Peter Eisentraut 1999-12-13 11:25:28 Re: [HACKERS] Datatype MONEY