pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bhuvan A <bhuvansql@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Strange Problem As Type Casting
Date: Sat, 3 Nov 2001 09:09:49 +0530 (IST)
Message-ID: <Pine.LNX.4.20.0111030908520.11906-100000@Larry.bks> (raw)



hi all,

i am using postgresql 7.1.
here i am facing some strange problem for last 2 days.

i have a table 'users' as below

test=> \d users
                                        Table "users"
     Attribute     |           Type           |                   Modifier      
-------------------+--------------------------+-----------------------------------------------
 user_id           | integer                  | not null default nextval('user_id_seq'::text)
 login_id          | text                     |
 user_code         | text                     |
 comp_code         | text                     |
 user_name         | text                     |
 password          | text                     |
 last_login        | timestamp with time zone |
 noof_logins       | integer                  |
 dob               | date                     |
 eff_date          | date                     |
 is_active         | boolean                  | default 'f'
 email_id          | text                     |
 creation_time     | timestamp with time zone |
 modification_time | timestamp with time zone |
Indices: users_login_id_key,
         users_pkey,
         users_user_code_key
Constraint: ((email_id ~ '@'::text) AND (email_id ~ '.'::text))

----

here user_id is of type integer and not serial. ie.. i explicitly created 
the sequence and had it as default.
while i update user_id field

test=> UPDATE users set user_id=1 ,login_id='admin' where user_id='1346';
ERROR:  Unable to identify an operator '=' for types 'text' and 'int4'
        You will have to retype this query using an explicit cast

again i tried it as below
test=> UPDATE users set login_id='admin' where user_id='1346';
UPDATE 1
test=> UPDATE users set user_id='1' where login_id='admin';
ERROR:  Unable to identify an operator '=' for types 'text' and 'int4'
        You will have to retype this query using an explicit cast

what could be the problem here?

Thankx in advance

With Regards,
Bhuvaneswar.





view thread (3+ messages)  latest in thread

Message-ID: <Pine.LNX.4.20.0111030908520.11906-100000@Larry.bks>
Permalink:  ../Pine.LNX.4.20.0111030908520.11906-100000@Larry.bks/
Also on:    postgresql.org/message-id/Pine.LNX.4.20.0111030908520.11906-100000@Larry.bks

 · 

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-sql@postgresql.org
  Cc: bhuvansql@yahoo.com
  Subject: Re: Strange Problem As Type Casting
  In-Reply-To: <Pine.LNX.4.20.0111030908520.11906-100000@Larry.bks>
  References: <Pine.LNX.4.20.0111030908520.11906-100000@Larry.bks>

* 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