![]() Pseudo types are a collection of special entries for declaring a function's argument or result type: Nameįunction accepts any non-array data type.įunction accepts any enumerated data type.įunction accepts or return a null-terminated C string.įunction accepts or return server-internal data type.Ī foreign-data wrapper handler returns fdw_handler.įinds a function that returns an unspecified row type.Īfter reading this article, you should have a basic working knowledge of data types available in PostgreSQL. PostgreSQL uses object identifiers as primary key systems when performing specialized input and output operations: Name You can also create custom range types by using other data types as a basis. Range of times and dates with a time zone. Range of times and dates without a time zone. Range of user-specified precision decimals. Range data types use discreet or continuous ranges of other data types. Similar to array data types, you can also declare, search, and modify composite values. CompositeĬomposite data types allow you to use a row or record of a table as a data element. You can declare, modify, and search arrays as you would any other column in the database. The array data type lets you define a column of a table as a multidimensional array that can use any base, enumerated, or composite data type. ![]() Slower to insert into the database, but indexing support and lack of reprocessing make retrieval significantly faster. jsonb: Represents JSON data in a binary format.You can quickly insert it into the database, but it is relatively slow to retrieve due to reprocessing. This data type saves data exactly the way it is (including whitespace). json: An extension of the text data type with JSON validation.Use it only when you don't want the database to check if the input is well-formed. WELLFORMED: This option guarantees that or resolve to a well-formed XML document.PostgreSQL allows you to save XML data as an XML data type using the XMLPARSE function: XMLPARSE (DOCUMENT WELLFORMED) Geometric data types represent spatial objects rendered in two dimensions, such as points, lines, and polygons: Name Stores the keywords that need to be searched and combines them using Boolean operators (AND, OR, and NOT). ![]() Represents a document optimized for text search, with a list of distinct words normalized to merge different variants of the same word (lexemes). Text search data type allows you to search for the best match in a collection of natural-language documents: Name ![]() This includes saving storage space, specialized functions and commands, and easier error checking. Using network address data types has several advantages over using plain text. PostgreSQL uses network address data types to store IPv4, IPv6, and MAC addresses: Name It consists of several groups of four, eight, and twelve digits, separated by hyphens: Stores a bit string of a varying length, up to n characters.Ī UUID (Universally Unique Identifiers) is a set of 32 digits created by an algorithm. Stores a bit string with a fixed length of n characters. Unlike other data types, you can create enumerated types using the create type command: CREATE TYPE year AS ENUM ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec') Bit Stringīit string type stores strings of 1's and 0's, used to store or visualize bit masks: Name EnumeratedĮnumerated data types consist of a static, ordered set of values, such as numbers from 1 to 10 or months in the year. It can hold true (1), false (0), or unknown (null) values. BooleanĪ Boolean data type is declared using bool or boolean keywords. PostgreSQL can save variable-length binary strings as the bytea data type, taking 1 or 4 bytes plus the size of the actual binary string. Date is the only exception, with a resolution of one day, counted according to the Gregorian calendar: Name PostgreSQL Supports all the standard SQL date and time data types, with a resolution of 1 microsecond or 14 digits. Note: Using floating-point numbers with the monetary data type is not recommended due to the potential for rounding errors. This type stores up to 8 bytes of data with a range of -92233720368547758.08 to +92233720368547758.07 and use numeric, integer, and bigint data types as values. The monetary data type stores a numeric amount of money with fixed fractional precision. Up to 16383 digits after the decimal point Up to 131072 digits before the decimal point.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |