Re: PreparedStatement and DB default values

From: Tomisław Kityński <cromax(at)amiga(dot)pl>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PreparedStatement and DB default values
Date: 2002-07-05 22:08:34
Message-ID: 00c901c22470$81bd9e60$625d4cd5@xpecet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

----- Original Message -----
From: "Barry Lind" <barry(at)xythos(dot)com>
To: "Tomisław Kityński" <cromax(at)amiga(dot)pl>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Sent: Friday, July 05, 2002 9:08 PM
Subject: Re: [JDBC] PreparedStatement and DB default values

> I doubt this is jdbc related. Can you turn on query tracing in the
> server to see the exact SQL that the jdbc driver is sending to the
> server and then run that same sql through psql?
>
This is part of the log from postmaster fired off with -d 4:

DEBUG: query: INSERT INTO "users" ("first", "last", "email", "ed") VALUES
('Jan', 'Nowak', 'jan(at)poczta(dot)pl', 'f');

And now the best part--this query pasted into psql... didn't work too!
As I'm almost sure, that similar insert string worked for psql, I looked
into
.psql_history to find that exact insert that worked. I found it, I pasted
it,
and... it didn't work too! Uhm, I am very confused now. Well, I issued
also such statement:

INSERT INTO users DEFAULT VALUES;

and it refuses to insert null value in not null attribute id_user,
which of course have defined not-null default value. And this _really_
is something strange, 'cos I am almost 100% sure that, this one worked
some time ago (I have it in .psql_history). Well, I checked the table for
tuples with "first" and "last" set to default values and there is only
one tuple which consists of exactly the same values as default values.
And I am sure this tuple exists because above statement worked--but now
it does not (what this depend on? debug level??? uhm, I guess not--
I just started postmaster in silent mode and the same happens).

Well, this looks very misterious to me, but you're right in one place:
this isn't probably JDBC related. But how to explain the existence of
'default' tuple in table? I really have strong impression, that those
statements were working when issued from psql few days ago, and now
they're not. 8((

The worst thing is, that on sunday I have to pass db-project (studies),
and now I made some steps back 8(

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Garnier 2002-07-06 00:58:54 [SOLVED]Re: Retrieving binary data
Previous Message David Garnier 2002-07-05 21:24:40 Re: Retrieving binary data