Skip to main content

pg_srv/
pg_type.rs

1//! Meta layer information around pg_type
2
3/// A Postgres type. Similar structure as pg_catalog.pg_type.
4/// <https://www.postgresql.org/docs/14/catalog-pg-type.html>
5#[derive(Debug)]
6pub struct PgType<'a> {
7    pub oid: u32,
8    /// Data type name
9    pub typname: &'a str,
10    // Name of the type when converted to regtype
11    pub regtype: &'a str,
12    /// The OID of the namespace that contains this type. references pg_namespace.oid
13    pub typnamespace: u32,
14    /// Owner of the type. references pg_authid.oid
15    pub typowner: u32,
16    /// For a fixed-size type, typlen is the number of bytes in the internal representation of the type. But for a variable-length type, typlen is negative. -1 indicates a “varlena” type (one that has a length word), -2 indicates a null-terminated C string.
17    pub typlen: i16,
18    pub typbyval: bool,
19    pub typtype: &'a str,
20    pub typcategory: &'a str,
21    pub typisprefered: bool,
22    pub typisdefined: bool,
23    pub typrelid: u32,
24    pub typsubscript: &'static str,
25    pub typelem: u32,
26    pub typarray: u32,
27    pub typalign: &'static str,
28    pub typstorage: &'static str,
29    pub typbasetype: u32,
30    pub typreceive: &'static str,
31    pub typreceive_oid: u32,
32}
33
34impl PgType<'_> {
35    pub fn get_typinput(&self) -> String {
36        if let Some(ty_id) = PgTypeId::from_oid(self.oid) {
37            // TODO: It requires additional verification
38            match ty_id {
39                PgTypeId::ARRAYTEXT
40                | PgTypeId::ARRAYINT2
41                | PgTypeId::ARRAYINT4
42                | PgTypeId::ARRAYINT8
43                | PgTypeId::ARRAYFLOAT4
44                | PgTypeId::ARRAYFLOAT8
45                | PgTypeId::ARRAYBOOL
46                | PgTypeId::ARRAYBYTEA => "array_in".to_string(),
47                PgTypeId::TIMESTAMP
48                | PgTypeId::TIMESTAMPTZ
49                | PgTypeId::DATE
50                | PgTypeId::TIME
51                | PgTypeId::TIMETZ => self.typname.to_owned() + "_in",
52                PgTypeId::TSMULTIRANGE
53                | PgTypeId::NUMMULTIRANGE
54                | PgTypeId::DATEMULTIRANGE
55                | PgTypeId::INT4MULTIRANGE
56                | PgTypeId::INT8MULTIRANGE => "multirange_in".to_string(),
57                PgTypeId::MONEY => "cash_in".to_string(),
58                PgTypeId::PGCLASS | PgTypeId::PGNAMESPACE => "record_in".to_string(),
59                _ => self.typname.to_owned() + "in",
60            }
61        } else {
62            "record_in".to_string()
63        }
64    }
65
66    pub const fn is_binary_supported(&self) -> bool {
67        // Right now, We assume that all types have binary encoding support
68        true
69    }
70}
71
72macro_rules! define_pg_types {
73    ($($NAME:ident ($OID:expr) { $($KEY:ident: $VALUE:expr,)* },)*) => {
74        #[derive(Debug, Clone, Copy)]
75        #[repr(u32)]
76        pub enum PgTypeId {
77            UNSPECIFIED = 0,
78            $($NAME = $OID,)*
79        }
80
81        impl PgTypeId {
82            pub const fn from_oid(oid: u32) -> Option<Self> {
83                match oid {
84                    0 => Some(Self::UNSPECIFIED),
85                    $($OID => Some(Self::$NAME),)*
86                    _ => None,
87                }
88            }
89        }
90
91        impl<'a> PgType<'a> {
92            pub const fn get_by_tid(oid: PgTypeId) -> &'static PgType<'static> {
93                match oid {
94                    PgTypeId::UNSPECIFIED => UNSPECIFIED,
95                    $(PgTypeId::$NAME => $NAME,)*
96                }
97            }
98
99            pub const fn get_all() -> &'static [&'static PgType<'static>] {
100                &[
101                    $($NAME,)*
102                ]
103            }
104        }
105
106        $(
107            const $NAME: &PgType = &PgType {
108                oid: PgTypeId::$NAME as u32,
109                $($KEY: $VALUE,)*
110            };
111        )*
112    }
113}
114
115const UNSPECIFIED: &PgType = &PgType {
116    oid: 0,
117    typname: "unspecified",
118    regtype: "",
119    typnamespace: 11,
120    typowner: 10,
121    typlen: 1,
122    typbyval: true,
123    typtype: "b",
124    typcategory: "B",
125    typisprefered: true,
126    typisdefined: true,
127    typrelid: 0,
128    typsubscript: "-",
129    typelem: 0,
130    typarray: 0,
131    typalign: "-",
132    typstorage: "-",
133    typbasetype: 0,
134    typreceive: "",
135    typreceive_oid: 0,
136};
137
138define_pg_types![
139    BOOL (16) {
140        typname: "bool",
141        regtype: "boolean",
142        typnamespace: 11,
143        typowner: 10,
144        typlen: 1,
145        typbyval: true,
146        typtype: "b",
147        typcategory: "B",
148        typisprefered: true,
149        typisdefined: true,
150        typrelid: 0,
151        typsubscript: "-",
152        typelem: 0,
153        typarray: 1000,
154        typalign: "c",
155        typstorage: "p",
156        typbasetype: 0,
157        typreceive: "boolrecv",
158        typreceive_oid: 2436,
159    },
160
161    BYTEA (17) {
162        typname: "bytea",
163        regtype: "bytea",
164        typnamespace: 11,
165        typowner: 10,
166        typlen: -1,
167        typbyval: false,
168        typtype: "b",
169        typcategory: "U",
170        typisprefered: false,
171        typisdefined: true,
172        typrelid: 0,
173        typsubscript: "-",
174        typelem: 0,
175        typarray: 1001,
176        typalign: "i",
177        typstorage: "x",
178        typbasetype: 0,
179        typreceive: "bytearecv",
180        // TODO: Get from pg_proc
181        typreceive_oid: 0,
182    },
183
184    NAME (19) {
185        typname: "name",
186        regtype: "name",
187        typnamespace: 11,
188        typowner: 10,
189        typlen: 64,
190        typbyval: false,
191        typtype: "b",
192        typcategory: "S",
193        typisprefered: false,
194        typisdefined: true,
195        typrelid: 0,
196        typsubscript: "raw_array_subscript_handler",
197        typelem: 0,
198        typarray: 1003,
199        typalign: "c",
200        typstorage: "p",
201        typbasetype: 0,
202        typreceive: "namerecv",
203        // TODO: Get from pg_proc
204        typreceive_oid: 0,
205    },
206
207    INT8 (20) {
208        typname: "int8",
209        regtype: "bigint",
210        typnamespace: 11,
211        typowner: 10,
212        typlen: 8,
213        typbyval: true,
214        typtype: "b",
215        typcategory: "N",
216        typisprefered: false,
217        typisdefined: true,
218        typrelid: 0,
219        typsubscript: "-",
220        typelem: 0,
221        typarray: 1016,
222        typalign: "d",
223        typstorage: "p",
224        typbasetype: 0,
225        typreceive: "int8recv",
226        typreceive_oid: 2408,
227    },
228
229    INT2 (21) {
230        typname: "int2",
231        regtype: "smallint",
232        typnamespace: 11,
233        typowner: 10,
234        typlen: 2,
235        typbyval: true,
236        typtype: "b",
237        typcategory: "N",
238        typisprefered: false,
239        typisdefined: true,
240        typrelid: 0,
241        typsubscript: "-",
242        typelem: 0,
243        typarray: 1005,
244        typalign: "s",
245        typstorage: "p",
246        typbasetype: 0,
247        typreceive: "int2recv",
248        // TODO: Get from pg_proc
249        typreceive_oid: 0,
250    },
251
252    INT4 (23) {
253        typname: "int4",
254        regtype: "integer",
255        typnamespace: 11,
256        typowner: 10,
257        typlen: 4,
258        typbyval: true,
259        typtype: "b",
260        typcategory: "N",
261        typisprefered: false,
262        typisdefined: true,
263        typrelid: 0,
264        typsubscript: "-",
265        typelem: 0,
266        typarray: 1007,
267        typalign: "i",
268        typstorage: "p",
269        typbasetype: 0,
270        typreceive: "int4recv",
271        typreceive_oid: 2406,
272    },
273
274    TEXT (25) {
275        typname: "text",
276        regtype: "text",
277        typnamespace: 11,
278        typowner: 10,
279        typlen: -1,
280        typbyval: false,
281        typtype: "b",
282        typcategory: "S",
283        typisprefered: true,
284        typisdefined: true,
285        typrelid: 0,
286        typsubscript: "-",
287        typelem: 0,
288        typarray: 1009,
289        typalign: "i",
290        typstorage: "x",
291        typbasetype: 0,
292        typreceive: "textrecv",
293        typreceive_oid: 2414,
294    },
295
296    OID (26) {
297        typname: "oid",
298        regtype: "oid",
299        typnamespace: 11,
300        typowner: 10,
301        typlen: 4,
302        typbyval: true,
303        typtype: "b",
304        typcategory: "N",
305        typisprefered: true,
306        typisdefined: true,
307        typrelid: 0,
308        typsubscript: "-",
309        typelem: 0,
310        typarray: 1028,
311        typalign: "i",
312        typstorage: "p",
313        typbasetype: 0,
314        typreceive: "oidrecv",
315        // TODO: Get from pg_proc
316        typreceive_oid: 0,
317    },
318
319    TID (27) {
320        typname: "tid",
321        regtype: "tid",
322        typnamespace: 11,
323        typowner: 10,
324        typlen: 6,
325        typbyval: false,
326        typtype: "b",
327        typcategory: "U",
328        typisprefered: false,
329        typisdefined: true,
330        typrelid: 0,
331        typsubscript: "-",
332        typelem: 0,
333        typarray: 1010,
334        typalign: "s",
335        typstorage: "p",
336        typbasetype: 0,
337        typreceive: "tidrecv",
338        // TODO: Get from pg_proc
339        typreceive_oid: 0,
340    },
341
342    PGCLASS (83) {
343        typname: "pg_class",
344        regtype: "pg_class",
345        typnamespace: 11,
346        typowner: 10,
347        typlen: -1,
348        typbyval: false,
349        typtype: "c",
350        typcategory: "C",
351        typisprefered: false,
352        typisdefined: true,
353        typrelid: 1259,
354        typsubscript: "-",
355        typelem: 0,
356        typarray: 273,
357        typalign: "d",
358        typstorage: "x",
359        typbasetype: 0,
360        typreceive: "record_recv",
361        // TODO: Get from pg_proc
362        typreceive_oid: 0,
363    },
364
365    ARRAYPGCLASS (273) {
366        typname: "_pg_class",
367        regtype: "pg_class[]",
368        typnamespace: 11,
369        typowner: 10,
370        typlen: -1,
371        typbyval: false,
372        typtype: "b",
373        typcategory: "A",
374        typisprefered: false,
375        typisdefined: true,
376        typrelid: 0,
377        typsubscript: "array_subscript_handler",
378        typelem: 83,
379        typarray: 0,
380        typalign: "d",
381        typstorage: "x",
382        typbasetype: 0,
383        typreceive: "array_recv",
384        // TODO: Get from pg_proc
385        typreceive_oid: 0,
386    },
387
388    FLOAT4 (700) {
389        typname: "float4",
390        regtype: "real",
391        typnamespace: 11,
392        typowner: 10,
393        typlen: 4,
394        typbyval: true,
395        typtype: "b",
396        typcategory: "N",
397        typisprefered: false,
398        typisdefined: true,
399        typrelid: 0,
400        typsubscript: "-",
401        typelem: 0,
402        typarray: 1021,
403        typalign: "i",
404        typstorage: "p",
405        typbasetype: 0,
406        typreceive: "float4recv",
407        typreceive_oid: 2424,
408    },
409
410    FLOAT8 (701) {
411        typname: "float8",
412        regtype: "double precision",
413        typnamespace: 11,
414        typowner: 10,
415        typlen: 8,
416        typbyval: true,
417        typtype: "b",
418        typcategory: "N",
419        typisprefered: true,
420        typisdefined: true,
421        typrelid: 0,
422        typsubscript: "-",
423        typelem: 0,
424        typarray: 1022,
425        typalign: "d",
426        typstorage: "p",
427        typbasetype: 0,
428        typreceive: "float8recv",
429        typreceive_oid: 2426,
430    },
431
432    MONEY (790) {
433        typname: "money",
434        regtype: "money",
435        typnamespace: 11,
436        typowner: 10,
437        typlen: 8,
438        typbyval: true,
439        typtype: "b",
440        typcategory: "N",
441        typisprefered: false,
442        typisdefined: true,
443        typrelid: 0,
444        typsubscript: "-",
445        typelem: 0,
446        typarray: 791,
447        typalign: "d",
448        typstorage: "p",
449        typbasetype: 0,
450        typreceive: "cash_recv",
451        // TODO: Get from pg_proc
452        typreceive_oid: 0,
453    },
454
455    ARRAYMONEY (791) {
456        typname: "_money",
457        regtype: "money[]",
458        typnamespace: 11,
459        typowner: 10,
460        typlen: -1,
461        typbyval: false,
462        typtype: "b",
463        typcategory: "A",
464        typisprefered: false,
465        typisdefined: true,
466        typrelid: 0,
467        typsubscript: "array_subscript_handler",
468        typelem: 790,
469        typarray: 0,
470        typalign: "d",
471        typstorage: "x",
472        typbasetype: 0,
473        typreceive: "array_recv",
474        // TODO: Get from pg_proc
475        typreceive_oid: 0,
476    },
477
478    INET (869) {
479        typname: "inet",
480        regtype: "inet",
481        typnamespace: 11,
482        typowner: 10,
483        typlen: -1,
484        typbyval: false,
485        typtype: "b",
486        typcategory: "I",
487        typisprefered: true,
488        typisdefined: true,
489        typrelid: 0,
490        typsubscript: "-",
491        typelem: 0,
492        typarray: 1041,
493        typalign: "i",
494        typstorage: "m",
495        typbasetype: 0,
496        typreceive: "inet_recv",
497        // TODO: Get from pg_proc
498        typreceive_oid: 0,
499    },
500
501    ARRAYBOOL (1000) {
502        typname: "_bool",
503        regtype: "boolean[]",
504        typnamespace: 11,
505        typowner: 10,
506        typlen: -1,
507        typbyval: false,
508        typtype: "b",
509        typcategory: "A",
510        typisprefered: false,
511        typisdefined: true,
512        typrelid: 0,
513        typsubscript: "array_subscript_handler",
514        typelem: 16,
515        typarray: 0,
516        typalign: "i",
517        typstorage: "x",
518        typbasetype: 0,
519        typreceive: "array_recv",
520        // TODO: Get from pg_proc
521        typreceive_oid: 0,
522    },
523
524    ARRAYBYTEA (1001) {
525        typname: "_bytea",
526        regtype: "bytea[]",
527        typnamespace: 11,
528        typowner: 10,
529        typlen: -1,
530        typbyval: false,
531        typtype: "b",
532        typcategory: "A",
533        typisprefered: false,
534        typisdefined: true,
535        typrelid: 0,
536        typsubscript: "array_subscript_handler",
537        typelem: 17,
538        typarray: 0,
539        typalign: "i",
540        typstorage: "x",
541        typbasetype: 0,
542        typreceive: "array_recv",
543        // TODO: Get from pg_proc
544        typreceive_oid: 0,
545    },
546
547    ARRAYNAME (1003) {
548        typname: "_name",
549        regtype: "name[]",
550        typnamespace: 11,
551        typowner: 10,
552        typlen: -1,
553        typbyval: false,
554        typtype: "b",
555        typcategory: "A",
556        typisprefered: false,
557        typisdefined: true,
558        typrelid: 0,
559        typsubscript: "array_subscript_handler",
560        typelem: 19,
561        typarray: 0,
562        typalign: "i",
563        typstorage: "x",
564        typbasetype: 0,
565        typreceive: "array_recv",
566        // TODO: Get from pg_proc
567        typreceive_oid: 0,
568    },
569
570    ARRAYINT2 (1005) {
571        typname: "_int2",
572        regtype: "smallint[]",
573        typnamespace: 11,
574        typowner: 10,
575        typlen: -1,
576        typbyval: false,
577        typtype: "b",
578        typcategory: "A",
579        typisprefered: false,
580        typisdefined: true,
581        typrelid: 0,
582        typsubscript: "array_subscript_handler",
583        typelem: 21,
584        typarray: 0,
585        typalign: "i",
586        typstorage: "x",
587        typbasetype: 0,
588        typreceive: "array_recv",
589        // TODO: Get from pg_proc
590        typreceive_oid: 0,
591    },
592
593    ARRAYINT4 (1007) {
594        typname: "_int4",
595        regtype: "integer[]",
596        typnamespace: 11,
597        typowner: 10,
598        typlen: -1,
599        typbyval: false,
600        typtype: "b",
601        typcategory: "A",
602        typisprefered: false,
603        typisdefined: true,
604        typrelid: 0,
605        typsubscript: "array_subscript_handler",
606        typelem: 23,
607        typarray: 0,
608        typalign: "i",
609        typstorage: "x",
610        typbasetype: 0,
611        typreceive: "array_recv",
612        // TODO: Get from pg_proc
613        typreceive_oid: 0,
614    },
615
616    ARRAYTEXT (1009) {
617        typname: "_text",
618        regtype: "text[]",
619        typnamespace: 11,
620        typowner: 10,
621        typlen: -1,
622        typbyval: false,
623        typtype: "b",
624        typcategory: "A",
625        typisprefered: false,
626        typisdefined: true,
627        typrelid: 0,
628        typsubscript: "array_subscript_handler",
629        typelem: 25,
630        typarray: 0,
631        typalign: "i",
632        typstorage: "x",
633        typbasetype: 0,
634        typreceive: "array_recv",
635        // TODO: Get from pg_proc
636        typreceive_oid: 0,
637    },
638
639    ARRAYTID (1010) {
640        typname: "_tid",
641        regtype: "tid[]",
642        typnamespace: 11,
643        typowner: 10,
644        typlen: -1,
645        typbyval: false,
646        typtype: "b",
647        typcategory: "A",
648        typisprefered: false,
649        typisdefined: true,
650        typrelid: 0,
651        typsubscript: "array_subscript_handler",
652        typelem: 27,
653        typarray: 0,
654        typalign: "i",
655        typstorage: "x",
656        typbasetype: 0,
657        typreceive: "array_recv",
658        // TODO: Get from pg_proc
659        typreceive_oid: 0,
660    },
661
662    ARRAYBPCHAR (1014) {
663        typname: "_bpchar",
664        regtype: "character[]",
665        typnamespace: 11,
666        typowner: 10,
667        typlen: -1,
668        typbyval: false,
669        typtype: "b",
670        typcategory: "A",
671        typisprefered: false,
672        typisdefined: true,
673        typrelid: 0,
674        typsubscript: "array_subscript_handler",
675        typelem: 1042,
676        typarray: 0,
677        typalign: "i",
678        typstorage: "x",
679        typbasetype: 0,
680        typreceive: "array_recv",
681        // TODO: Get from pg_proc
682        typreceive_oid: 0,
683    },
684
685    ARRAYVARCHAR (1015) {
686        typname: "_varchar",
687        regtype: "character varying[]",
688        typnamespace: 11,
689        typowner: 10,
690        typlen: -1,
691        typbyval: false,
692        typtype: "b",
693        typcategory: "A",
694        typisprefered: false,
695        typisdefined: true,
696        typrelid: 0,
697        typsubscript: "array_subscript_handler",
698        typelem: 1043,
699        typarray: 0,
700        typalign: "i",
701        typstorage: "x",
702        typbasetype: 0,
703        typreceive: "array_recv",
704        // TODO: Get from pg_proc
705        typreceive_oid: 0,
706    },
707
708    ARRAYINT8 (1016) {
709        typname: "_int8",
710        regtype: "bigint[]",
711        typnamespace: 11,
712        typowner: 10,
713        typlen: -1,
714        typbyval: false,
715        typtype: "b",
716        typcategory: "A",
717        typisprefered: false,
718        typisdefined: true,
719        typrelid: 0,
720        typsubscript: "array_subscript_handler",
721        typelem: 20,
722        typarray: 0,
723        typalign: "d",
724        typstorage: "x",
725        typbasetype: 0,
726        typreceive: "array_recv",
727        // TODO: Get from pg_proc
728        typreceive_oid: 0,
729    },
730
731    ARRAYFLOAT4 (1021) {
732        typname: "_float4",
733        regtype: "real[]",
734        typnamespace: 11,
735        typowner: 10,
736        typlen: -1,
737        typbyval: false,
738        typtype: "b",
739        typcategory: "A",
740        typisprefered: false,
741        typisdefined: true,
742        typrelid: 0,
743        typsubscript: "array_subscript_handler",
744        typelem: 700,
745        typarray: 0,
746        typalign: "i",
747        typstorage: "x",
748        typbasetype: 0,
749        typreceive: "array_recv",
750        // TODO: Get from pg_proc
751        typreceive_oid: 0,
752    },
753
754    ARRAYFLOAT8 (1022) {
755        typname: "_float8",
756        regtype: "double precision[]",
757        typnamespace: 11,
758        typowner: 10,
759        typlen: -1,
760        typbyval: false,
761        typtype: "b",
762        typcategory: "A",
763        typisprefered: false,
764        typisdefined: true,
765        typrelid: 0,
766        typsubscript: "array_subscript_handler",
767        typelem: 701,
768        typarray: 0,
769        typalign: "d",
770        typstorage: "x",
771        typbasetype: 0,
772        typreceive: "array_recv",
773        // TODO: Get from pg_proc
774        typreceive_oid: 0,
775    },
776
777    ARRAYOID (1028) {
778        typname: "_oid",
779        regtype: "oid[]",
780        typnamespace: 11,
781        typowner: 10,
782        typlen: -1,
783        typbyval: false,
784        typtype: "b",
785        typcategory: "A",
786        typisprefered: false,
787        typisdefined: true,
788        typrelid: 0,
789        typsubscript: "array_subscript_handler",
790        typelem: 26,
791        typarray: 0,
792        typalign: "i",
793        typstorage: "x",
794        typbasetype: 0,
795        typreceive: "array_recv",
796        // TODO: Get from pg_proc
797        typreceive_oid: 0,
798    },
799
800    ACLITEM (1033) {
801        typname: "aclitem",
802        regtype: "aclitem",
803        typnamespace: 11,
804        typowner: 10,
805        typlen: 12,
806        typbyval: false,
807        typtype: "b",
808        typcategory: "U",
809        typisprefered: false,
810        typisdefined: true,
811        typrelid: 0,
812        typsubscript: "-",
813        typelem: 0,
814        typarray: 1034,
815        typalign: "i",
816        typstorage: "p",
817        typbasetype: 0,
818        typreceive: "-",
819        // TODO: Get from pg_proc
820        typreceive_oid: 0,
821    },
822
823    ARRAYACLITEM (1034) {
824        typname: "_aclitem",
825        regtype: "aclitem[]",
826        typnamespace: 11,
827        typowner: 10,
828        typlen: -1,
829        typbyval: false,
830        typtype: "b",
831        typcategory: "A",
832        typisprefered: false,
833        typisdefined: true,
834        typrelid: 0,
835        typsubscript: "array_subscript_handler",
836        typelem: 1033,
837        typarray: 0,
838        typalign: "i",
839        typstorage: "x",
840        typbasetype: 0,
841        typreceive: "array_recv",
842        // TODO: Get from pg_proc
843        typreceive_oid: 0,
844    },
845
846    ARRAYINET (1041) {
847        typname: "_inet",
848        regtype: "inet[]",
849        typnamespace: 11,
850        typowner: 10,
851        typlen: -1,
852        typbyval: false,
853        typtype: "b",
854        typcategory: "A",
855        typisprefered: false,
856        typisdefined: true,
857        typrelid: 0,
858        typsubscript: "array_subscript_handler",
859        typelem: 869,
860        typarray: 0,
861        typalign: "i",
862        typstorage: "x",
863        typbasetype: 0,
864        typreceive: "array_recv",
865        // TODO: Get from pg_proc
866        typreceive_oid: 0,
867    },
868
869    BPCHAR (1042) {
870        typname: "bpchar",
871        regtype: "character",
872        typnamespace: 11,
873        typowner: 10,
874        typlen: -1,
875        typbyval: false,
876        typtype: "b",
877        typcategory: "S",
878        typisprefered: false,
879        typisdefined: true,
880        typrelid: 0,
881        typsubscript: "-",
882        typelem: 0,
883        typarray: 1014,
884        typalign: "i",
885        typstorage: "x",
886        typbasetype: 0,
887        typreceive: "bpcharrecv",
888        // TODO: Get from pg_proc
889        typreceive_oid: 0,
890    },
891
892    VARCHAR (1043) {
893        typname: "varchar",
894        regtype: "character varying",
895        typnamespace: 11,
896        typowner: 10,
897        typlen: -1,
898        typbyval: false,
899        typtype: "b",
900        typcategory: "S",
901        typisprefered: false,
902        typisdefined: true,
903        typrelid: 0,
904        typsubscript: "-",
905        typelem: 0,
906        typarray: 1015,
907        typalign: "i",
908        typstorage: "x",
909        typbasetype: 0,
910        typreceive: "varcharrecv",
911        typreceive_oid: 2432,
912    },
913
914    DATE (1082) {
915        typname: "date",
916        regtype: "date",
917        typnamespace: 11,
918        typowner: 10,
919        typlen: 4,
920        typbyval: true,
921        typtype: "b",
922        typcategory: "D",
923        typisprefered: false,
924        typisdefined: true,
925        typrelid: 0,
926        typsubscript: "-",
927        typelem: 0,
928        typarray: 1182,
929        typalign: "i",
930        typstorage: "p",
931        typbasetype: 0,
932        typreceive: "date_recv",
933        // TODO: Get from pg_proc
934        typreceive_oid: 0,
935    },
936
937    TIME (1083) {
938        typname: "time",
939        regtype: "time without time zone",
940        typnamespace: 11,
941        typowner: 10,
942        typlen: 8,
943        typbyval: true,
944        typtype: "b",
945        typcategory: "D",
946        typisprefered: false,
947        typisdefined: true,
948        typrelid: 0,
949        typsubscript: "-",
950        typelem: 0,
951        typarray: 1183,
952        typalign: "d",
953        typstorage: "p",
954        typbasetype: 0,
955        typreceive: "time_recv",
956        // TODO: Get from pg_proc
957        typreceive_oid: 0,
958    },
959
960    TIMESTAMP (1114) {
961        typname: "timestamp",
962        regtype: "timestamp without time zone",
963        typnamespace: 11,
964        typowner: 10,
965        typlen: 8,
966        typbyval: true,
967        typtype: "b",
968        typcategory: "D",
969        typisprefered: false,
970        typisdefined: true,
971        typrelid: 0,
972        typsubscript: "-",
973        typelem: 0,
974        typarray: 1115,
975        typalign: "d",
976        typstorage: "p",
977        typbasetype: 0,
978        typreceive: "timestamp_recv",
979        typreceive_oid: 2474,
980    },
981
982    ARRAYTIMESTAMP (1115) {
983        typname: "_timestamp",
984        regtype: "timestamp without time zone[]",
985        typnamespace: 11,
986        typowner: 10,
987        typlen: -1,
988        typbyval: false,
989        typtype: "b",
990        typcategory: "A",
991        typisprefered: false,
992        typisdefined: true,
993        typrelid: 0,
994        typsubscript: "array_subscript_handler",
995        typelem: 1114,
996        typarray: 0,
997        typalign: "d",
998        typstorage: "x",
999        typbasetype: 0,
1000        typreceive: "array_recv",
1001        // TODO: Get from pg_proc
1002        typreceive_oid: 0,
1003    },
1004
1005    ARRAYDATE (1182) {
1006        typname: "_date",
1007        regtype: "date[]",
1008        typnamespace: 11,
1009        typowner: 10,
1010        typlen: -1,
1011        typbyval: false,
1012        typtype: "b",
1013        typcategory: "A",
1014        typisprefered: false,
1015        typisdefined: true,
1016        typrelid: 0,
1017        typsubscript: "array_subscript_handler",
1018        typelem: 1082,
1019        typarray: 0,
1020        typalign: "i",
1021        typstorage: "x",
1022        typbasetype: 0,
1023        typreceive: "array_recv",
1024        // TODO: Get from pg_proc
1025        typreceive_oid: 0,
1026    },
1027
1028    ARRAYTIME (1183) {
1029        typname: "_time",
1030        regtype: "time without time zone[]",
1031        typnamespace: 11,
1032        typowner: 10,
1033        typlen: -1,
1034        typbyval: false,
1035        typtype: "b",
1036        typcategory: "A",
1037        typisprefered: false,
1038        typisdefined: true,
1039        typrelid: 0,
1040        typsubscript: "array_subscript_handler",
1041        typelem: 1083,
1042        typarray: 0,
1043        typalign: "d",
1044        typstorage: "x",
1045        typbasetype: 0,
1046        typreceive: "array_recv",
1047        // TODO: Get from pg_proc
1048        typreceive_oid: 0,
1049    },
1050
1051    TIMESTAMPTZ (1184) {
1052        typname: "timestamptz",
1053        regtype: "timestamp with time zone",
1054        typnamespace: 11,
1055        typowner: 10,
1056        typlen: 8,
1057        typbyval: true,
1058        typtype: "b",
1059        typcategory: "D",
1060        typisprefered: true,
1061        typisdefined: true,
1062        typrelid: 0,
1063        typsubscript: "-",
1064        typelem: 0,
1065        typarray: 1185,
1066        typalign: "d",
1067        typstorage: "p",
1068        typbasetype: 0,
1069        typreceive: "timestamptz_recv",
1070        // TODO: Get from pg_proc
1071        typreceive_oid: 0,
1072    },
1073
1074    ARRAYTIMESTAMPTZ (1185) {
1075        typname: "_timestamptz",
1076        regtype: "timestamp with time zone[]",
1077        typnamespace: 11,
1078        typowner: 10,
1079        typlen: -1,
1080        typbyval: false,
1081        typtype: "b",
1082        typcategory: "A",
1083        typisprefered: false,
1084        typisdefined: true,
1085        typrelid: 0,
1086        typsubscript: "array_subscript_handler",
1087        typelem: 1184,
1088        typarray: 0,
1089        typalign: "d",
1090        typstorage: "x",
1091        typbasetype: 0,
1092        typreceive: "array_recv",
1093        // TODO: Get from pg_proc
1094        typreceive_oid: 0,
1095    },
1096
1097    INTERVAL (1186) {
1098        typname: "interval",
1099        regtype: "interval",
1100        typnamespace: 11,
1101        typowner: 10,
1102        typlen: 16,
1103        typbyval: false,
1104        typtype: "b",
1105        typcategory: "T",
1106        typisprefered: true,
1107        typisdefined: true,
1108        typrelid: 0,
1109        typsubscript: "-",
1110        typelem: 0,
1111        typarray: 1187,
1112        typalign: "d",
1113        typstorage: "p",
1114        typbasetype: 0,
1115        typreceive: "interval_recv",
1116        // TODO: Get from pg_proc
1117        typreceive_oid: 0,
1118    },
1119
1120    ARRAYINTERVAL (1187) {
1121        typname: "_interval",
1122        regtype: "interval[]",
1123        typnamespace: 11,
1124        typowner: 10,
1125        typlen: -1,
1126        typbyval: false,
1127        typtype: "b",
1128        typcategory: "A",
1129        typisprefered: false,
1130        typisdefined: true,
1131        typrelid: 0,
1132        typsubscript: "array_subscript_handler",
1133        typelem: 1186,
1134        typarray: 0,
1135        typalign: "d",
1136        typstorage: "x",
1137        typbasetype: 0,
1138        typreceive: "array_recv",
1139        // TODO: Get from pg_proc
1140        typreceive_oid: 0,
1141    },
1142
1143    ARRAYNUMERIC (1231) {
1144        typname: "_numeric",
1145        regtype: "numeric[]",
1146        typnamespace: 11,
1147        typowner: 10,
1148        typlen: -1,
1149        typbyval: false,
1150        typtype: "b",
1151        typcategory: "A",
1152        typisprefered: false,
1153        typisdefined: true,
1154        typrelid: 0,
1155        typsubscript: "array_subscript_handler",
1156        typelem: 1700,
1157        typarray: 0,
1158        typalign: "i",
1159        typstorage: "x",
1160        typbasetype: 0,
1161        typreceive: "array_recv",
1162        // TODO: Get from pg_proc
1163        typreceive_oid: 0,
1164    },
1165
1166    TIMETZ (1266) {
1167        typname: "timetz",
1168        regtype: "time with time zone",
1169        typnamespace: 11,
1170        typowner: 10,
1171        typlen: 12,
1172        typbyval: false,
1173        typtype: "b",
1174        typcategory: "D",
1175        typisprefered: false,
1176        typisdefined: true,
1177        typrelid: 0,
1178        typsubscript: "-",
1179        typelem: 0,
1180        typarray: 1270,
1181        typalign: "d",
1182        typstorage: "p",
1183        typbasetype: 0,
1184        typreceive: "timetz_recv",
1185        // TODO: Get from pg_proc
1186        typreceive_oid: 0,
1187    },
1188
1189    ARRAYTIMETZ (1270) {
1190        typname: "_timetz",
1191        regtype: "time with time zone[]",
1192        typnamespace: 11,
1193        typowner: 10,
1194        typlen: -1,
1195        typbyval: false,
1196        typtype: "b",
1197        typcategory: "A",
1198        typisprefered: false,
1199        typisdefined: true,
1200        typrelid: 0,
1201        typsubscript: "array_subscript_handler",
1202        typelem: 1266,
1203        typarray: 0,
1204        typalign: "d",
1205        typstorage: "x",
1206        typbasetype: 0,
1207        typreceive: "array_recv",
1208        // TODO: Get from pg_proc
1209        typreceive_oid: 0,
1210    },
1211
1212    NUMERIC (1700) {
1213        typname: "numeric",
1214        regtype: "numeric",
1215        typnamespace: 11,
1216        typowner: 10,
1217        typlen: -1,
1218        typbyval: false,
1219        typtype: "b",
1220        typcategory: "N",
1221        typisprefered: false,
1222        typisdefined: true,
1223        typrelid: 0,
1224        typsubscript: "-",
1225        typelem: 0,
1226        typarray: 1231,
1227        typalign: "i",
1228        typstorage: "m",
1229        typbasetype: 0,
1230        typreceive: "numeric_recv",
1231        typreceive_oid: 2460,
1232    },
1233
1234    RECORD (2249) {
1235        typname: "record",
1236        regtype: "record",
1237        typnamespace: 11,
1238        typowner: 10,
1239        typlen: -1,
1240        typbyval: false,
1241        typtype: "p",
1242        typcategory: "P",
1243        typisprefered: false,
1244        typisdefined: true,
1245        typrelid: 0,
1246        typsubscript: "-",
1247        typelem: 0,
1248        typarray: 2287,
1249        typalign: "d",
1250        typstorage: "x",
1251        typbasetype: 0,
1252        typreceive: "record_recv",
1253        // TODO: Get from pg_proc
1254        typreceive_oid: 0,
1255    },
1256
1257    ANYARRAY (2277) {
1258        typname: "anyarray",
1259        regtype: "anyarray",
1260        typnamespace: 11,
1261        typowner: 10,
1262        typlen: -1,
1263        typbyval: false,
1264        typtype: "p",
1265        typcategory: "P",
1266        typisprefered: false,
1267        typisdefined: true,
1268        typrelid: 0,
1269        typsubscript: "-",
1270        typelem: 0,
1271        typarray: 0,
1272        typalign: "d",
1273        typstorage: "x",
1274        typbasetype: 0,
1275        typreceive: "anyarray_recv",
1276        // TODO: Get from pg_proc
1277        typreceive_oid: 0,
1278    },
1279
1280    ANYELEMENT (2283) {
1281        typname: "anyelement",
1282        regtype: "anyelement",
1283        typnamespace: 11,
1284        typowner: 10,
1285        typlen: 4,
1286        typbyval: true,
1287        typtype: "p",
1288        typcategory: "P",
1289        typisprefered: false,
1290        typisdefined: true,
1291        typrelid: 0,
1292        typsubscript: "-",
1293        typelem: 0,
1294        typarray: 0,
1295        typalign: "i",
1296        typstorage: "p",
1297        typbasetype: 0,
1298        typreceive: "-",
1299        // TODO: Get from pg_proc
1300        typreceive_oid: 0,
1301    },
1302
1303    ARRAYRECORD (2287) {
1304        typname: "_record",
1305        regtype: "record[]",
1306        typnamespace: 11,
1307        typowner: 10,
1308        typlen: -1,
1309        typbyval: false,
1310        typtype: "p",
1311        typcategory: "P",
1312        typisprefered: false,
1313        typisdefined: true,
1314        typrelid: 0,
1315        typsubscript: "array_subscript_handler",
1316        typelem: 2249,
1317        typarray: 0,
1318        typalign: "d",
1319        typstorage: "x",
1320        typbasetype: 0,
1321        typreceive: "array_recv",
1322        // TODO: Get from pg_proc
1323        typreceive_oid: 0,
1324    },
1325
1326    PGLSN (3220) {
1327        typname: "pg_lsn",
1328        regtype: "pg_lsn",
1329        typnamespace: 11,
1330        typowner: 10,
1331        typlen: 8,
1332        typbyval: true,
1333        typtype: "b",
1334        typcategory: "U",
1335        typisprefered: false,
1336        typisdefined: true,
1337        typrelid: 0,
1338        typsubscript: "-",
1339        typelem: 0,
1340        typarray: 3221,
1341        typalign: "d",
1342        typstorage: "p",
1343        typbasetype: 0,
1344        typreceive: "pg_lsn_recv",
1345        // TODO: Get from pg_proc
1346        typreceive_oid: 0,
1347    },
1348
1349    ARRAYPGLSN (3221) {
1350        typname: "_pg_lsn",
1351        regtype: "pg_lsn[]",
1352        typnamespace: 11,
1353        typowner: 10,
1354        typlen: -1,
1355        typbyval: false,
1356        typtype: "b",
1357        typcategory: "A",
1358        typisprefered: false,
1359        typisdefined: true,
1360        typrelid: 0,
1361        typsubscript: "array_subscript_handler",
1362        typelem: 3220,
1363        typarray: 0,
1364        typalign: "d",
1365        typstorage: "x",
1366        typbasetype: 0,
1367        typreceive: "array_recv",
1368        // TODO: Get from pg_proc
1369        typreceive_oid: 0,
1370    },
1371
1372    ANYENUM (3500) {
1373        typname: "anyenum",
1374        regtype: "anyenum",
1375        typnamespace: 11,
1376        typowner: 10,
1377        typlen: 4,
1378        typbyval: true,
1379        typtype: "p",
1380        typcategory: "P",
1381        typisprefered: false,
1382        typisdefined: true,
1383        typrelid: 0,
1384        typsubscript: "-",
1385        typelem: 0,
1386        typarray: 0,
1387        typalign: "i",
1388        typstorage: "p",
1389        typbasetype: 0,
1390        typreceive: "-",
1391        // TODO: Get from pg_proc
1392        typreceive_oid: 0,
1393    },
1394
1395    ANYRANGE (3831) {
1396        typname: "anyrange",
1397        regtype: "anyrange",
1398        typnamespace: 11,
1399        typowner: 10,
1400        typlen: -1,
1401        typbyval: false,
1402        typtype: "p",
1403        typcategory: "P",
1404        typisprefered: false,
1405        typisdefined: true,
1406        typrelid: 0,
1407        typsubscript: "-",
1408        typelem: 0,
1409        typarray: 0,
1410        typalign: "d",
1411        typstorage: "x",
1412        typbasetype: 0,
1413        typreceive: "-",
1414        // TODO: Get from pg_proc
1415        typreceive_oid: 0,
1416    },
1417
1418    INT4RANGE (3904) {
1419        typname: "int4range",
1420        regtype: "int4range",
1421        typnamespace: 11,
1422        typowner: 10,
1423        typlen: -1,
1424        typbyval: false,
1425        typtype: "r",
1426        typcategory: "R",
1427        typisprefered: false,
1428        typisdefined: true,
1429        typrelid: 0,
1430        typsubscript: "-",
1431        typelem: 0,
1432        typarray: 3905,
1433        typalign: "i",
1434        typstorage: "x",
1435        typbasetype: 0,
1436        typreceive: "range_recv",
1437        // TODO: Get from pg_proc
1438        typreceive_oid: 0,
1439    },
1440
1441    ARRAYINT4RANGE (3905) {
1442        typname: "_int4range",
1443        regtype: "int4range[]",
1444        typnamespace: 11,
1445        typowner: 10,
1446        typlen: -1,
1447        typbyval: false,
1448        typtype: "b",
1449        typcategory: "A",
1450        typisprefered: false,
1451        typisdefined: true,
1452        typrelid: 0,
1453        typsubscript: "array_subscript_handler",
1454        typelem: 3904,
1455        typarray: 0,
1456        typalign: "i",
1457        typstorage: "x",
1458        typbasetype: 0,
1459        typreceive: "array_recv",
1460        // TODO: Get from pg_proc
1461        typreceive_oid: 0,
1462    },
1463
1464    NUMRANGE (3906) {
1465        typname: "numrange",
1466        regtype: "numrange",
1467        typnamespace: 11,
1468        typowner: 10,
1469        typlen: -1,
1470        typbyval: false,
1471        typtype: "r",
1472        typcategory: "R",
1473        typisprefered: false,
1474        typisdefined: true,
1475        typrelid: 0,
1476        typsubscript: "-",
1477        typelem: 0,
1478        typarray: 3907,
1479        typalign: "i",
1480        typstorage: "x",
1481        typbasetype: 0,
1482        typreceive: "range_recv",
1483        // TODO: Get from pg_proc
1484        typreceive_oid: 0,
1485    },
1486
1487    ARRAYNUMRANGE (3907) {
1488        typname: "_numrange",
1489        regtype: "numrange[]",
1490        typnamespace: 11,
1491        typowner: 10,
1492        typlen: -1,
1493        typbyval: false,
1494        typtype: "b",
1495        typcategory: "A",
1496        typisprefered: false,
1497        typisdefined: true,
1498        typrelid: 0,
1499        typsubscript: "array_subscript_handler",
1500        typelem: 3906,
1501        typarray: 0,
1502        typalign: "i",
1503        typstorage: "x",
1504        typbasetype: 0,
1505        typreceive: "array_recv",
1506        // TODO: Get from pg_proc
1507        typreceive_oid: 0,
1508    },
1509
1510    TSRANGE (3908) {
1511        typname: "tsrange",
1512        regtype: "tsrange",
1513        typnamespace: 11,
1514        typowner: 10,
1515        typlen: -1,
1516        typbyval: false,
1517        typtype: "r",
1518        typcategory: "R",
1519        typisprefered: false,
1520        typisdefined: true,
1521        typrelid: 0,
1522        typsubscript: "-",
1523        typelem: 0,
1524        typarray: 3909,
1525        typalign: "d",
1526        typstorage: "x",
1527        typbasetype: 0,
1528        typreceive: "range_recv",
1529        // TODO: Get from pg_proc
1530        typreceive_oid: 0,
1531    },
1532
1533    ARRAYTSRANGE (3909) {
1534        typname: "_tsrange",
1535        regtype: "tsrange[]",
1536        typnamespace: 11,
1537        typowner: 10,
1538        typlen: -1,
1539        typbyval: false,
1540        typtype: "b",
1541        typcategory: "A",
1542        typisprefered: false,
1543        typisdefined: true,
1544        typrelid: 0,
1545        typsubscript: "array_subscript_handler",
1546        typelem: 3908,
1547        typarray: 0,
1548        typalign: "d",
1549        typstorage: "x",
1550        typbasetype: 0,
1551        typreceive: "array_recv",
1552        // TODO: Get from pg_proc
1553        typreceive_oid: 0,
1554    },
1555
1556    TSTZRANGE (3910) {
1557        typname: "tstzrange",
1558        regtype: "tstzrange",
1559        typnamespace: 11,
1560        typowner: 10,
1561        typlen: -1,
1562        typbyval: false,
1563        typtype: "r",
1564        typcategory: "R",
1565        typisprefered: false,
1566        typisdefined: true,
1567        typrelid: 0,
1568        typsubscript: "-",
1569        typelem: 0,
1570        typarray: 3911,
1571        typalign: "d",
1572        typstorage: "x",
1573        typbasetype: 0,
1574        typreceive: "range_recv",
1575        // TODO: Get from pg_proc
1576        typreceive_oid: 0,
1577    },
1578
1579    ARRAYTSTZRANGE (3911) {
1580        typname: "_tstzrange",
1581        regtype: "tstzrange[]",
1582        typnamespace: 11,
1583        typowner: 10,
1584        typlen: -1,
1585        typbyval: false,
1586        typtype: "b",
1587        typcategory: "A",
1588        typisprefered: false,
1589        typisdefined: true,
1590        typrelid: 0,
1591        typsubscript: "array_subscript_handler",
1592        typelem: 3910,
1593        typarray: 0,
1594        typalign: "d",
1595        typstorage: "x",
1596        typbasetype: 0,
1597        typreceive: "array_recv",
1598        // TODO: Get from pg_proc
1599        typreceive_oid: 0,
1600    },
1601
1602    DATERANGE (3912) {
1603        typname: "daterange",
1604        regtype: "daterange",
1605        typnamespace: 11,
1606        typowner: 10,
1607        typlen: -1,
1608        typbyval: false,
1609        typtype: "r",
1610        typcategory: "R",
1611        typisprefered: false,
1612        typisdefined: true,
1613        typrelid: 0,
1614        typsubscript: "-",
1615        typelem: 0,
1616        typarray: 3913,
1617        typalign: "i",
1618        typstorage: "x",
1619        typbasetype: 0,
1620        typreceive: "range_recv",
1621        // TODO: Get from pg_proc
1622        typreceive_oid: 0,
1623    },
1624
1625    ARRAYDATERANGE (3913) {
1626        typname: "_daterange",
1627        regtype: "daterange[]",
1628        typnamespace: 11,
1629        typowner: 10,
1630        typlen: -1,
1631        typbyval: false,
1632        typtype: "b",
1633        typcategory: "A",
1634        typisprefered: false,
1635        typisdefined: true,
1636        typrelid: 0,
1637        typsubscript: "array_subscript_handler",
1638        typelem: 3912,
1639        typarray: 0,
1640        typalign: "i",
1641        typstorage: "x",
1642        typbasetype: 0,
1643        typreceive: "array_recv",
1644        // TODO: Get from pg_proc
1645        typreceive_oid: 0,
1646    },
1647
1648    INT8RANGE (3926) {
1649        typname: "int8range",
1650        regtype: "int8range",
1651        typnamespace: 11,
1652        typowner: 10,
1653        typlen: -1,
1654        typbyval: false,
1655        typtype: "r",
1656        typcategory: "R",
1657        typisprefered: false,
1658        typisdefined: true,
1659        typrelid: 0,
1660        typsubscript: "-",
1661        typelem: 0,
1662        typarray: 3927,
1663        typalign: "d",
1664        typstorage: "x",
1665        typbasetype: 0,
1666        typreceive: "range_recv",
1667        // TODO: Get from pg_proc
1668        typreceive_oid: 0,
1669    },
1670
1671    ARRAYINT8RANGE (3927) {
1672        typname: "_int8range",
1673        regtype: "int8range[]",
1674        typnamespace: 11,
1675        typowner: 10,
1676        typlen: -1,
1677        typbyval: false,
1678        typtype: "b",
1679        typcategory: "A",
1680        typisprefered: false,
1681        typisdefined: true,
1682        typrelid: 0,
1683        typsubscript: "array_subscript_handler",
1684        typelem: 3926,
1685        typarray: 0,
1686        typalign: "d",
1687        typstorage: "x",
1688        typbasetype: 0,
1689        typreceive: "array_recv",
1690        // TODO: Get from pg_proc
1691        typreceive_oid: 0,
1692    },
1693
1694    INT4MULTIRANGE (4451) {
1695        typname: "int4multirange",
1696        regtype: "int4multirange",
1697        typnamespace: 11,
1698        typowner: 10,
1699        typlen: -1,
1700        typbyval: false,
1701        typtype: "r",
1702        typcategory: "R",
1703        typisprefered: false,
1704        typisdefined: true,
1705        typrelid: 0,
1706        typsubscript: "-",
1707        typelem: 0,
1708        typarray: 6150,
1709        typalign: "i",
1710        typstorage: "x",
1711        typbasetype: 0,
1712        typreceive: "multirange_recv",
1713        // TODO: Get from pg_proc
1714        typreceive_oid: 0,
1715    },
1716
1717    NUMMULTIRANGE (4532) {
1718        typname: "nummultirange",
1719        regtype: "nummultirange",
1720        typnamespace: 11,
1721        typowner: 10,
1722        typlen: -1,
1723        typbyval: false,
1724        typtype: "m",
1725        typcategory: "R",
1726        typisprefered: false,
1727        typisdefined: true,
1728        typrelid: 0,
1729        typsubscript: "-",
1730        typelem: 0,
1731        typarray: 6151,
1732        typalign: "i",
1733        typstorage: "x",
1734        typbasetype: 0,
1735        typreceive: "multirange_recv",
1736        // TODO: Get from pg_proc
1737        typreceive_oid: 0,
1738    },
1739
1740    TSMULTIRANGE (4533) {
1741        typname: "tsmultirange",
1742        regtype: "tsmultirange",
1743        typnamespace: 11,
1744        typowner: 10,
1745        typlen: -1,
1746        typbyval: false,
1747        typtype: "m",
1748        typcategory: "R",
1749        typisprefered: false,
1750        typisdefined: true,
1751        typrelid: 0,
1752        typsubscript: "-",
1753        typelem: 0,
1754        typarray: 6152,
1755        typalign: "d",
1756        typstorage: "x",
1757        typbasetype: 0,
1758        typreceive: "multirange_recv",
1759        // TODO: Get from pg_proc
1760        typreceive_oid: 0,
1761    },
1762
1763    DATEMULTIRANGE (4535) {
1764        typname: "datemultirange",
1765        regtype: "datemultirange",
1766        typnamespace: 11,
1767        typowner: 10,
1768        typlen: -1,
1769        typbyval: false,
1770        typtype: "m",
1771        typcategory: "R",
1772        typisprefered: false,
1773        typisdefined: true,
1774        typrelid: 0,
1775        typsubscript: "-",
1776        typelem: 0,
1777        typarray: 6155,
1778        typalign: "i",
1779        typstorage: "x",
1780        typbasetype: 0,
1781        typreceive: "multirange_recv",
1782        // TODO: Get from pg_proc
1783        typreceive_oid: 0,
1784    },
1785
1786    INT8MULTIRANGE (4536) {
1787        typname: "int8multirange",
1788        regtype: "int8multirange",
1789        typnamespace: 11,
1790        typowner: 10,
1791        typlen: -1,
1792        typbyval: false,
1793        typtype: "m",
1794        typcategory: "R",
1795        typisprefered: false,
1796        typisdefined: true,
1797        typrelid: 0,
1798        typsubscript: "-",
1799        typelem: 0,
1800        typarray: 6157,
1801        typalign: "d",
1802        typstorage: "x",
1803        typbasetype: 0,
1804        typreceive: "multirange_recv",
1805        // TODO: Get from pg_proc
1806        typreceive_oid: 0,
1807    },
1808
1809    ARRAYINT4MULTIRANGE (6150) {
1810        typname: "_int4multirange",
1811        regtype: "int4multirange[]",
1812        typnamespace: 11,
1813        typowner: 10,
1814        typlen: -1,
1815        typbyval: false,
1816        typtype: "b",
1817        typcategory: "A",
1818        typisprefered: false,
1819        typisdefined: true,
1820        typrelid: 0,
1821        typsubscript: "array_subscript_handler",
1822        typelem: 4451,
1823        typarray: 0,
1824        typalign: "i",
1825        typstorage: "x",
1826        typbasetype: 0,
1827        typreceive: "array_recv",
1828        // TODO: Get from pg_proc
1829        typreceive_oid: 0,
1830    },
1831
1832    ARRAYNUMMULTIRANGE (6151) {
1833        typname: "_nummultirange",
1834        regtype: "nummultirange[]",
1835        typnamespace: 11,
1836        typowner: 10,
1837        typlen: -1,
1838        typbyval: false,
1839        typtype: "b",
1840        typcategory: "A",
1841        typisprefered: false,
1842        typisdefined: true,
1843        typrelid: 0,
1844        typsubscript: "array_subscript_handler",
1845        typelem: 4532,
1846        typarray: 0,
1847        typalign: "i",
1848        typstorage: "x",
1849        typbasetype: 0,
1850        typreceive: "array_recv",
1851        // TODO: Get from pg_proc
1852        typreceive_oid: 0,
1853    },
1854
1855    ARRAYTSMULTIRANGE (6152) {
1856        typname: "_tsmultirange",
1857        regtype: "tsmultirange[]",
1858        typnamespace: 11,
1859        typowner: 10,
1860        typlen: -1,
1861        typbyval: false,
1862        typtype: "b",
1863        typcategory: "A",
1864        typisprefered: false,
1865        typisdefined: true,
1866        typrelid: 0,
1867        typsubscript: "array_subscript_handler",
1868        typelem: 4533,
1869        typarray: 0,
1870        typalign: "d",
1871        typstorage: "x",
1872        typbasetype: 0,
1873        typreceive: "array_recv",
1874        // TODO: Get from pg_proc
1875        typreceive_oid: 0,
1876    },
1877
1878    ARRAYDATEMULTIRANGE (6155) {
1879        typname: "_datemultirange",
1880        regtype: "datemultirange[]",
1881        typnamespace: 11,
1882        typowner: 10,
1883        typlen: -1,
1884        typbyval: false,
1885        typtype: "b",
1886        typcategory: "A",
1887        typisprefered: false,
1888        typisdefined: true,
1889        typrelid: 0,
1890        typsubscript: "array_subscript_handler",
1891        typelem: 4535,
1892        typarray: 0,
1893        typalign: "i",
1894        typstorage: "x",
1895        typbasetype: 0,
1896        typreceive: "array_recv",
1897        // TODO: Get from pg_proc
1898        typreceive_oid: 0,
1899    },
1900
1901    ARRAYINT8MULTIRANGE (6157) {
1902        typname: "_int8multirange",
1903        regtype: "int8multirange[]",
1904        typnamespace: 11,
1905        typowner: 10,
1906        typlen: -1,
1907        typbyval: false,
1908        typtype: "b",
1909        typcategory: "A",
1910        typisprefered: false,
1911        typisdefined: true,
1912        typrelid: 0,
1913        typsubscript: "array_subscript_handler",
1914        typelem: 4536,
1915        typarray: 0,
1916        typalign: "d",
1917        typstorage: "x",
1918        typbasetype: 0,
1919        typreceive: "array_recv",
1920        // TODO: Get from pg_proc
1921        typreceive_oid: 0,
1922    },
1923
1924    ARRAYPGAM (10014) {
1925        typname: "_pg_am",
1926        regtype: "pg_am[]",
1927        typnamespace: 11,
1928        typowner: 10,
1929        typlen: -1,
1930        typbyval: false,
1931        typtype: "b",
1932        typcategory: "A",
1933        typisprefered: false,
1934        typisdefined: true,
1935        typrelid: 0,
1936        typsubscript: "array_subscript_handler",
1937        typelem: 10015,
1938        typarray: 0,
1939        typalign: "d",
1940        typstorage: "x",
1941        typbasetype: 0,
1942        typreceive: "array_recv",
1943        // TODO: Get from pg_proc
1944        typreceive_oid: 0,
1945    },
1946
1947    PGAM (10015) {
1948        typname: "pg_am",
1949        regtype: "pg_am",
1950        typnamespace: 11,
1951        typowner: 10,
1952        typlen: -1,
1953        typbyval: false,
1954        typtype: "c",
1955        typcategory: "C",
1956        typisprefered: false,
1957        typisdefined: true,
1958        typrelid: 2601,
1959        typsubscript: "-",
1960        typelem: 0,
1961        typarray: 10014,
1962        typalign: "d",
1963        typstorage: "x",
1964        typbasetype: 0,
1965        typreceive: "record_recv",
1966        // TODO: Get from pg_proc
1967        typreceive_oid: 0,
1968    },
1969
1970    ARRAYPGLANGUAGE (10020) {
1971        typname: "_pg_language",
1972        regtype: "pg_language[]",
1973        typnamespace: 11,
1974        typowner: 10,
1975        typlen: -1,
1976        typbyval: false,
1977        typtype: "b",
1978        typcategory: "A",
1979        typisprefered: false,
1980        typisdefined: true,
1981        typrelid: 0,
1982        typsubscript: "array_subscript_handler",
1983        typelem: 10021,
1984        typarray: 0,
1985        typalign: "d",
1986        typstorage: "x",
1987        typbasetype: 0,
1988        typreceive: "array_recv",
1989        // TODO: Get from pg_proc
1990        typreceive_oid: 0,
1991    },
1992
1993    PGLANGUAGE (10021) {
1994        typname: "pg_language",
1995        regtype: "pg_language",
1996        typnamespace: 11,
1997        typowner: 10,
1998        typlen: -1,
1999        typbyval: false,
2000        typtype: "c",
2001        typcategory: "C",
2002        typisprefered: false,
2003        typisdefined: true,
2004        typrelid: 2612,
2005        typsubscript: "-",
2006        typelem: 0,
2007        typarray: 10020,
2008        typalign: "d",
2009        typstorage: "x",
2010        typbasetype: 0,
2011        typreceive: "record_recv",
2012        // TODO: Get from pg_proc
2013        typreceive_oid: 0,
2014    },
2015
2016    ARRAYPGEVENTTRIGGER (10038) {
2017        typname: "_pg_event_trigger",
2018        regtype: "pg_event_trigger[]",
2019        typnamespace: 11,
2020        typowner: 10,
2021        typlen: -1,
2022        typbyval: false,
2023        typtype: "b",
2024        typcategory: "A",
2025        typisprefered: false,
2026        typisdefined: true,
2027        typrelid: 0,
2028        typsubscript: "array_subscript_handler",
2029        typelem: 10039,
2030        typarray: 0,
2031        typalign: "d",
2032        typstorage: "x",
2033        typbasetype: 0,
2034        typreceive: "array_recv",
2035        // TODO: Get from pg_proc
2036        typreceive_oid: 0,
2037    },
2038
2039    PGEVENTTRIGGER (10039) {
2040        typname: "pg_event_trigger",
2041        regtype: "pg_event_trigger",
2042        typnamespace: 11,
2043        typowner: 10,
2044        typlen: -1,
2045        typbyval: false,
2046        typtype: "c",
2047        typcategory: "C",
2048        typisprefered: false,
2049        typisdefined: true,
2050        typrelid: 3466,
2051        typsubscript: "-",
2052        typelem: 0,
2053        typarray: 10038,
2054        typalign: "d",
2055        typstorage: "x",
2056        typbasetype: 0,
2057        typreceive: "record_recv",
2058        // TODO: Get from pg_proc
2059        typreceive_oid: 0,
2060    },
2061
2062    ARRAYPGCAST (10042) {
2063        typname: "_pg_cast",
2064        regtype: "pg_cast[]",
2065        typnamespace: 11,
2066        typowner: 10,
2067        typlen: -1,
2068        typbyval: false,
2069        typtype: "b",
2070        typcategory: "A",
2071        typisprefered: false,
2072        typisdefined: true,
2073        typrelid: 0,
2074        typsubscript: "array_subscript_handler",
2075        typelem: 10043,
2076        typarray: 0,
2077        typalign: "d",
2078        typstorage: "x",
2079        typbasetype: 0,
2080        typreceive: "array_recv",
2081        // TODO: Get from pg_proc
2082        typreceive_oid: 0,
2083    },
2084
2085    PGCAST (10043) {
2086        typname: "pg_cast",
2087        regtype: "pg_cast",
2088        typnamespace: 11,
2089        typowner: 10,
2090        typlen: -1,
2091        typbyval: false,
2092        typtype: "c",
2093        typcategory: "C",
2094        typisprefered: false,
2095        typisdefined: true,
2096        typrelid: 2605,
2097        typsubscript: "-",
2098        typelem: 0,
2099        typarray: 10042,
2100        typalign: "d",
2101        typstorage: "x",
2102        typbasetype: 0,
2103        typreceive: "record_recv",
2104        // TODO: Get from pg_proc
2105        typreceive_oid: 0,
2106    },
2107
2108    ARRAYPGEXTENSION (10073) {
2109        typname: "_pg_extension",
2110        regtype: "pg_extension[]",
2111        typnamespace: 11,
2112        typowner: 10,
2113        typlen: -1,
2114        typbyval: false,
2115        typtype: "b",
2116        typcategory: "A",
2117        typisprefered: false,
2118        typisdefined: true,
2119        typrelid: 0,
2120        typsubscript: "array_subscript_handler",
2121        typelem: 10074,
2122        typarray: 0,
2123        typalign: "d",
2124        typstorage: "x",
2125        typbasetype: 0,
2126        typreceive: "array_recv",
2127        // TODO: Get from pg_proc
2128        typreceive_oid: 0,
2129    },
2130
2131    PGEXTENSION (10074) {
2132        typname: "pg_extension",
2133        regtype: "pg_extension",
2134        typnamespace: 11,
2135        typowner: 10,
2136        typlen: -1,
2137        typbyval: false,
2138        typtype: "c",
2139        typcategory: "C",
2140        typisprefered: false,
2141        typisdefined: true,
2142        typrelid: 3079,
2143        typsubscript: "-",
2144        typelem: 0,
2145        typarray: 10073,
2146        typalign: "d",
2147        typstorage: "x",
2148        typbasetype: 0,
2149        typreceive: "record_recv",
2150        // TODO: Get from pg_proc
2151        typreceive_oid: 0,
2152    },
2153
2154    ARRAYPGFOREIGNDATAWRAPPER (10075) {
2155        typname: "_pg_foreign_data_wrapper",
2156        regtype: "pg_foreign_data_wrapper[]",
2157        typnamespace: 11,
2158        typowner: 10,
2159        typlen: -1,
2160        typbyval: false,
2161        typtype: "b",
2162        typcategory: "A",
2163        typisprefered: false,
2164        typisdefined: true,
2165        typrelid: 0,
2166        typsubscript: "array_subscript_handler",
2167        typelem: 10076,
2168        typarray: 0,
2169        typalign: "d",
2170        typstorage: "x",
2171        typbasetype: 0,
2172        typreceive: "array_recv",
2173        // TODO: Get from pg_proc
2174        typreceive_oid: 0,
2175    },
2176
2177    PGFOREIGNDATAWRAPPER (10076) {
2178        typname: "pg_foreign_data_wrapper",
2179        regtype: "pg_foreign_data_wrapper",
2180        typnamespace: 11,
2181        typowner: 10,
2182        typlen: -1,
2183        typbyval: false,
2184        typtype: "c",
2185        typcategory: "C",
2186        typisprefered: false,
2187        typisdefined: true,
2188        typrelid: 2328,
2189        typsubscript: "-",
2190        typelem: 0,
2191        typarray: 10075,
2192        typalign: "d",
2193        typstorage: "x",
2194        typbasetype: 0,
2195        typreceive: "record_recv",
2196        // TODO: Get from pg_proc
2197        typreceive_oid: 0,
2198    },
2199
2200    ARRAYPGFOREIGNSERVER (10077) {
2201        typname: "_pg_foreign_server",
2202        regtype: "pg_foreign_server[]",
2203        typnamespace: 11,
2204        typowner: 10,
2205        typlen: -1,
2206        typbyval: false,
2207        typtype: "b",
2208        typcategory: "A",
2209        typisprefered: false,
2210        typisdefined: true,
2211        typrelid: 0,
2212        typsubscript: "array_subscript_handler",
2213        typelem: 10078,
2214        typarray: 0,
2215        typalign: "d",
2216        typstorage: "x",
2217        typbasetype: 0,
2218        typreceive: "array_recv",
2219        // TODO: Get from pg_proc
2220        typreceive_oid: 0,
2221    },
2222
2223    PGFOREIGNSERVER (10078) {
2224        typname: "pg_foreign_server",
2225        regtype: "pg_foreign_server",
2226        typnamespace: 11,
2227        typowner: 10,
2228        typlen: -1,
2229        typbyval: false,
2230        typtype: "c",
2231        typcategory: "C",
2232        typisprefered: false,
2233        typisdefined: true,
2234        typrelid: 1417,
2235        typsubscript: "-",
2236        typelem: 0,
2237        typarray: 10077,
2238        typalign: "d",
2239        typstorage: "x",
2240        typbasetype: 0,
2241        typreceive: "record_recv",
2242        // TODO: Get from pg_proc
2243        typreceive_oid: 0,
2244    },
2245
2246    ARRAYPGCONSTRAINT (12002) {
2247        typname: "_pg_constraint",
2248        regtype: "pg_constraint[]",
2249        typnamespace: 11,
2250        typowner: 10,
2251        typlen: -1,
2252        typbyval: false,
2253        typtype: "b",
2254        typcategory: "A",
2255        typisprefered: false,
2256        typisdefined: true,
2257        typrelid: 0,
2258        typsubscript: "array_subscript_handler",
2259        typelem: 12003,
2260        typarray: 0,
2261        typalign: "d",
2262        typstorage: "x",
2263        typbasetype: 0,
2264        typreceive: "array_recv",
2265        // TODO: Get from pg_proc
2266        typreceive_oid: 0,
2267    },
2268
2269    PGCONSTRAINT (12003) {
2270        typname: "pg_constraint",
2271        regtype: "pg_constraint",
2272        typnamespace: 11,
2273        typowner: 10,
2274        typlen: -1,
2275        typbyval: false,
2276        typtype: "c",
2277        typcategory: "C",
2278        typisprefered: false,
2279        typisdefined: true,
2280        typrelid: 2606,
2281        typsubscript: "-",
2282        typelem: 0,
2283        typarray: 12002,
2284        typalign: "d",
2285        typstorage: "x",
2286        typbasetype: 0,
2287        typreceive: "record_recv",
2288        // TODO: Get from pg_proc
2289        typreceive_oid: 0,
2290    },
2291
2292    ARRAYPGNAMESPACE (12046) {
2293        typname: "_pg_namespace",
2294        regtype: "pg_namespace[]",
2295        typnamespace: 11,
2296        typowner: 10,
2297        typlen: -1,
2298        typbyval: false,
2299        typtype: "b",
2300        typcategory: "A",
2301        typisprefered: false,
2302        typisdefined: true,
2303        typrelid: 0,
2304        typsubscript: "array_subscript_handler",
2305        typelem: 12047,
2306        typarray: 0,
2307        typalign: "d",
2308        typstorage: "x",
2309        typbasetype: 0,
2310        typreceive: "array_recv",
2311        // TODO: Get from pg_proc
2312        typreceive_oid: 0,
2313    },
2314
2315    PGNAMESPACE (12047) {
2316        typname: "pg_namespace",
2317        regtype: "pg_namespace",
2318        typnamespace: 11,
2319        typowner: 10,
2320        typlen: -1,
2321        typbyval: false,
2322        typtype: "c",
2323        typcategory: "C",
2324        typisprefered: false,
2325        typisdefined: true,
2326        typrelid: 2615,
2327        typsubscript: "-",
2328        typelem: 0,
2329        typarray: 12046,
2330        typalign: "d",
2331        typstorage: "x",
2332        typbasetype: 0,
2333        typreceive: "record_recv",
2334        // TODO: Get from pg_proc
2335        typreceive_oid: 0,
2336    },
2337
2338    CHARACTERDATA (13408) {
2339        typname: "character_data",
2340        regtype: "information_schema.character_data",
2341        typnamespace: 13000,
2342        typowner: 10,
2343        typlen: -1,
2344        typbyval: false,
2345        typtype: "d",
2346        typcategory: "S",
2347        typisprefered: false,
2348        typisdefined: true,
2349        typrelid: 0,
2350        typsubscript: "-",
2351        typelem: 0,
2352        typarray: 0,
2353        typalign: "i",
2354        typstorage: "x",
2355        typbasetype: 1043,
2356        typreceive: "domain_recv",
2357        // TODO: Get from pg_proc
2358        typreceive_oid: 0,
2359    },
2360
2361    SQLIDENTIFIER (13410) {
2362        typname: "sql_identifier",
2363        regtype: "information_schema.sql_identifier",
2364        typnamespace: 13000,
2365        typowner: 10,
2366        typlen: 64,
2367        typbyval: false,
2368        typtype: "d",
2369        typcategory: "S",
2370        typisprefered: false,
2371        typisdefined: true,
2372        typrelid: 0,
2373        typsubscript: "-",
2374        typelem: 0,
2375        typarray: 0,
2376        typalign: "c",
2377        typstorage: "p",
2378        typbasetype: 19,
2379        typreceive: "domain_recv",
2380        // TODO: Get from pg_proc
2381        typreceive_oid: 0,
2382    },
2383];
2384
2385impl PgTypeId {
2386    pub const fn to_type(self) -> &'static PgType<'static> {
2387        PgType::get_by_tid(self)
2388    }
2389}