Forum OpenACS Q&A: Re: Insert Performance Issues - PG 7.2.3/OpenACS 4.5/perl/dbi

Wow, thanks for all the quick replies.

After thinking about it some, I think that at least one of my data types doesn't need to be an acs_object.  I appreciate the warning regarding inheritance.

As I was trying to build a new data model to shift everything over, I decided to look up the acs_object in the schema browser.

The excerpt:

---
create sequence t_acs_object_id_seq;
create view acs_object_id_seq as
select nextval('t_acs_object_id_seq') as nextval;

create table acs_objects (
    object_id        integer not null
                constraint acs_objects_pk primary key
...
---

Indicates that a sequence is created when supposedly, it is possible to do this using the "serial" and "bigserial" datatype.  Do the serial/bigserial datatypes work?

I tried to create a table:

create table test (
  a      serial
  b      integer
);

and then attempted an

insert into test values (null, 2);

which fails.  I had been most familiar with mysql and the "integer auto_increment" specification where that generally works.

Can anybody briefly describe why using serial/bigserial is a bad idea (ie. like using PG inheritance?)