Re: INSERT ... SELECT DISTINCT - Doesn't work... - Mailing list pgsql-general

From Cesar A. K. Grossmann
Subject Re: INSERT ... SELECT DISTINCT - Doesn't work...
Date
Msg-id 396BB9F6.DB33E2DB@rotnet.com.br
Whole thread Raw
In response to INSERT ... SELECT DISTINCT - Doesn't work...  ("Cesar A. K. Grossmann" <cesar@rotnet.com.br>)
List pgsql-general
> Cesar's example looked like it didn't run into these problems, so I'm
> not sure what's going wrong for him.

I'm sorry. In fact, I was not so carefull with my analisis and the
example I provided you was not exactly like the real problem.

First, I have failed to use the same type in the columns (integer in one
relation, varchar in the other). I think this was the major problem. To
make the example more realistic:

user_operations (
        user_id    integer,
        user_name  varchar,
        user_operation varchar)

CREATE TABLE users (
        user_id         varchar,
        user_name       varchar);

the column user_id from the relation users was with the wrong type
(varchar). I changed it to integer (as user_operations), and the INSERT
works well.

[]s
--
César A. K. Grossmann
ckant@usa.net
http://members.xoom.com/ckant/
Para os sádicos e corajosos e infantis:
http://www.halcyon.com/sciclub/cgi-pvt/instr/instr.html

pgsql-general by date:

Previous
From: Chris Bitmead
Date:
Subject: Re: Slashdot discussion
Next
From: ryan
Date:
Subject: Stored Procedure warnings