Re: explicit cast error

From: Lynn David Newton <lynn(dot)newton(at)cox(dot)net>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Thomas Lockhart <lockhart(at)fourpalms(dot)org>, Andrew Sullivan <andrew(at)libertyrms(dot)info>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Joe Conway <mail(at)joeconway(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: explicit cast error
Date: 2002-07-06 03:35:19
Message-ID: 15654.25975.185001.743040@bela.interhack.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


To the several people who responded to my "explicit
cast" problem, trying to cover all responses in one
message.

The model input is:

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

Two or three suggested single quoting the big integer.
Didn't work. Two suggested doing 3410999762::bigint.
That didn't work either.

Another one or two thought the table with the foreign
key should be looked at. Okay, here are both the tables
abc and def. Note: I *may* have made a booboo in typing
out the definition of abc the first time. (I have to
use generic field names to protect the confidentiality
of the project.) If so, I apologize for wasting your
time. I think it's right this time.

You'll note that table def itself has a foreign key
reference. I trust that the table it refers to is
irrelevant for the sake of this problem.

--------------------- the tables ----------------------
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 (dlab) references def
);

create table def
(
defseq serial not null primary key,
dlab text unique not null,
dset text null,
choices text null check (logos in ('','case1','case2', 'case3','case4')),
l1 text null,
l2 text null,
l3 text null,

foreign key (dset) references datasets
);
-------------------------------------------------------

One person asked about the release. It's 7.1.3.

BTW, this is a very small and very short project.
Probably no more than a couple dozen records in a total
of five tables. But it's an important one.

Unfortunately, the clock is about to run out on this
problem, and I may have to go with another klugier
version to get it in operation. I hate it when that
happens. I had a total of two days to go from scratch
to becoming an expert in PostgreSQL. Didn't exactly get
that far.

Thanks again for your help. Sorry if I overlooked
anyone who responded.

--
Lynn David Newton
Phoenix, AZ

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-07-06 04:13:34 Re: explicit cast error
Previous Message Rich Shepard 2002-07-06 03:25:34 Re: I am being interviewed by OReilly