Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd9d72bc

Browse files
committed
Fix typmod interpretation for bit types. (It was erroneously assumed that
for bit(x), the typmod stores x+4, like for the character types.)
1 parent649c1a1 commitd9d72bc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

‎src/backend/catalog/information_schema.sql

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright 2003, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.17 2003/11/29 22:39:40 pgsql Exp $
7+
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.18 2003/12/07 10:21:58 petere Exp $
88
*/
99

1010
/*
@@ -260,12 +260,16 @@ CREATE VIEW columns AS
260260

261261
CAST(
262262
CASE WHENt.typtype='d' THEN
263-
CASE WHENt.typbasetypeIN (25,1042,1043,1560,1562)ANDt.typtypmod<>-1
264-
THENt.typtypmod-4
263+
CASE WHENt.typbasetypeIN (1042,1043)ANDt.typtypmod<>-1
264+
THENt.typtypmod-4/* char, varchar*/
265+
WHENt.typbasetypeIN (1560,1562)ANDt.typtypmod<>-1
266+
THENt.typtypmod/* bit, varbit*/
265267
ELSEnull END
266268
ELSE
267-
CASE WHENa.atttypidIN (25,1042,1043,1560,1562)ANDa.atttypmod<>-1
269+
CASE WHENa.atttypidIN (1042,1043)ANDa.atttypmod<>-1
268270
THENa.atttypmod-4
271+
WHENa.atttypidIN (1560,1562)ANDa.atttypmod<>-1
272+
THENa.atttypmod
269273
ELSEnull END
270274
END
271275
AS cardinal_number)
@@ -559,8 +563,10 @@ CREATE VIEW domains AS
559563
AS data_type,
560564

561565
CAST(
562-
CASE WHENt.typbasetypeIN (25,1042,1043,1560,1562)ANDt.typtypmod<>-1
563-
THENt.typtypmod-4
566+
CASE WHENt.typbasetypeIN (1042,1043)ANDt.typtypmod<>-1
567+
THENt.typtypmod-4/* char, varchar*/
568+
WHENt.typbasetypeIN (1560,1562)ANDt.typtypmod<>-1
569+
THENt.typtypmod/* bit, varbit*/
564570
ELSEnull END
565571
AS cardinal_number)
566572
AS character_maximum_length,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp