RE: [PATCH] Tiny optmization. - Mailing list pgsql-hackers

From Ranier Vilela
Subject RE: [PATCH] Tiny optmization.
Date
Msg-id MN2PR18MB29270332A69B521B28243C94E3490@MN2PR18MB2927.namprd18.prod.outlook.com
Whole thread Raw
In response to Re: [PATCH] Tiny optmization.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Tiny optmization.  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
Hi,
pstate is touched here:
a) BeginCopy line 1489:
    ProcessCopyOptions(pstate, cstate, is_from, options);
b) ProcessCopyOptions line 1137:

            if (format_specified)
                ereport(ERROR,
                        (errcode(ERRCODE_SYNTAX_ERROR),
                         errmsg("conflicting or redundant options"),
                         parser_errposition(pstate, defel->location)));

best regards.
Ranier Vilela

________________________________________
De: Tom Lane <tgl@sss.pgh.pa.us>
Enviado: sexta-feira, 22 de novembro de 2019 22:17
Para: Ranier Vilela
Cc: pgsql-hackers@postgresql.org
Assunto: Re: [PATCH] Tiny optmization.

Ranier Vilela <ranier_gyn@hotmail.com> writes:
> Redudant because he it's been dereferenced here:
> line 3410:
>         cstate = BeginCopy(pstate, true, rel, NULL, InvalidOid, attnamelist, options);

Not necessarily ... the rel!=NULL code path there doesn't touch pstate,
and that seems to be what contrib/file_fdw is relying on.

Arguably, the rel==NULL code path in BeginCopy should be prepared to
support pstate being null, too.  But what you proposed here is certainly
not OK.

                        regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [PATCH] Tiny optmization.
Next
From: Tomas Vondra
Date:
Subject: Re: [PATCH] Tiny optmization.