pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rodriguez Fernando <rodriguez@ort.edu.uy>
To: pgsql-bugs@postgresql.org
Subject: column check mistake or not?
Date: Mon, 09 May 2011 08:36:53 -0300
Message-ID: <4DC7D1D5.5070306@ort.edu.uy> (raw)

Yesterday i did a mistake executing one query, i use a column daes not 
exists in the table the result was all rows of the table.
Platform Fedora 14 32 bits
Version Postgresql 9.0.2

The column id_documento not exists in t_log_modificar_deuda, this 
behavior is correct or not?

query
select * from t_documento where (importe_deudor_documento > 
importe_documento) or id_documento in (select id_documento from 
t_log_modificar_deuda);

result all column of t_documento.

schema

CREATE TABLE t_documento (
     id_documento d_codigo NOT NULL,
     nro_documento d_codigo NOT NULL,
     importe_documento d_importe,
     id_cliente d_codigo,
     id_razon_social d_codigo,
     fecha_documento d_fecha NOT NULL,
     usuario_ingreso d_usuario_ingreso,
     fecha_ingreso d_fecha_ingreso,
     hora_ingreso d_hora_ingreso,
     id_tipo_documento d_codigo,
     fecha_vencimiento_documento d_fecha,
     id_moneda d_codigo,
     id_sucursal d_codigo,
     motivo_anulacion_documento d_descripcion,
     fecha_anulacion_documento d_fecha,
     hora_anulacion_documento d_hora,
     usuario_anulacion_documento d_nombre,
     sistema_viejo_documento d_boolean DEFAULT 'N'::bpchar NOT NULL,
     redondeo_documento d_importe DEFAULT 0 NOT NULL,
     importe_deudor_documento d_importe DEFAULT 0 NOT NULL,
     id_categoria_documento d_codigo NOT NULL,
     fecha_exportado_memory_documento d_fechahora,
     aniomes_exportado_gestoria_documento integer,
     importe_deudor_documento_ant d_importe,
     modificado integer DEFAULT 0,
     anulacion_exportado_memory_documento d_fechahora
);

ALTER TABLE ONLY t_documento
     ADD CONSTRAINT documento_primary PRIMARY KEY (id_documento);
ALTER TABLE ONLY t_documento
     ADD CONSTRAINT nro_documento_unico UNIQUE (nro_documento);

CREATE TABLE t_log_modificar_deuda (
     nro_documento d_codigo NOT NULL,
     importe_actual d_importe NOT NULL,
     importe_sugerido d_importe NOT NULL,
     usuario_ingreso d_usuario_ingreso,
     fecha_ingreso d_fecha_ingreso,
     hora_ingreso d_hora_ingreso
);






view thread (2+ messages)  latest in thread

Message-ID: <4DC7D1D5.5070306@ort.edu.uy>
Permalink:  ../4DC7D1D5.5070306@ort.edu.uy/
Also on:    postgresql.org/message-id/4DC7D1D5.5070306@ort.edu.uy

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: rodriguez@ort.edu.uy
  Subject: Re: column check mistake or not?
  In-Reply-To: <4DC7D1D5.5070306@ort.edu.uy>
  References: <4DC7D1D5.5070306@ort.edu.uy>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox