From: me@alternize.com
To: Ludek Finstrle <luf@pzkagis.cz>
Cc: pgsql-odbc@postgresql.org
Subject: Re: PostgreSQL 8.1.4 ODBC for Windows
Date: Mon, 29 May 2006 12:17:02 +0200
Message-ID: <094c01c68309$07bfea40$0201a8c0@iwing> (raw)
References: <C0A06F02.CEB0%dpage@vale-housing.co.uk>
<08df01c682fc$8269a950$0201a8c0@iwing>
<20060529092911.GA25745@soptik.pzkagis.cz>
<092801c68304$002db0a0$0201a8c0@iwing>
<20060529095854.GB25745@soptik.pzkagis.cz>
> I see no information about enconding (server, client),
UNICODE db, UNICODE encoding, unicode driver version
> example of select, code to retrieve the data (are you using
> VB, VC, ... ADO, OLE DB, ...), ...
------------------------------------
Tables:
CREATE TABLE "forum"."posts" (
"p_id" SERIAL,
"p_t_id" INTEGER,
"p_first" BOOLEAN DEFAULT false NOT NULL,
"p_user" INTEGER DEFAULT 0 NOT NULL,
"p_msg_formated" TEXT DEFAULT ''::text NOT NULL,
"p_msg_raw" TEXT DEFAULT ''::text NOT NULL,
"p_date_add" TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL,
"p_date" TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL,
"p_status_deleted" SMALLINT DEFAULT 0 NOT NULL,
"idxfti" "public"."tsvector",
"p_msg_clean" TEXT DEFAULT ''::text,
CONSTRAINT "posts_pkey" PRIMARY KEY("p_id"),
CONSTRAINT "posts_fk" FOREIGN KEY ("p_t_id")
REFERENCES "forum"."threads"("t_id")
ON DELETE CASCADE
ON UPDATE NO ACTION
NOT DEFERRABLE
) WITHOUT OIDS;
CREATE TABLE "forum"."threads" (
"t_id" SERIAL,
"t_b_id" INTEGER,
"t_status_locked" BOOLEAN DEFAULT false NOT NULL,
"t_status_deleted" BOOLEAN DEFAULT false NOT NULL,
"t_status_sticky" BOOLEAN DEFAULT false NOT NULL,
"t_name" VARCHAR(150) DEFAULT ''::character varying NOT NULL,
"t_first_post" TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL,
"t_first_user" INTEGER DEFAULT 0 NOT NULL,
"t_last_post" TIMESTAMP WITHOUT TIME ZONE DEFAULT now(),
"t_last_user" INTEGER,
"t_stats_posts" INTEGER DEFAULT 0 NOT NULL,
"t_stats_views" INTEGER DEFAULT 0 NOT NULL,
"t_special_type" SMALLINT DEFAULT 0 NOT NULL,
"t_special_id" INTEGER DEFAULT 0 NOT NULL,
CONSTRAINT "threads_pkey" PRIMARY KEY("t_id"),
CONSTRAINT "threads_fk" FOREIGN KEY ("t_b_id")
REFERENCES "forum"."boards"("b_id")
ON DELETE CASCADE
ON UPDATE NO ACTION
NOT DEFERRABLE
) WITHOUT OIDS;
(and several indizes / fks)
------------------------------------
ASP:
Set DB2_Conn = CreateObject("ADODB.Connection")
DB2_Conn.CommandTimeout = 90
DB2_Conn.open "Driver={PostgreSQL
UNICODE};Server=localhost;Port=5432;Database=somedb;UID=db_user;pwd=somepassword;TrueIsMinus1=1;BoolsAsChar=0;TextAsLongVarchar=0"
Set rsRecords = Server.CreateObject("ADODB.Recordset")
sSQL = "SELECT threads.*, p_id, p_first, p_date, p_status_deleted,
p_msg_formated FROM forum.posts JOIN forum.threads ON posts.p_t_id =
threads.t_id WHERE t_id = " & lTID & " ORDER BY p_first DESC, p_date_add,
p_id"
rsRecords.Open sSQL, DB2_Conn, 0 ' adOpenForwardOnly
-----------------------------------
> I'm unable to find information how is the output deformated.
p_msg_formated is a TEXT. if its removed, the result is fine. if its
included, the fields are messed up. ie if you try to read "threads.t_date"
(for example: response.write rsRecords("t_date")) you might receive the
content of another field in the same record. this happens to almost any
field in the resultset...
this is just one example query. the problem happens on all queries involving
TEXT fields...
- thomas
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-odbc@postgresql.org
Cc: me@alternize.com, luf@pzkagis.cz
Subject: Re: PostgreSQL 8.1.4 ODBC for Windows
In-Reply-To: <094c01c68309$07bfea40$0201a8c0@iwing>
References: <C0A06F02.CEB0%dpage@vale-housing.co.uk> <08df01c682fc$8269a950$0201a8c0@iwing> <20060529092911.GA25745@soptik.pzkagis.cz> <092801c68304$002db0a0$0201a8c0@iwing> <20060529095854.GB25745@soptik.pzkagis.cz> <094c01c68309$07bfea40$0201a8c0@iwing>
* 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