Re: [HACKERS] oid8types() borken? - Mailing list pgsql-hackers

From t-ishii@sra.co.jp (Tatsuo Ishii)
Subject Re: [HACKERS] oid8types() borken?
Date
Msg-id 199809221559.AAA13672@meshsv26.tk.mesh.ad.jp
Whole thread Raw
In response to Re: [HACKERS] oid8types() borken?  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] oid8types() borken?  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
At 0:47 AM 98.9.18 -0400, Bruce Momjian wrote:
>Fixed.  The actual fix is to change:
>
>    oid8types(Oid **oidArray)
>
>to:
>
>    oid8types(Oid (*oidArray)[])
>
>Can someone explain what this is?  This is the old 6.3 code, and forgot
>to reverse back this part when I realized my change to **oidArray did
>not work.

Oid **oidArray and (Oid (*oidArray)[] are quite different.
The latter is a pointer to Oid array. Sample code for a caller might
be:

Oid oids[8];
    :
    :
oid8types(&oids);

&oids is actually same as oids or &oids[0]. Interesting but just
waste of time IMHO.
You will see oidArray and *oidArray shows same value in oid8types().

Seems just

     oid8types(Oid *oidArray)
or
     oid8types(Oid oidArray[])

are simpler and more effective.

--
Tatsuo Ishii
t-ishii@sra.co.jp


pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Problem dropping databases
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] Problem dropping databases