Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

unable to insert row at id, but row does not exist

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
postgresqlinsertopenerp7primarykey
1 Responder
8542 Vistas
Avatar
Saghir A. Khatri

4 down vote favorite

Here is the weird problem i am facing. I am trying to enter data using following query

insert into product_product (id, product_tmpl_id, make_equip, model_equip, name_template, serial_num_equip, location_equip, issue_date_equip, issue_to_equip, remarks_equip, pr, ch, categ_id,valuation) values (700,700,'Nikon','Action 10x50 Lookout','Nikon Action 10x50 Lookout','671386','40 Wall St.','5/13/2004 12:00:00 AM','','OM''s OFFICE',62,72,502,'manual periodic');

I get the error :

ERROR: duplicate key value violates unique constraint "product_product_pkey" DETAIL: Key (id)=(700) already exists. ********** Error ********** ERROR: duplicate key value violates unique constraint "product_product_pkey" SQL state: 23505 Detail: Key (id)=(700) already exists.

I ran select query on that record like this:

select * from product_product where id=700

It returns columns with no data(data includes id too)

I tried to run update query like this:

update product_product set product_tmpl_id=700, make_equip='Nikon', model_equip='Action 10x50 Lookout', name_template='Nikon Action 10x50 Lookout', serial_num_equip='671386', location_equip='40 Wall St.', issue_date_equip='5/13/2004 12:00:00 AM', issue_to_equip='', remarks_equip='OM''s OFFICE', pr=62, ch=72, categ_id=502,valuation='manual periodic' where id=700;

result was:

Query returned successfully: 0 rows affected, 1 ms execution time.

i tried delete query too but same output.

Also show all data shows nothing like id 700.

I don't know why this is happening.

I re indexed and Vacuumed my table from maintenance but same result.

Plz let me know what is wrong with it.

Thanks

Edit

here is my create table

CREATE TABLE product_product ( id serial NOT NULL, create_uid integer, create_date timestamp without time zone, write_date timestamp without time zone, write_uid integer, ean13 character varying(13), -- EAN13 Barcode color integer, -- Color Index image bytea, -- Image price_extra numeric, -- Variant Price Extra default_code character varying(64), -- Internal Reference name_template character varying(128), -- Template Name ..... description_sale text, procure_method character varying, produce_delay double precision, uom_id integer, name character varying, office_equip character varying, -- Office(Equipment) lease_agreement_equip character varying, -- Lease Agreement reg_exp_date_equip character varying, -- Registration Expiration Date CONSTRAINT product_product_pkey PRIMARY KEY (id ), CONSTRAINT product_product_categ_temp2_fkey FOREIGN KEY (categ_temp2) REFERENCES product_category (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_categ_temp3_fkey FOREIGN KEY (categ_temp3) REFERENCES product_category (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_categ_temps_fkey FOREIGN KEY (categ_temps) REFERENCES product_category (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_categg_temp_fkey FOREIGN KEY (categg_temp) REFERENCES product_category (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_ch_fkey FOREIGN KEY (ch) REFERENCES product_category (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_create_uid_fkey FOREIGN KEY (create_uid) REFERENCES res_users (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_my_products_fkey FOREIGN KEY (my_products) REFERENCES product_product (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_phone_data_id_fkey FOREIGN KEY (phone_data_id) REFERENCES phone_datas (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_phone_id_fkey FOREIGN KEY (phone_id) REFERENCES phone_types (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_pr_fkey FOREIGN KEY (pr) REFERENCES product_category (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_product_tmpl_id_fkey FOREIGN KEY (product_tmpl_id) REFERENCES product_template (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT product_product_subchild_fkey FOREIGN KEY (subchild) REFERENCES product_category (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_temp_id_fkey FOREIGN KEY (temp_id) REFERENCES product_category (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL, CONSTRAINT product_product_write_uid_fkey FOREIGN KEY (write_uid) REFERENCES res_users (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL ) WITH ( OIDS=FALSE );

I have something like 200+ columns, so i have removed them from here....

0
Avatar
Descartar
Avatar
john5000
Mejor respuesta

Hi Saghir,

This is highly unusual.  Based on all the info provided it seems the index and/or data has internal corruption (not usual by any means).

Try this:

1. Drop the index and then recreate it. They try your insert again.

2. If still no good, drop the table (export the data first!) and index and re-create it and reload the data.

Some other things you can check:
Are you out of disk space?  That causes all sorts of odd occurences.
Are you actually doing the insert twice by mistake? (doesn't seem like, from what you shown, but still)

Hope that helps.

 

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Trying to extract a pdf file from ir_attachment.dbdatas Resuelto
attachment postgresql openerp7
Avatar
3
ene 17
11124
How can I know the password of the openerp Postgresql user ? v7
password postgresql openerp7
Avatar
Avatar
1
mar 15
10271
Restrict To Return None Value from the SQL Query Resuelto
postgresql sql openerp7 odooV8
Avatar
Avatar
Avatar
2
dic 19
7121
How to represent Postgresql interval in Openerp 7 ?
postgresql python2.7 openerp7 postgresql9.3
Avatar
0
oct 18
4103
White/blank screen when loading OpenERP
javascript postgresql python2.7 openerp7
Avatar
Avatar
Avatar
Avatar
Avatar
5
ene 18
15890
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now