Tutorial by Examples

NameStorage SizeDescriptionRangesmallint2 bytessmall-range integer-32768 to +32767integer4 bytesypical choice for integer-2147483648 to +2147483647bigint8 byteslarge-range integer-9223372036854775808 to +9223372036854775807decimalvariableuser-specified precision, exactup to 131072 digits before the...
NameStorage SizeDescriptionLow ValueHigh ValueResolutiontimestamp (without time zone)8 bytesboth date and time (no time zone)4713 BC294276 AD1 microsecond / 14 digitstimestamp (with time zone)8 bytesboth date and time, with time zone4713 BC294276 AD1 microsecond / 14 digitsdate4 bytesdate (no time o...
NameStorage SizeDescriptionRepresentationpoint16 bytesPoint on a plane(x,y)line32 bytesInfinite line{A,B,C}lseg32 bytesFinite line segment((x1,y1),(x2,y2))box32 bytesRectangular box((x1,y1),(x2,y2))path16+16n bytesClosed path (similar to polygon)((x1,y1),...)path16+16n bytesOpen path[(x1,y1),...]pol...
NameStorage SizeDescriptioncidr7 or 19 bytesIPv4 and IPv6 networksinet7 or 19 bytesIPv4 and IPv6 hosts and networksmacaddr6 bytesMAC addresses
NameDescriptioncharacter varying(n), varchar(n)variable-length with limitcharacter(n), char(n)fixed-length, blank paddedtextvariable unlimited length
In PostgreSQL you can create Arrays of any built-in, user-defined or enum type. In default there is no limit to an Array, but you can specify it. Declaring an Array SELECT integer[]; SELECT integer[3]; SELECT integer[][]; SELECT integer[3][3]; SELECT integer ARRAY; SELECT integer ARRAY[3]; ...

Page 1 of 1