Está en la página 1de 5

TIPOS DE DATOS EN POSTGRESQL

MATERIA: TALLER DE BASE DE DATOS. PROFA: MORALES HERNÁNDEZ MARICELA. GRUPO ISA.
INTEGRANTES: MARTÍNEZ LÓPEZ STEPHANIE ANAID Y PORRAS GREGORIO PRISCILA MATHILDA.
INSTITUTO TECNOLÓGICO DE OAXACA, TECNOLÓGICO NACIONAL DE MÉXICO.

10 DE SEPTIEMBRE DE 2018
TIPOS NUMÉRICOS:

TIPO DE DATO TAMAÑO DE DESCRIPCIÓN DOMINIO


ALMACENAMIENTO
smallint 2 bytes Rango-pequeño -32768 a +32767
integer
integer 4 bytes Elección típica para el -2147483648 a +2147483647
tipo integer
bigint 8 bytes Rango-largo integer -9223372036854775808 a
+9223372036854775807
decimal variable Precisión especificada- Arriba de 131072 digitos antes
usuario, exacta del punto decimal; arriba de
16383 dígitos después del
punto decimal.
numeric variable Precisión especificada- Arriba de 131072 digitos antes
usuario, exacta del punto decimal; arriba de
16383 dígitos después del
punto decimal.
real 4 bytes Variable-precisión, Precisión de 6 dígitos
inexacta decimales
double 8 bytes Variable-precisión, Precisión de 15 dígitos
precision inexacta decimales
smallserial 2 bytes Pequeño 1 a 32767
incrementador integer
serial 4 bytes Autoincrementador 1 a 2147483647
integer
bigserial 4 bytes Autoincrementador 1 a 9223372036854775807
integer

TIPOS NUMÉRICOS:

money 8 bytes Importe de la divisa -92233720368547758.08 a


+92233720368547758.07
TIPOS CARÁCTER

character Longitud variable con


varying (n), limite
varchar (n)
character (n), De longitud fija, blank
char (n) padded
text Variable, longitud ilimitada
char 1 byte Un byte de tipo interno
name 64 bytes Tipo interno para nombres
de objetos

TIPOS BINARIOS

bytea 1 o 4 bytes Longitud variable con


más el string límite
binario actual

TIPOS DATE

Nombre Tamaño de Descripción Valor bajo Máximo Resolución


almacenamiento valor
timestamp 8 bytes Ambos 4713 BC 294276 AD 1
[ (p) ] fecha y microsegundo
[ without tiempo (no / 14 dígitos
time zone ] zona
horaria)
timestamp 8 bytes Ambos 4713 BC 294276 AD 1
[ (p) ] with fecha y microsegundos
time zone tiempo con / 14 dígitos
zona horaria
date 4 bytes fecha (no 4713 BC 5874897 1 día
tiempo del AD
día)
time [ (p) ] 8 bytes Tiempo del 00:00:00 24:00:00 1
[ without día (no microsegundo
time zone ] fecha) / 14 dígitos
time [ (p) ] 12 bytes Tiempo del 00:00:00+1459 24:00:00- 1
with time día 1459 microsegundo
zone solamente, / 14 dígitos
con zona
horaria
interval [ 16 bytes Intervalo de -178000000 178000000 1
fields ] [ (p) tiempo años años microsegundo
] / 14 dígitos
TIPOS BOOLEANO

boolean 1 bytes Sentencia verdadera (true) true or false


o falsa (false)

TIPOS GEOMETRICOS

Nombr Tamaño de Descripción Representación


e almacenamiento
point 16 bytes Punto en un plano (x,y)
line 32 bytes Línea infinita {A,B,C}
lseg 32 bytes Segmento de línea finita ((x1,y1),(x2,y2))
box 32 bytes Caja rectangular ((x1,y1),(x2,y2))
path 16+16n bytes Camino cerrado (similar a un ((x1,y1),...)
polígono)
path 16+16n bytes Camino abierto [(x1,y1),...]
polygon 40+16n bytes Polígono (similar a un camino ((x1,y1),...)
cerrado)
circle 24 bytes Círculo <(x,y),r> (punto central y
radio)

TIPOS DE DIRECCIÓN DE RED

Nombre Tamaño de Descripción


almacenamiento
cidr 7 o 19 bytes Red IPv4 y IPv6
inet 7 o 19 bytes IPv4 y IPv6 hosts and redes
macaddr 6 bytes Direcciones MAC

TIPO BIT

Nombre Tamaño de Descripción DOMINIO


almacenamiento
bit (n) Exacto Este tipo debe coincidir con la longitud Strings de 1’s
n de manera exacta y 0’s
bit Variable Tiene una longitud variable hasta un
varying(n) máximo especificado por n.

JSON TIPOS PRIMITIVOS Y SU TIPO CORRESPONDIENTE EN POSTGRESQL

Tipo JSON Tipo Notas


primitive PostgreSQL
string text \u0000 is disallowed, as are non-ASCII Unicode escapes if
database encoding is not UTF8
number numeric NaN and infinity values are disallowed
boolean boolean Only lowercase true and false spellings are accepted
null (none) SQL NULL is a different concept

INFORMACIÓN EXTRA:

Bytea Literal Escaped Octets:

Valor octeto Descripción Representación Ejemplo Representación de


decimal Escape de salida
entrada
(Escaped Input)
0 Octeto cero E'\\000' SELECT E'\\ \000
000'::bytea;
39 Única cita '''' or E'\\047' SELECT '
E'\''::bytea;
92 backslash E'\\\\' or E'\\134' SELECT \\
E'\\\\'::bytea;
0 to 31 and Octetos no E'\\xxx' (octal SELECT E'\\ \001
127 to 255 imprimibles value) 001'::bytea;

Bytea Output Escaped Octets

Valor octeto Descripción Representación de Ejemplo Resultado de


decimal escape de salida salida
(Escaped Output )
92 backslash \\ SELECT E'\\ \\
134'::bytea;
0 to 31 and "non-printable" \xxx (octal value) SELECT E'\\ \001
127 to 255 octets 001'::bytea;
32 to 126 "printable" client character set SELECT E'\\ ~
octets representation 176'::bytea;

También podría gustarte