CREATE PROCEDURAL LANGUAGE plpgsql; ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;
segunda-feira, 31 de outubro de 2011
PostgreSql - Criando a liguagem procedural plpgsql no pgAdmin III
PostgreSql - Função para validar estado (UF) brasileiro
CREATE OR REPLACE FUNCTION public.is_valid_uf(p_uf varchar) RETURNS boolean AS
$BODY$
BEGIN
RETURN upper(p_uf) = ANY (string_to_array('AC,AL,AM,AP,BA,CE,DF,ES,GO,MA,MG,MS,MT,PA,PB,PE,PI,PR,RJ,RN,RO,RR,RS,SC,SE,SP,TO', ','));
END;
$BODY$
LANGUAGE 'plpgsql';
quinta-feira, 27 de outubro de 2011
PostgreSQL - Capturando elementos das tabelas
Segue abaixo o SQL para capturar Comentário da Tabela, Nome dos Campos, Comentários dos Campos, Tipos dos Campos, Número máximo de caracteres nos campos e se o campo é "nulável" ou não:
SELECT
d.nspname as schema_name,
c.relname as table_name,
COALESCE(pg_catalog.obj_description(c.oid), '') AS table_comment,
a.attname AS column_name,
t.typname AS column_data_type,
a.attlen AS column_max_len,
COALESCE(pg_catalog.col_description(c.oid, a.attnum), '') AS colunm_comment,
a.attnotnull AS column_notnull
FROM
pg_class c
LEFT JOIN pg_attribute a ON (a.attrelid = c.oid)
LEFT JOIN pg_type t ON (a.atttypid = t.oid)
LEFT JOIN pg_namespace d ON d.oid = c.relnamespace
WHERE
d.nspname = 'nome_do_esquema'
AND
a.attnum > 0
ORDER BY
c.relname, a.attnum;
SELECT
d.nspname as schema_name,
c.relname as table_name,
COALESCE(pg_catalog.obj_description(c.oid), '') AS table_comment,
a.attname AS column_name,
t.typname AS column_data_type,
a.attlen AS column_max_len,
COALESCE(pg_catalog.col_description(c.oid, a.attnum), '') AS colunm_comment,
a.attnotnull AS column_notnull
FROM
pg_class c
LEFT JOIN pg_attribute a ON (a.attrelid = c.oid)
LEFT JOIN pg_type t ON (a.atttypid = t.oid)
LEFT JOIN pg_namespace d ON d.oid = c.relnamespace
WHERE
d.nspname = 'nome_do_esquema'
AND
a.attnum > 0
ORDER BY
c.relname, a.attnum;
quarta-feira, 26 de outubro de 2011
Como aumentar o HD Virtual do VirtualBox

http://www.my-guides.net/en/content/view/122/26/
sábado, 22 de outubro de 2011
Como alterar as fontes do Ubuntu 11
Segue o link para alterar as fontes do ubuntu 11, instalando o Advanced Settings:
http://www.installubuntulinux.com/2011/09/howto-change-system-font-sizes-in.html
http://www.installubuntulinux.com/2011/09/howto-change-system-font-sizes-in.html
Assinar:
Postagens (Atom)