pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
sqlDescribeCol not setting null flag correctly for sqlDescribeCol
2+ messages / 2 participants
[nested] [flat]

* sqlDescribeCol not setting null flag correctly for sqlDescribeCol
@ 2009-09-29 15:25 the6campbells <the6campbells@gmail.com>
  2009-09-30 06:22 ` Re: sqlDescribeCol not setting null flag correctly for sqlDescribeCol Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 1 reply; 2+ messages in thread

From: the6campbells @ 2009-09-29 15:25 UTC (permalink / raw)
  To: pgsql-odbc

A basic table is described where one column has a null constraint: create
table TNUM( RNUM integer not null, CNUM numeric(7,2)  )
A simple view is defined that projects all the columns of said table: create
view VNUM as select * from TNUM
A query which projects the columns of the table or the view will return
inconsistent null flags when you call sqlDescribeCol after sqlPrepare

Does not matter if you have parse, server side prepare etc
enabled/disabled.

Looks like another bug to me.

SQL_DRIVER_NAME=6, 30, "PSQLODBC35W.DLL"
SQL_DRIVER_ODBC_VER=77, 10, "03.51"
 SQL_DRIVER_VER=7, 20, "08.04.0100"


Describe Column All:
icol, szColName, *pcbColName, *pfSqlType, *pcbColDef, *pibScale,
*pfNullable
 1, rnum, 4, SQL_INTEGER=4, 10, 0, SQL_NO_NULLS=0
2, cnum, 4, SQL_NUMERIC=2, 7, 2, SQL_NULLABLE=1

Describe Column All:
icol, szColName, *pcbColName, *pfSqlType, *pcbColDef, *pibScale,
*pfNullable
 1, rnum, 4, SQL_INTEGER=4, 10, 0, SQL_NULLABLE=1
2, cnum, 4, SQL_NUMERIC=2, 7, 2, SQL_NULLABLE=1

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: sqlDescribeCol not setting null flag correctly for sqlDescribeCol
  2009-09-29 15:25 sqlDescribeCol not setting null flag correctly for sqlDescribeCol the6campbells <the6campbells@gmail.com>
@ 2009-09-30 06:22 ` Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 0 replies; 2+ messages in thread

From: Hiroshi Inoue @ 2009-09-30 06:22 UTC (permalink / raw)
  To: the6campbells <the6campbells@gmail.com>; +Cc: pgsql-odbc

the6campbells wrote:
> 
> A basic table is described where one column has a null 
> constraint: create table TNUM( RNUM integer not null, CNUM numeric(7,2)  )
> A simple view is defined that projects all the columns of said 
> table: create view VNUM as select * from TNUM
> A query which projects the columns of the table or the view will return 
> inconsistent null flags when you call sqlDescribeCol after sqlPrepare
> 
> Does not matter if you have parse, server side prepare etc 
> enabled/disabled. 
> 
> Looks like another bug to me. 

It seems very hard for the driver to get more accurate results
  than psql does. I see the following result via psql.

xxxxx=> \d tnum
         Table "public.tnum"
  Column |     Type     | Modifiers
--------+--------------+-----------
  rnum   | integer      | not null
  cnum   | numeric(7,2) |

xxxxx=> \d vnum
         View "public.vnum"
  Column |     Type     | Modifiers
--------+--------------+-----------
  rnum   | integer      |
  cnum   | numeric(7,2) |
View definition:
  SELECT tnum.rnum, tnum.cnum
    FROM tnum;

regards,
Hiroshi Inoue




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2009-09-30 06:22 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-09-29 15:25 sqlDescribeCol not setting null flag correctly for sqlDescribeCol the6campbells <the6campbells@gmail.com>
2009-09-30 06:22 ` Hiroshi Inoue <inoue@tpf.co.jp>

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