- Notifications
You must be signed in to change notification settings - Fork28
Commit7c15cef
committed
Base information_schema.sql_identifier domain on name, not varchar.
The SQL spec says that sql_identifier is a domain over varchar,but it also says that that domain is supposed to represent the setof valid identifiers for the implementation, in particular applyinga length limit matching the implementation's identifier length limit.We were declaring sql_identifier as just "character varying", thusduplicating what the spec says about base type, but entirely failingat the rest of it.Instead, let's declare sql_identifier as a domain over type "name".(We can drop the COLLATE "C" added by commit6b0faf7, since that'snow implicit in "name".) With the recent improvements to name'scomparison support, there's not a lot of functional difference betweenname and varchar. So although in principle this is a spec deviation,it's a pretty minor one. And correctly enforcing PG's name length limitis a good thing; on balance this seems closer to the intent of the specthan what we had.But that's all just language-lawyering. The *real* reason to do this isthat it makes sql_identifier columns exposed by information_schema viewsbe just direct representations of the underlying "name" catalog columns,eliminating a semantic mismatch that was disastrous for performance oftypical queries on the information_schema. In combination with therecent change to allow dropping no-op CoerceToDomain nodes, this allows(for example) queries such as select ... from information_schema.tables where table_name = 'foo';to produce an indexscan rather than a seqscan on pg_class.Discussion:https://postgr.es/m/CAFj8pRBUCX4LZ2rA2BbEkdD6NN59mgx+BLo1gO08Wod4RLtcTg@mail.gmail.com1 parent5bbee34 commit7c15cef
File tree
2 files changed
+2
-2
lines changed- src
- backend/catalog
- include/catalog
2 files changed
+2
-2
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
219 |
| - | |
| 219 | + | |
220 | 220 |
| |
221 | 221 |
| |
222 | 222 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
|
0 commit comments
Comments
(0)