Re: refactor CreateTupleDescCopy()
От | Neil Conway |
---|---|
Тема | Re: refactor CreateTupleDescCopy() |
Дата | |
Msg-id | 87r802aire.fsf@mailbox.samurai.com обсуждение исходный текст |
Ответ на | Re: refactor CreateTupleDescCopy() (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: refactor CreateTupleDescCopy()
|
Список | pgsql-patches |
Tom Lane <tgl@sss.pgh.pa.us> writes: > I think this is taking the "avoid duplicated code" mantra a little > far. You've defined a subroutine that returns a TupleDesc that is > internally inconsistent and cannot usefully be used for anything > until it's fixed by the parent routines. Fair enough. Another way to refactor this would be to implement both CreateTupleDescCopy() and CreateTupleDescCopyConstr() in terms of an internal function that takes a bool indicating whether or not to include constraints in the returned TupleDesc. Now that I think about it, we could also just change the API to remove CreateTupleDescCopyConstr(), and replace it with an additional bool parameter to CreateTupleDescCopy(). I'm leaning toward doing the latter, and updating the 30 odd call sites this would affect. Does that sound good? -Neil
В списке pgsql-patches по дате отправления: