On Wednesday 09 January 2008 01:45:26 pm Adrian Klaver wrote:
> I am trying to work through my own problems with new(). In doing so I ran
> into a problem with the Postgres driver not  finding the sequence on my
> table. The details are below. I pulled the query from getLastInsertID and
> ran with the result shown below, no relname.  Below that is the schema for
> the table and below that a query against pg_class that shows that the
> sequence does exist.
>
> Dabo:
> Platform: GTK
> Python Version: 2.5.1c1 on linux2
> Dabo Version: Version 0.8.3; Revision ~3849
> UI Version: 2.8.7.1 on wxGTK (gtk2)
>
>
> Postgres:
> version | PostgreSQL 8.2.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC)
> 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
>
>
> SELECT seq.relname::text
> production-#                         FROM pg_class src, pg_class seq,
> pg_namespace, pg_attribute, production-#                         pg_depend
> production-#                         WHERE
> production-#                         pg_depend.refobjsubid =
> pg_attribute.attnum AND production-#                        
> pg_depend.refobjid = src.oid AND production-#                        
> seq.oid = pg_depend.objid AND production-#                        
> src.relnamespace = pg_namespace.oid AND production-#                       
>  pg_attribute.attrelid = src.oid AND production-#                        
> pg_namespace.nspname = 'public' AND production-#                        
> src.relname = 'plant1' AND
> production-#                         pg_attribute.attname = 'p_item_no'
> production-# ;
>  relname
> ---------
> (0 rows)
>
>
>                                                   Table "public.plant1"
>       Column       |              Type              |                      
>       Modifiers
> -------------------+--------------------------------+----------------------
>---------------------------------------------- p_item_no         | smallint 
>                      | not null default
> nextval(('plant1_p_item_no_seq'::text)::regclass) common            |
> character varying(40)          | not null
>  genus             | character varying(20)          |
>  species           | character varying(30)          |
>  variety           | character varying(40)          |
>  plant_type        | character varying(6)           | not null
>  series            | character varying(20)          |
>  season            | character varying(9)           |
>  ts_insert         | timestamp(0) without time zone | default now()
>  ts_update         | timestamp(0) without time zone |
>  user_update       | character varying(20)          |
>  user_insert       | character varying(20)          | default
> "session_user"() color             | character varying(30)          |
>  category_type     | character varying(5)           | not null default
> 'plant'::character varying category_sub_type | character varying(15)       
>   | not null default 'normal'::character varying Indexes:
>     "p_no_pkey" PRIMARY KEY, btree (p_item_no)
>     "common_idx" btree (common)
>     "genus_idx" btree (genus)
>
>
> SELECT * from pg_class where relname='plant1_p_item_no_seq';
> -[ RECORD 1 ]--+----------------------------------------------
> relname        | plant1_p_item_no_seq
> relnamespace   | 2200
> reltype        | 1093291
> relowner       | 10
> relam          | 0
> relfilenode    | 1093290
> reltablespace  | 0
> relpages       | 1
> reltuples      | 1
> reltoastrelid  | 0
> reltoastidxid  | 0
> relhasindex    | f
> relisshared    | f
> relkind        | S
> relnatts       | 9
> relchecks      | 0
> reltriggers    | 0
> relukeys       | 0
> relfkeys       | 0
> relrefs        | 0
> relhasoids     | f
> relhaspkey     | f
> relhasrules    | f
> relhassubclass | f
> relfrozenxid   | 0
> relacl         | {postgres=rw/postgres,production=rw/postgres}
> reloptions     | NULL
>
>
> Thanks,
> --
> Adrian Klaver

The problem is your data type - it is not a 'serial'. I have been researching 
but have not come up with a "select" to cover using other data types.  If you 
find anything let me know.  


-- 
John Fabiani


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to