Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Jonathan Muniz

Erro nao identificado,

Recommended Posts

CREATE TABLE common_notes ( ????note_id bigint DEFAULT nextval(('seq_commonnotes_id'::text)::regclass) NOT NULL, note_author bigint DEFAULT 0::bigint NOT NULL, note_module bigint DEFAULT 0::bigint NOT NULL, note_record_id bigint DEFAULT 0::bigint NOT NULL, note_category integer DEFAULT 0 NOT NULL, note_title character varying(100) DEFAULT ''::character varying NOT NULL, note_body text NOT NULL, note_date timestamp without time zone DEFAULT '1970-01-01 00:00:00'::timestamp without time zone NOT NULL, note_hours double precision DEFAULT 0::double precision NOT NULL, note_code character varying(8) DEFAULT ''::character varying NOT NULL, note_created timestamp without time zone DEFAULT '1970-01-01 00:00:00'::timestamp without time zone NOT NULL, note_modified timestamp without time zone NOT NULL, note_modified_by bigint DEFAULT 0::bigint NOT NULL);cannot cast type text to regclass

Compartilhar este post


Link para o post
Compartilhar em outros sites

Jonathan,

aparentemente o erro está sendo originado devido às intruções do seu campo SERIAL. Eu uso SERIAL e fica assim:

 

nextval('tb_bairros_codbairro_seq'::regclass)

 

Caso você esteja tentando fazer um sequencial a partir de um campo texto, acho que não é possível, pois SERIAL apenas cria campos INTEGER. Consulte:

http://www.postgresql.org/docs/8.1/static/...DATATYPE-SERIAL

 

Funciona sem problemas. Sucesso !!

Enio.

Manaus - AM

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.