Django

Code

Ticket #7783 (new)

Opened 6 months ago

Last modified 6 months ago

PostgreSQL database introspection does not detect NULL columns

Reported by: bthomas@ncircle.com Assigned to: nobody
Milestone: Component: django-admin.py inspectdb
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

Description

cursor.description does not return the null_ok field, so database introspection does not add null=True to column definitions. The is_nullable column in information_schema.columns does contain this information, however.

Attachments

pgnulls.diff (1.0 kB) - added by bthomas@ncircle.com on 07/16/08 10:30:48.
Patch to map the is_nullable column from information_schema to the null_ok item in cursor.description

Change History

07/16/08 10:30:48 changed by bthomas@ncircle.com

  • attachment pgnulls.diff added.

Patch to map the is_nullable column from information_schema to the null_ok item in cursor.description

07/16/08 11:47:52 changed by mtredinnick

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

Is this valid for both postgreSQL 7.x and 8.x? We support both.

07/16/08 11:57:12 changed by Bob Thomas <bthomas@ncircle.com>

I am only using PostgreSQL 8.x, but I think information_schema was added in PostgreSQL 7.4:

http://www.postgresql.org/docs/7.4/static/information-schema.html

07/18/08 19:17:28 changed by Simon Greenhill

  • needs_better_patch set to 1.
  • stage changed from Unreviewed to Accepted.

Accepted. Can someone confirm if/what versions of 7.x this works on?


Add/Change #7783 (PostgreSQL database introspection does not detect NULL columns)




Change Properties
Action