On Sat, Apr 25, 2009 at 2:51 AM, Alvaro Herrera
wrote:
> In that case you can create a partial unique index:
>
> create index foo on cdr_ama_stat (abonado_a, abonado_b, fecha_llamada,
> duracion) where processed = 2;
Of course, the unique is missing in this one:
CREATE UNIQUE INDEX foo ON cdr_am
Miguel Miranda escribió:
> I cant use a unique index because i only want to check for duplicates where
> processed = 2, for simplicity i did not include that condition in the
> example.
In that case you can create a partial unique index:
create index foo on cdr_ama_stat (abonado_a, abonado_b, fec
I cant use a unique index because i only want to check for duplicates where
processed = 2, for simplicity i did not include that condition in the
example.
On Fri, Apr 24, 2009 at 5:50 PM, Scott Marlowe wrote:
> On Fri, Apr 24, 2009 at 5:37 PM, Miguel Miranda
> wrote:
> > hi , i hava a table:
> >
On Fri, Apr 24, 2009 at 5:37 PM, Miguel Miranda
wrote:
> hi , i hava a table:
> CREATE TABLE public.cdr_ama_stat (
> id int4 NOT NULL DEFAULT nextval('cdr_ama_stat_id_seq'::regclass),
> abonado_a varchar(30) NULL,
> abonado_b varchar(30) NULL,
> fecha_llamada timestamp NULL,
> duracion int4 NULL,
hi , i hava a table:
CREATE TABLE public.cdr_ama_stat (
id int4 NOT NULL DEFAULT nextval('cdr_ama_stat_id_seq'::regclass),
abonado_a varchar(30) NULL,
abonado_b varchar(30) NULL,
fecha_llamada timestamp NULL,
duracion int4 NULL,
puerto_a varchar(4) NULL,
puerto_b varchar(4) NULL,
tipo_llamada char(