06.09.2014 Views

Bases de datos: Software libre - Universitat Oberta de Catalunya

Bases de datos: Software libre - Universitat Oberta de Catalunya

Bases de datos: Software libre - Universitat Oberta de Catalunya

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

© FUOC • 71Z799014MO <strong>Bases</strong> <strong>de</strong> <strong>datos</strong> en PostgreSQL<br />

Índice<br />

Introducción .............................................................................................. 5<br />

Objetivos ..................................................................................................... 6<br />

1. Características <strong>de</strong> PostgreSQL .......................................................... 7<br />

1.1. Breve historia .................................................................................... 7<br />

1.2. Prestaciones ...................................................................................... 7<br />

1.3. Limitaciones ..................................................................................... 8<br />

2. Introducción a la orientación a objetos ....................................... 9<br />

2.1. El mo<strong>de</strong>lo orientado a objetos .......................................................... 9<br />

2.2. Objetos: clase frente a instancia ....................................................... 10<br />

2.3. Propieda<strong>de</strong>s: atributo frente a operación ......................................... 11<br />

2.4. Encapsulamiento: implementación frente a interfaz ....................... 11<br />

2.4.1. Atributo frente a variable <strong>de</strong> instancia ................................... 13<br />

2.5. Herencia: jerarquía <strong>de</strong> clases ............................................................ 14<br />

2.5.1. Tipo y clase ............................................................................. 17<br />

2.6. Agregación: jerarquía <strong>de</strong> objetos ...................................................... 17<br />

2.7. Persistencia ....................................................................................... 18<br />

2.8. PostgreSQL y la orientación a objetos .............................................. 18<br />

3. Acceso a un servidor PostgreSQL .................................................... 20<br />

3.1. La conexión con el servidor ............................................................. 20<br />

3.2. El cliente psql .................................................................................... 20<br />

3.3. Introducción <strong>de</strong> sentencias .............................................................. 21<br />

3.3.1. Expresiones y variables .......................................................... 22<br />

3.4. Proceso por lotes y formatos <strong>de</strong> salida ............................................. 23<br />

3.5. Usar bases <strong>de</strong> <strong>datos</strong> ........................................................................... 27<br />

4. Creación y manipulación <strong>de</strong> tablas ................................................ 29<br />

4.1. Creación <strong>de</strong> tablas ............................................................................ 29<br />

4.2. Herencia ............................................................................................ 32<br />

4.3. Herencia y OID ................................................................................. 34<br />

4.4. Restricciones ..................................................................................... 37<br />

4.4.1. Restricciones <strong>de</strong> tabla ............................................................. 40<br />

4.5. In<strong>de</strong>xación ........................................................................................ 42<br />

4.6. Consulta <strong>de</strong> información <strong>de</strong> bases <strong>de</strong> <strong>datos</strong> y tablas ........................ 42<br />

4.7. Tipos <strong>de</strong> <strong>datos</strong> ................................................................................... 44<br />

4.7.1. Tipos lógicos ........................................................................... 44<br />

4.7.2. Tipos numéricos ..................................................................... 44<br />

4.7.3. Operadores numéricos ........................................................... 45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!