PostgreSQL

Background
Texto da Wikipedia: http://en.wikipedia.org/wiki/Postgre

Site oficial: http://www.postgresql.org/

Links
http://gentoo-wiki.com/HOWTO_Configure_Postgresql

http://www.gentoo.org/doc/en/postgres-howto.xml

Configs
Logs

Links
http://sqlcourse.com/

http://www.troubleshooters.com/lpm/200301/200301.htm

http://www.webbasedprogramming.com/Teach-Yourself-SQL-in-21-Days-Second-Edition/

http://www.intermedia.net/support/sql/sqltut.asp

http://www.w3schools.com/sql/default.asp

Comandos �teis
Cria banco de dados $ createdb mydb

Acesso ao via psql $ psql temp

Criar tabela $ CREATE TABLE [tablename] (column1 [data type], column2 [data type], column3 [data type]);

[data type] pode ser: TEXT, DECIMAL, DATE??? o comando \dT fornece todos os tipos dispon�veis.

Inserir dados $ INSERT INTO [tablename] (column1,column2,column3) VALUES(value1,value2,value3);

Pegar dados $ SELECT column1,column2 FROM [tablename] [WHERE "condition"];

Alterar dados $ UPDATE [tablename] set columnX = 'bla', colimnY = columnY+1;

Deletar dados $ DELETE FROM [tablename]; (apaga todas as entradas) $ DELETE FROM [tablename] WHERE columnX='bla' or columny='nao bla';

Deletar tabela $ DROP TABLE [tablename];