Fix typmod interpretation for bit types. (It was erroneously assumed that
for bit(x), the typmod stores x+4, like for the character types.)
This commit is contained in:
parent
649c1a11e6
commit
d9d72bcb91
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2003, PostgreSQL Global Development Group
|
* Copyright 2003, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.17 2003/11/29 22:39:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.18 2003/12/07 10:21:58 petere Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -260,12 +260,16 @@ CREATE VIEW columns AS
|
|||||||
|
|
||||||
CAST(
|
CAST(
|
||||||
CASE WHEN t.typtype = 'd' THEN
|
CASE WHEN t.typtype = 'd' THEN
|
||||||
CASE WHEN t.typbasetype IN (25, 1042, 1043, 1560, 1562) AND t.typtypmod <> -1
|
CASE WHEN t.typbasetype IN (1042, 1043) AND t.typtypmod <> -1
|
||||||
THEN t.typtypmod - 4
|
THEN t.typtypmod - 4 /* char, varchar */
|
||||||
|
WHEN t.typbasetype IN (1560, 1562) AND t.typtypmod <> -1
|
||||||
|
THEN t.typtypmod /* bit, varbit */
|
||||||
ELSE null END
|
ELSE null END
|
||||||
ELSE
|
ELSE
|
||||||
CASE WHEN a.atttypid IN (25, 1042, 1043, 1560, 1562) AND a.atttypmod <> -1
|
CASE WHEN a.atttypid IN (1042, 1043) AND a.atttypmod <> -1
|
||||||
THEN a.atttypmod - 4
|
THEN a.atttypmod - 4
|
||||||
|
WHEN a.atttypid IN (1560, 1562) AND a.atttypmod <> -1
|
||||||
|
THEN a.atttypmod
|
||||||
ELSE null END
|
ELSE null END
|
||||||
END
|
END
|
||||||
AS cardinal_number)
|
AS cardinal_number)
|
||||||
@ -559,8 +563,10 @@ CREATE VIEW domains AS
|
|||||||
AS data_type,
|
AS data_type,
|
||||||
|
|
||||||
CAST(
|
CAST(
|
||||||
CASE WHEN t.typbasetype IN (25, 1042, 1043, 1560, 1562) AND t.typtypmod <> -1
|
CASE WHEN t.typbasetype IN (1042, 1043) AND t.typtypmod <> -1
|
||||||
THEN t.typtypmod - 4
|
THEN t.typtypmod - 4 /* char, varchar */
|
||||||
|
WHEN t.typbasetype IN (1560, 1562) AND t.typtypmod <> -1
|
||||||
|
THEN t.typtypmod /* bit, varbit */
|
||||||
ELSE null END
|
ELSE null END
|
||||||
AS cardinal_number)
|
AS cardinal_number)
|
||||||
AS character_maximum_length,
|
AS character_maximum_length,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user