explicit cast error

Поиск
Список
Период
Сортировка
От Lynn David Newton
Тема explicit cast error
Дата
Msg-id cn13cuz74wz.fsf@bela.interhack.net
обсуждение исходный текст
Ответы Re: explicit cast error  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: explicit cast error  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
Caveat ... I'm a software engineer with some previous
experience in MySQL, very, very new to PostgreSQL, and
not at all deeply knowledgeable about SQL in general
other than the basics of setting up tables, relations,
doing queries, et al -- the point being that if you
take pity on me and choose to spend time helping me
with the problem described, *please* don't assume I
know too much, and please don't send me pseudocode with
a lot of ellipses and foo's and "and so forth"s in it,
or I'm liable not to know what you're talking about and
how to apply it.

Having said that ... I'm charged with putting together
what seems to be a fairly straightforward database of
so far five tables. Most things are working all right,
but I have a hump to get over. I have a table
definition that is structurally idential to the
following (with actual field, table names, and comments
changed/removed because the project is company
confidential):

create table abc
(
  c1 serial not null primary key,
  c2 smallint not null,
  lab text not null,
  dlab text not null,
  bdigits bigint null,
  foreign key (bdigits) references def
);

Never mind the table def for right now.

I try to load a trial piece of data into this table
using a line like this in an external file, which I
read using \i add_abc in interactive psql:

insert into abc
  (c2, lab, dlab, bdigits) values
  (5, 'somestring', 'abc123', 3410999762);

psql returns to me this message:

psql: ... ERROR: Unable to identify an operator '=' for types 'int4' and 'text'
      You will have to retype this query using an explicit cast

I'm unable to figure this one out. Various trips to
Google have produced explanations and solutions that
have proven so far too dense for me to fathom.
Apparently, however, this is not exactly an unknown
problem. BTW, I have the same identical problem in a
second table.

Can someone please tell me what I might be able to do
to fix this?

Many thanks for your consideration.

--
Lynn David Newton
Phoenix, AZ

В списке pgsql-general по дате отправления:

Предыдущее
От: "Manuel W."
Дата:
Сообщение: Postgre vs MySQL
Следующее
От: Do Not Spam
Дата:
Сообщение: Time bug fixed?