pgsql/src/backend/optimizer/prep prepunion.c

Started by Tom Laneover 24 years ago3 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

CVSROOT: /cvsroot
Module name: pgsql
Changes by: tgl@postgresql.org 01/11/12 15:04:20

Modified files:
src/backend/optimizer/prep: prepunion.c

Log message:
If the inputs of a UNION/INTERSECT/EXCEPT construct all agree on the
typmod of a particular column, mark the output with that same typmod,
not -1 as formerly. -1 is still used if there is any disagreement.
Part of response to bug#513.

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: pgsql/src/backend/optimizer/prep prepunion.c

CVSROOT: /cvsroot
Module name: pgsql
Changes by: tgl@postgresql.org 01/11/12 15:04:20

Modified files:
src/backend/optimizer/prep: prepunion.c

Log message:
If the inputs of a UNION/INTERSECT/EXCEPT construct all agree on the
typmod of a particular column, mark the output with that same typmod,
not -1 as formerly. -1 is still used if there is any disagreement.
Part of response to bug#513.

Very nice. I know we punted typmod on several places because where
we had conflicting typmod cases in expressions. This seems like a nice
idea, keep the typmods if they are all the same. Any more places I can
add to TODO?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: pgsql/src/backend/optimizer/prep prepunion.c

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Very nice. I know we punted typmod on several places because where
we had conflicting typmod cases in expressions. This seems like a nice
idea, keep the typmods if they are all the same. Any more places I can
add to TODO?

UNION and CASE are the only examples where we do type resolution that
way, so they are probably the only ones that have any reason to do
typmod resolution this way ...

regards, tom lane