pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Max Khon <fjoe@iclub.nsu.ru>
Cc: PostgreSQL odbc list <pgsql-odbc@postgresql.org>
Cc: PostgreSQL-patches <pgsql-patches@postgresql.org>
Subject: Re: Re: more odbc patches
Date: Tue, 23 Jan 2001 15:32:35 -0500 (EST)
Message-ID: <200101232032.PAA00854@candle.pha.pa.us> (raw)
In-Reply-To: <Pine.BSF.4.21.0012161508060.31139-100000@iclub.nsu.ru>

I have applied the following diff to ODBC to fix the problem, as
Constantin suggested.  Would some ODBC folks please test this and make
sure it works?

> hi, there!
> 
> how about this?
> 
> --- cut here ---
> >From cs@plesk.com Sat Dec 16 15:08:40 2000
> Date: Thu, 14 Dec 2000 17:00:43 +0600 (NOVT)
> From: Constantin S. Svintsoff <cs@plesk.com>
> To: fjoe@iclub.nsu.ru
> Subject: Bug in SQLForeignKeys()
> 
> 
> Query used for checking foreign key triggers
> returns too many results when there're more than one foreign
> key in a table. It happens because only table's oid is used to
> link between pg_trigger with INSERT check and pg_trigger with 
> UPDATE/DELETE check.
> 
> I think there should be enough to add following conditions
> into WHERE clause of that query:
> 	AND	pt.tgconstrname = pg_trigger.tgconstrname
> 	AND	pt.tgconstrname = pg_trigger_1.tgconstrname
> 
> /Constantin
> --- cut here ---
> 
> /fjoe
> 
> 


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Attachments:

/bjm/diff (text/plain, 3.4K) download ? config.log ? config.cache ? config.status ? GNUmakefile ? doc/TODO.detail/ProposedTools.doc ? doc/TODO.detail/RDBATools.xls ? src/Makefile.custom ? src/GNUmakefile ? src/Makefile.global ? src/log ? src/crtags ? src/backend/postgres ? src/backend/catalog/global.description ? src/backend/catalog/global.bki ? src/backend/catalog/template1.bki ? src/backend/catalog/template1.description ? src/backend/port/Makefile ? src/bin/initdb/initdb ? src/bin/initlocation/initlocation ? src/bin/ipcclean/ipcclean ? src/bin/pg_config/pg_config ? src/bin/pg_ctl/pg_ctl ? src/bin/pg_dump/pg_dump ? src/bin/pg_dump/pg_restore ? src/bin/pg_dump/pg_dumpall ? src/bin/pg_id/pg_id ? src/bin/pg_passwd/pg_passwd ? src/bin/pgaccess/pgaccess ? src/bin/pgtclsh/Makefile.tkdefs ? src/bin/pgtclsh/Makefile.tcldefs ? src/bin/pgtclsh/pgtclsh ? src/bin/pgtclsh/pgtksh ? src/bin/psql/psql ? src/bin/scripts/createlang ? src/include/config.h ? src/include/stamp-h ? src/interfaces/ecpg/lib/libecpg.so.3.2.0 ? src/interfaces/ecpg/preproc/ecpg ? src/interfaces/libpgeasy/libpgeasy.so.2.1 ? src/interfaces/libpgtcl/libpgtcl.so.2.1 ? src/interfaces/libpq/libpq.so.2.1 ? src/interfaces/perl5/blib ? src/interfaces/perl5/Makefile ? src/interfaces/perl5/pm_to_blib ? src/interfaces/perl5/Pg.c ? src/interfaces/perl5/Pg.bs ? src/pl/plperl/blib ? src/pl/plperl/Makefile ? src/pl/plperl/pm_to_blib ? src/pl/plperl/SPI.c ? src/pl/plperl/plperl.bs ? src/pl/plpgsql/src/libplpgsql.so.1.0 ? src/pl/tcl/Makefile.tcldefs Index: src/interfaces/odbc/info.c =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/odbc/info.c,v retrieving revision 1.26 diff -c -r1.26 info.c *** src/interfaces/odbc/info.c 2000/12/11 18:51:25 1.26 --- src/interfaces/odbc/info.c 2001/01/23 20:24:01 *************** *** 2368,2374 **** "AND (pg_proc.proname LIKE '%%upd') " "AND (pg_proc_1.proname LIKE '%%del') " "AND (pg_trigger.tgrelid=pt.tgconstrrelid) " ! "AND (pg_trigger_1.tgrelid = pt.tgconstrrelid))", fk_table_needed); result = SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query)); --- 2368,2376 ---- "AND (pg_proc.proname LIKE '%%upd') " "AND (pg_proc_1.proname LIKE '%%del') " "AND (pg_trigger.tgrelid=pt.tgconstrrelid) " ! "AND (pg_trigger.tgconstrname=pt.tgconstrname) " ! "AND (pg_trigger_1.tgrelid=pt.tgconstrrelid) ", ! "AND (pg_trigger_1.tgconstrname=pt.tgconstrname))", fk_table_needed); result = SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query)); Index: src/interfaces/odbc/pgtypes.c =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/odbc/pgtypes.c,v retrieving revision 1.15 diff -c -r1.15 pgtypes.c *** src/interfaces/odbc/pgtypes.c 2000/05/27 03:35:14 1.15 --- src/interfaces/odbc/pgtypes.c 2001/01/23 20:24:01 *************** *** 217,223 **** case PG_TYPE_XID: case PG_TYPE_INT4: return SQL_INTEGER; ! case PG_TYPE_INT8: return SQL_BIGINT; case PG_TYPE_NUMERIC: return SQL_NUMERIC; case PG_TYPE_FLOAT4: return SQL_REAL; --- 217,225 ---- case PG_TYPE_XID: case PG_TYPE_INT4: return SQL_INTEGER; ! /* Change this to SQL_BIGINT for ODBC v3 bjm 2001-01-23 */ ! case PG_TYPE_INT8: return SQL_CHAR; ! case PG_TYPE_NUMERIC: return SQL_NUMERIC; case PG_TYPE_FLOAT4: return SQL_REAL;

view thread (18+ messages)  latest in thread

Message-ID: <200101232032.PAA00854@candle.pha.pa.us>
Permalink:  ../200101232032.PAA00854@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200101232032.PAA00854@candle.pha.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: pgman@candle.pha.pa.us, fjoe@iclub.nsu.ru, pgsql-odbc@postgresql.org, pgsql-patches@postgresql.org
  Subject: Re: Re: more odbc patches
  In-Reply-To: <200101232032.PAA00854@candle.pha.pa.us>

* 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