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

Commitcadf7ee

Browse files
committed
Add domain to TODO.detail
1 parent8b74f70 commitcadf7ee

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed

‎doc/TODO.detail/domain

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
From pgsql-hackers-owner+M8916@postgresql.org Thu May 17 11:51:45 2001
2+
Return-path: <pgsql-hackers-owner+M8916@postgresql.org>
3+
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
4+
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4HFpid02613
5+
for <pgman@candle.pha.pa.us>; Thu, 17 May 2001 11:51:44 -0400 (EDT)
6+
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
7+
by postgresql.org (8.11.3/8.11.1) with SMTP id f4HFoiA36759;
8+
Thu, 17 May 2001 11:50:44 -0400 (EDT)
9+
(envelope-from pgsql-hackers-owner+M8916@postgresql.org)
10+
Received: from fred.plzen-city.cz (gate.plzen-city.cz [194.212.191.10])
11+
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4HFMLA24019
12+
for <pgsql-hackers@postgreSQL.org>; Thu, 17 May 2001 11:22:21 -0400 (EDT)
13+
(envelope-from horak@sit.plzen-city.cz)
14+
Received: from exchange.mmp.plzen-city.cz ([192.168.4.42])
15+
by fred.plzen-city.cz (8.12.0.Beta7/8.12.0.Beta7/Wim) with ESMTP id f4HFMGoQ007660
16+
for <pgsql-hackers@postgreSQL.org>; Thu, 17 May 2001 17:22:16 +0200
17+
Subject: [HACKERS] possible DOMAIN implementation
18+
MIME-Version: 1.0
19+
Content-Type: text/plain;
20+
charset="iso-8859-2"
21+
Content-Class: urn:content-classes:message
22+
X-MimeOLE: Produced By Microsoft Exchange V6.0.4418.65
23+
Date: Thu, 17 May 2001 17:22:05 +0200
24+
Message-ID: <9C8918CC8CDAAC4AA79D4594A480648901E68C2B@EXCHANGE.mmp.plzen-city.cz>
25+
Thread-Topic: possible DOMAIN implementation
26+
Thread-Index: AcDe5WK0+5JgskVMEdWdCQAQS2oI5Q==
27+
From: =?iso-8859-2?Q?Hor=E1k_Daniel?= <horak@sit.plzen-city.cz>
28+
To: <pgsql-hackers@postgresql.org>
29+
Content-Transfer-Encoding: 8bit
30+
X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id f4HFMMA24022
31+
Precedence: bulk
32+
Sender: pgsql-hackers-owner@postgresql.org
33+
Status: OR
34+
35+
Hello,
36+
37+
I have spend some thinking about implementation of DOMAIN capability.
38+
Here are my ideas.
39+
40+
What is a domain? It is an alias for a type with size, constraints and
41+
default values. It is like one column of a table. And this is the main
42+
idea of my "implementation". It should be possible to implement it using
43+
existing system tables.
44+
45+
New rules for grammar can be easily created from already existing pieces
46+
(column definition of a table).
47+
48+
How to store information about a domain in system tables?
49+
When a new domain is created it will:
50+
- put a record into pg_type with typnam = domain name, new code for
51+
typtype = 'd' and typrelid = oid of a new record in pg_class (next line)
52+
- put a record into pg_class to create a fictional table with a new
53+
relkind ('d'?), relnatts = 1, relname can be system generated
54+
(pg_d_<domainname>)
55+
- put a records into pg_attribute and pg_attrdef with "column
56+
(attribute) definition" - real type, size, default value etc., owner
57+
will the fictional table from the previous step
58+
59+
Then it will be required to modify functions that works with types. When
60+
typtype of a retrieved type is 'd' then it will perform lookups into
61+
pg_class, pg_attribute and pg_attrdef to find the real definition of the
62+
domain. These additional lookups will also create a performace penalty
63+
of using domains. But every feature has its costs. I know this paragraph
64+
about the real implementation is very short, but I think there are
65+
people that know the "type mechanism" better then I know. And can easier
66+
tell if it is possible to go this way.
67+
68+
I hope you understand my explanation. It is also possible that I don't
69+
know some aspects of the backend code that makes my idea wrong.
70+
71+
Dan
72+
73+
----------------------------------------------
74+
Ing. Daniel Horak
75+
network and system administrator
76+
e-mail: horak@sit.plzen-city.cz
77+
privat e-mail: dan.horak@email.cz ICQ:36448176
78+
----------------------------------------------
79+
80+
---------------------------(end of broadcast)---------------------------
81+
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
82+
83+
From pgsql-hackers-owner+M8925@postgresql.org Thu May 17 14:04:29 2001
84+
Return-path: <pgsql-hackers-owner+M8925@postgresql.org>
85+
Received: from postgresql.org (webmail.postgresql.org [216.126.85.28])
86+
by candle.pha.pa.us (8.10.1/8.10.1) with ESMTP id f4HI4Sd12032
87+
for <pgman@candle.pha.pa.us>; Thu, 17 May 2001 14:04:28 -0400 (EDT)
88+
Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28])
89+
by postgresql.org (8.11.3/8.11.1) with SMTP id f4HI3hA18949;
90+
Thu, 17 May 2001 14:03:43 -0400 (EDT)
91+
(envelope-from pgsql-hackers-owner+M8925@postgresql.org)
92+
Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158])
93+
by postgresql.org (8.11.3/8.11.1) with ESMTP id f4HHx4A16857
94+
for <pgsql-hackers@postgresql.org>; Thu, 17 May 2001 13:59:04 -0400 (EDT)
95+
(envelope-from tgl@sss.pgh.pa.us)
96+
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
97+
by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4HHwjR12171;
98+
Thu, 17 May 2001 13:58:45 -0400 (EDT)
99+
To: =?iso-8859-2?Q?Hor=E1k_Daniel?= <horak@sit.plzen-city.cz>
100+
cc: pgsql-hackers@postgresql.org
101+
Subject: Re: [HACKERS] possible DOMAIN implementation
102+
In-Reply-To: <9C8918CC8CDAAC4AA79D4594A480648901E68C2B@EXCHANGE.mmp.plzen-city.cz>
103+
References: <9C8918CC8CDAAC4AA79D4594A480648901E68C2B@EXCHANGE.mmp.plzen-city.cz>
104+
Comments: In-reply-to =?iso-8859-2?Q?Hor=E1k_Daniel?= <horak@sit.plzen-city.cz>
105+
message dated "Thu, 17 May 2001 17:22:05 +0200"
106+
Date: Thu, 17 May 2001 13:58:45 -0400
107+
Message-ID: <12167.990122325@sss.pgh.pa.us>
108+
From: Tom Lane <tgl@sss.pgh.pa.us>
109+
Precedence: bulk
110+
Sender: pgsql-hackers-owner@postgresql.org
111+
Status: OR
112+
113+
=?iso-8859-2?Q?Hor=E1k_Daniel?= <horak@sit.plzen-city.cz> writes:
114+
> When a new domain is created it will:
115+
> - put a record into pg_type with typnam = domain name, new code for
116+
> typtype = 'd' and typrelid = oid of a new record in pg_class (next line)
117+
> - put a record into pg_class to create a fictional table with a new
118+
> relkind ('d'?), relnatts = 1, relname can be system generated
119+
> (pg_d_<domainname>)
120+
121+
Ugh. Don't overload pg_class with things that are not tables. I see no
122+
reason that either pg_class or pg_attribute should be involved in the
123+
definition of a domain. Make new system tables if you need to, but
124+
don't confuse the semantics of critical tables.
125+
126+
> - put a records into pg_attribute and pg_attrdef with "column
127+
> (attribute) definition" - real type, size, default value etc., owner
128+
> will the fictional table from the previous step
129+
130+
> Then it will be required to modify functions that works with types. When
131+
> typtype of a retrieved type is 'd' then it will perform lookups into
132+
> pg_class, pg_attribute and pg_attrdef to find the real definition of the
133+
> domain. These additional lookups will also create a performace penalty
134+
> of using domains.
135+
136+
Why shouldn't this info be directly available from the pg_type row?
137+
138+
regards, tom lane
139+
140+
---------------------------(end of broadcast)---------------------------
141+
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
142+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp