Re: information_schema.columns changes needed for OLEDB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Konstantin Izmailov <kizmailov(at)gmail(dot)com>
Subject: Re: information_schema.columns changes needed for OLEDB
Date: 2009-06-09 18:20:08
Message-ID: 24827.1244571608@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql
> index 9c5672f..cb0296a 100644
> --- a/src/backend/catalog/information_schema.sql
> +++ b/src/backend/catalog/information_schema.sql
> @@ -160,12 +160,12 @@ CREATE FUNCTION _pg_datetime_precision(typid oid, typmod int4) RETURNS integer
> RETURNS NULL ON NULL INPUT
> AS
> $$SELECT
> - CASE WHEN $2 = -1 /* default typmod */
> - THEN null
> + CASE WHEN $1 IN (1082) /* date */
> + THEN 0
> WHEN $1 IN (1083, 1114, 1184, 1266) /* time, timestamp, same + tz */
> - THEN $2
> + THEN CASE WHEN $2 = -1 THEN 6 ELSE $2 END
> WHEN $1 IN (1186) /* interval */
> - THEN $2 & 65535
> + THEN CASE WHEN $2 = -1 THEN 6 ELSE $2 & 65535 END
> ELSE null
> END$$;

Just for the record, this is a perfect example of why -u format sucks.
How many people think they can look at this and know exactly what the
change does?

I'll be back to weigh in on the merits of the patch after I've converted
it to -c format so I can understand it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-06-09 18:22:02 Re: page is uninitialized --- fixing
Previous Message Jaime Casanova 2009-06-09 18:15:56 Re: [HACKERS] Cursor with hold emits the same row more than once across commits in 8.3.7