Re: Fwd: Proposal: variant of regclass - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Fwd: Proposal: variant of regclass
Date
Msg-id CAA4eK1KSppcveg2mY08vbtyT8Ws0de3BRffv2kwZJsAkxpZzHQ@mail.gmail.com
Whole thread Raw
In response to Re: Fwd: Proposal: variant of regclass  (Yugo Nagata <nagata@sraoss.co.jp>)
Responses Re: Fwd: Proposal: variant of regclass
List pgsql-hackers
On Mon, Mar 31, 2014 at 7:08 PM, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> Hi Amit Kapila,
>
> Thank you for your reviewing. I updated the patch to v5.

I have checked the latest version and found few minor improvements that
are required:

1.
! if (!missing_ok)
! ereport(ERROR,
! (errcode(ERRCODE_UNDEFINED_OBJECT),
! errmsg("type \"%s\" does not exist",
! TypeNameToString(typeName)),
! parser_errposition(NULL, typeName->location)));

pfree(buf.data); seems to be missing in error cases.
Do you see any problem if we call it before calling LookupTypeName()
instead of calling at multiple places?

2.
+    raising an error. In addition, neither <function>to_regproc</function> nor
+    <function>to_regoper</function> doesn't raise an error when more than one
+    object are found.

No need to use word *doesn't* in above sentence.


3.
+  * If the type name is not found, return InvalidOid if missing_ok
+  * = true, otherwise raise an error.

I can understand above comment, but I think it is better to improve it
by reffering other such instances. I like the explanation of missing_ok
in function header of relation_openrv_extended(). Could you please check
other places and improve this comment.

4. How is user going to distinguish between the cases when object-not-found  and more-than-one-object.  Do you think
sucha distinction is not required for user's of this API?
 

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: It seems no Windows buildfarm members are running find_typedefs
Next
From: Michael Meskes
Date:
Subject: Re: using arrays within structure in ECPG