Pessoal muito obrigado pelas dicas e já tenho mais duvidas...
bom o bigint então seria mais rapido do que o char?

bom refiz a tabela e ficou assim:
se tiver algo a melhorar nela agradeço

CREATE TABLE func_ativos
(
  id_func_ativos serial NOT NULL,
  cpf bigint NOT NULL,
  registro numeric NOT NULL,
  CONSTRAINT func_ativos_pkey PRIMARY KEY (id_func_ativos, cpf, registro)
)
WITH (
  OIDS=FALSE,
  autovacuum_enabled=true
);


CREATE INDEX indice_cpf
  ON func_ativos
  USING btree
  (cpf);


outra:
SELECT sp_formataCPF(848327462,TRUE); -- resultado "008.483.274-62"
não tem como fazer isso?
SELECT sp_formataCPF(cpf,TRUE) from func_ativos;
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a