Re: force_not_null option support for file_fdw - Mailing list pgsql-hackers

From Kohei Kaigai
Subject Re: force_not_null option support for file_fdw
Date
Msg-id D0C1A1F8BF513F469926E6C71461D9EC059195@EX10MBX02.EU.NEC.COM
Whole thread Raw
In response to Re: force_not_null option support for file_fdw  (Shigeru Hanada <shigeru.hanada@gmail.com>)
List pgsql-hackers
I marked this patch as "Ready for Committer", and hope this patch being committed.

Thanks,
--
NEC Europe Ltd, SAP Global Competence Center
KaiGai Kohei <kohei.kaigai@emea.nec.com>


> -----Original Message-----
> From: Shigeru Hanada [mailto:shigeru.hanada@gmail.com]
> Sent: 9. September 2011 06:03
> To: Kohei Kaigai
> Cc: Kohei KaiGai; PostgreSQL-development
> Subject: Re: [HACKERS] force_not_null option support for file_fdw
>
> Thanks for the review, Kaigai-san.
>
> (2011/09/09 0:47), Kohei Kaigai wrote:
> > I found one other point to be fixed:
> > On get_force_not_null(), it makes a list of attribute names with force_not_null option.
> >
> > +       foreach (cell, options)
> > +       {
> > +           DefElem    *def = (DefElem *) lfirst(cell);
> > +           const char *value = defGetString(def);
> > +
> > +           if (strcmp(def->defname, "force_not_null") == 0&&
> > +               strcmp(value, "true") == 0)
> > +           {
> > +               columns = lappend(columns, makeString(NameStr(attr->attname)));
> > +               elog(DEBUG1, "%s: force_not_null", NameStr(attr->attname));
> > +           }
> > +
> > +       }
> >
> > makeString() does not copy the supplied string itself, so it is not
> > preferable to reference
> > NameStr(attr->attname) across ReleaseSysCache().
> > I'd like to suggest to supply a copied attname using pstrdup for
> > makeString
>
> Oops, fixed.
> [ I should check some of my projects for this issue... ]
>
> Attached patch also includes some cosmetic changes such as removing useless blank lines.
>
> Regards,
> --
> Shigeru Hanada
>
>
>  Click
> https://www.mailcontrol.com/sr/GQT1p8GGIBPTndxI!oX7UiqFKmKbqX6Rgam71Xs0JKL1UdBaye8DbxIe1v95RjzltL
> 2w8BfevsSBchKRB0KEKw==  to report this email as spam.


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_last_xact_insert_timestamp
Next
From: Tom Lane
Date:
Subject: Re: Moving core timestamp typedefs/macros somewhere else