Skip to content

Commit 828822b

Browse files
committed
Add remaining documentation tables to information schema.
1 parent cde9f85 commit 828822b

File tree

3 files changed

+114
-7
lines changed

3 files changed

+114
-7
lines changed

src/backend/catalog/information_schema.sql

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright 2002, PostgreSQL Global Development Group
66
*
7-
* $Id: information_schema.sql,v 1.2 2003/01/14 23:19:34 petere Exp $
7+
* $Id: information_schema.sql,v 1.3 2003/01/15 23:37:27 petere Exp $
88
*/
99

1010

@@ -322,6 +322,38 @@ CREATE TABLE sql_features (
322322
GRANT SELECT ON sql_features TO PUBLIC;
323323

324324

325+
/*
326+
* 20.48
327+
* SQL_IMPLEMENTATION_INFO table
328+
*/
329+
330+
-- Note: Implementation information items are defined in ISO 9075-3:1999,
331+
-- clause 7.1.
332+
333+
CREATE TABLE sql_implementation_info (
334+
implementation_info_id character_data,
335+
implementation_info_name character_data,
336+
integer_value cardinal_number,
337+
character_value character_data,
338+
comments character_data
339+
) WITHOUT OIDS;
340+
341+
INSERT INTO sql_implementation_info VALUES ('10003', 'CATALOG NAME', NULL, 'Y', NULL);
342+
INSERT INTO sql_implementation_info VALUES ('10004', 'COLLATING SEQUENCE', NULL, '', 'not supported');
343+
INSERT INTO sql_implementation_info VALUES ('23', 'CURSOR COMMIT BEHAVIOR', 1, NULL, 'close cursors and retain prepared statements');
344+
INSERT INTO sql_implementation_info VALUES ('2', 'DATA SOURCE NAME', NULL, '', NULL);
345+
INSERT INTO sql_implementation_info VALUES ('17', 'DBMS NAME', NULL, (select trim(trailing ' ' from substring(version() from '^[^0-9]*'))), NULL);
346+
INSERT INTO sql_implementation_info VALUES ('18', 'DBMS VERSION', NULL, '???', NULL); -- filled by initdb
347+
INSERT INTO sql_implementation_info VALUES ('26', 'DEFAULT TRANSACTION ISOLATION', 2, NULL, 'READ COMMITED; user-settable');
348+
INSERT INTO sql_implementation_info VALUES ('28', 'IDENTIFIER CASE', 3, NULL, 'stored in mixed case - case sensitive');
349+
INSERT INTO sql_implementation_info VALUES ('85', 'NULL COLLATION', 0, NULL, 'nulls higher than non-nulls');
350+
INSERT INTO sql_implementation_info VALUES ('13', 'SERVER NAME', NULL, '', NULL);
351+
INSERT INTO sql_implementation_info VALUES ('94', 'SPECIAL CHARACTERS', NULL, '', 'all non-ASCII characters allowed');
352+
INSERT INTO sql_implementation_info VALUES ('46', 'TRANSACTION CAPABLE', 2, NULL, 'both DML and DDL');
353+
354+
GRANT SELECT ON sql_implementation_info TO PUBLIC;
355+
356+
325357
/*
326358
* 20.49
327359
* SQL_LANGUAGES table
@@ -370,6 +402,72 @@ INSERT INTO sql_packages VALUES ('PKG009', 'SQL/MM support', 'NO', NULL, '');
370402
GRANT SELECT ON sql_packages TO PUBLIC;
371403

372404

405+
/*
406+
* 20.51
407+
* SQL_SIZING table
408+
*/
409+
410+
-- Note: Sizing items are defined in ISO 9075-3:1999, clause 7.2.
411+
412+
CREATE TABLE sql_sizing (
413+
sizing_id cardinal_number,
414+
sizing_name character_data,
415+
supported_value cardinal_number,
416+
comments character_data
417+
) WITHOUT OIDS;
418+
419+
INSERT INTO sql_sizing VALUES (34, 'MAXIMUM CATALOG NAME LENGTH', 63, NULL);
420+
INSERT INTO sql_sizing VALUES (30, 'MAXIMUM COLUMN NAME LENGTH', 63, NULL);
421+
INSERT INTO sql_sizing VALUES (97, 'MAXIMUM COLUMNS IN GROUP BY', 0, NULL);
422+
INSERT INTO sql_sizing VALUES (99, 'MAXIMUM COLUMNS IN ORDER BY', 0, NULL);
423+
INSERT INTO sql_sizing VALUES (100, 'MAXIMUM COLUMNS IN SELECT', 0, NULL);
424+
INSERT INTO sql_sizing VALUES (101, 'MAXIMUM COLUMNS IN TABLE', 1600, NULL); -- match MaxHeapAttributeNumber
425+
INSERT INTO sql_sizing VALUES (1, 'MAXIMUM CONCURRENT ACTIVITIES', 0, NULL);
426+
INSERT INTO sql_sizing VALUES (31, 'MAXIMUM CURSOR NAME LENGTH', 63, NULL);
427+
INSERT INTO sql_sizing VALUES (0, 'MAXIMUM DRIVER CONNECTIONS', NULL, NULL);
428+
INSERT INTO sql_sizing VALUES (10005, 'MAXIMUM IDENTIFIER LENGTH', 63, NULL);
429+
INSERT INTO sql_sizing VALUES (32, 'MAXIMUM SCHEMA NAME LENGTH', 63, NULL);
430+
INSERT INTO sql_sizing VALUES (20000, 'MAXIMUM STATEMENT OCTETS', 0, NULL);
431+
INSERT INTO sql_sizing VALUES (20001, 'MAXIMUM STATEMENT OCTETS DATA', 0, NULL);
432+
INSERT INTO sql_sizing VALUES (20002, 'MAXIMUM STATEMENT OCTETS SCHEMA', 0, NULL);
433+
INSERT INTO sql_sizing VALUES (35, 'MAXIMUM TABLE NAME LENGTH', 63, NULL);
434+
INSERT INTO sql_sizing VALUES (106, 'MAXIMUM TABLES IN SELECT', 0, NULL);
435+
INSERT INTO sql_sizing VALUES (107, 'MAXIMUM USER NAME LENGTH', 63, NULL);
436+
INSERT INTO sql_sizing VALUES (25000, 'MAXIMUM CURRENT DEFAULT TRANSFORM GROUP LENGTH', NULL, NULL);
437+
INSERT INTO sql_sizing VALUES (25001, 'MAXIMUM CURRENT TRANSFORM GROUP LENGTH', NULL, NULL);
438+
INSERT INTO sql_sizing VALUES (25002, 'MAXIMUM CURRENT PATH LENGTH', 0, NULL);
439+
INSERT INTO sql_sizing VALUES (25003, 'MAXIMUM CURRENT ROLE LENGTH', NULL, NULL);
440+
INSERT INTO sql_sizing VALUES (25004, 'MAXIMUM SESSION USER LENGTH', 63, NULL);
441+
INSERT INTO sql_sizing VALUES (25005, 'MAXIMUM SYSTEM USER LENGTH', 63, NULL);
442+
443+
UPDATE sql_sizing
444+
SET supported_value = (SELECT typlen-1 FROM pg_catalog.pg_type WHERE typname = 'name'),
445+
comments = 'Might be less, depending on character set.'
446+
WHERE supported_value = 63;
447+
448+
GRANT SELECT ON sql_sizing TO PUBLIC;
449+
450+
451+
/*
452+
* 20.52
453+
* SQL_SIZING_PROFILES table
454+
*/
455+
456+
-- The data in this table are defined by various profiles of SQL.
457+
-- Since we don't have any information about such profiles, we provide
458+
-- an empty table.
459+
460+
CREATE TABLE sql_sizing_profiles (
461+
sizing_id cardinal_number,
462+
sizing_name character_data,
463+
profile_id character_data,
464+
required_value cardinal_number,
465+
comments character_data
466+
) WITHOUT OIDS;
467+
468+
GRANT SELECT ON sql_sizing_profiles TO PUBLIC;
469+
470+
373471
/*
374472
* 20.53
375473
* TABLE_CONSTRAINTS view

src/backend/catalog/sql_features.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,13 @@ F461 Named character sets NO
227227
F471 Scalar subquery values YES
228228
F481 Expanded NULL predicate YES
229229
F491 Constraint management YES
230-
F501 Features and conformance views NO
230+
F501 Features and conformance views YES
231231
F501 Features and conformance views 01 SQL_FEATURES view YES
232-
F501 Features and conformance views 02 SQL_SIZING view NO
232+
F501 Features and conformance views 02 SQL_SIZING view YES
233233
F501 Features and conformance views 03 SQL_LANGUAGES view YES
234-
F502 Enhanced documentation tables NO
235-
F502 Enhanced documentation tables 01 SQL_SIZING_PROFILES view NO
236-
F502 Enhanced documentation tables 02 SQL_IMPLEMENTATION_INFO view NO
234+
F502 Enhanced documentation tables YES
235+
F502 Enhanced documentation tables 01 SQL_SIZING_PROFILES view YES
236+
F502 Enhanced documentation tables 02 SQL_IMPLEMENTATION_INFO view YES
237237
F502 Enhanced documentation tables 03 SQL_PACKAGES view YES
238238
F511 BIT data type YES
239239
F521 Assertions NO

src/bin/initdb/initdb.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
2828
# Portions Copyright (c) 1994, Regents of the University of California
2929
#
30-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.179 2003/01/14 23:19:34 petere Exp $
30+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.180 2003/01/15 23:37:28 petere Exp $
3131
#
3232
#-------------------------------------------------------------------------
3333

@@ -1045,6 +1045,15 @@ echo "ok"
10451045
$ECHO_N "creating information schema... "$ECHO_C
10461046
"$PGPATH"/postgres $PGSQL_OPT -N template1 > /dev/null < "$datadir"/information_schema.sql || exit_nicely
10471047
(
1048+
# Format version number to format required by information schema (09.08.0007abc).
1049+
major_version=`echo $VERSION | sed 's/^\([0-9]*\).*/00\1/;s/.*\(..\)$/\1/'`
1050+
minor_version=`echo $VERSION | sed 's/^[0-9]*\.\([0-9]*\).*/00\1/;s/.*\(..\)$/\1/'`
1051+
micro_version=`echo $VERSION | sed 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*/0000\1/;t L;s/.*/0000/;q;: L;s/.*\(....\)$/\1/'`
1052+
letter_version=`echo $VERSION | sed 's/^.*[0-9]\([^0-9]*\)$/\1/'`
1053+
combined_version="$major_version.$minor_version.$micro_version$letter_version"
1054+
1055+
echo "UPDATE information_schema.sql_implementation_info SET character_value = '$combined_version' WHERE implementation_info_name = 'DBMS VERSION';"
1056+
10481057
echo "COPY information_schema.sql_features (feature_id, feature_name, sub_feature_id, sub_feature_name, is_supported, comments) FROM STDIN;"
10491058
cat "$datadir"/sql_features.txt
10501059
echo "\."

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy