From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Smith <smithpb2250(at)gmail(dot)com> |
Cc: | Amit Kapila <akapila(at)postgresql(dot)org>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: pgsql: Allow multiple xacts during table sync in logical replication. |
Date: | 2021-02-13 04:01:37 |
Message-ID: | CAA4eK1JxtQQosXyc0Os1SBUZU9BEECKsDmnXKEWbmMRL7OEwxw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
On Sat, Feb 13, 2021 at 6:47 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Sat, Feb 13, 2021 at 4:20 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > Don't do that. Quite aside from the inconsistency, this is pretty
> > darn unsafe coding technique, because there is exactly nothing
> > guaranteeing that the caller passes a buffer of the length the
> > function expects.
> >
> > I'm not real sure that you could expect a compiler warning for that
> > even if you'd put the length declaration where callers could see it.
> > So personally I'd avoid hard-wiring NAMEDATALEN into this API at all,
> > and have the caller pass sizeof(its buffer) instead.
> >
>
> Thanks for pointing it out. I'll look into this.
>
Attached should fix the reported warnings but as I am not getting
those warnings on my system so can't confirm but otherwise, the patch
works as expected. I am planning to push this unless you or Peter have
any comments.
--
With Regards,
Amit Kapila.
Attachment | Content-Type | Size |
---|---|---|
fix_warnings_tblsync_1.patch | application/octet-stream | 6.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2021-02-13 04:19:15 | Re: pgsql: Allow multiple xacts during table sync in logical replication. |
Previous Message | Tom Lane | 2021-02-13 02:27:07 | Re: pgsql: Allow multiple xacts during table sync in logical replication. |