Bug #852: Wrong sequence name generated

Started by PostgreSQL Bugs Listover 23 years ago3 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Andras Balogh (andras@reea.net) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Wrong sequence name generated

Long Description
When i create the following table:
CREATE TABLE groups_events
(
group_event_id serial,
event_id integer NOT NULL,
group_id integer NOT NULL,
PRIMARY KEY (group_event_id)
);

the sequence that postgres generates is: groups_events_group_event_i_seq
It shouldn't be groups_events_group_event_id_seq ??

My postgres version is 7.2.2.

Sample Code

No file was uploaded with this report

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #852: Wrong sequence name generated

pgsql-bugs@postgresql.org writes:

the sequence that postgres generates is: groups_events_group_event_i_seq

This is the expected behavior.

It shouldn't be groups_events_group_event_id_seq ??

No, because that identifier is too long.

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #852: Wrong sequence name generated

It is clipping it because it needs to fit in the 32 character limit for
column names. 7.3 has a 64-character limit.

---------------------------------------------------------------------------

pgsql-bugs@postgresql.org wrote:

Andras Balogh (andras@reea.net) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Wrong sequence name generated

Long Description
When i create the following table:
CREATE TABLE groups_events
(
group_event_id serial,
event_id integer NOT NULL,
group_id integer NOT NULL,
PRIMARY KEY (group_event_id)
);

the sequence that postgres generates is: groups_events_group_event_i_seq
It shouldn't be groups_events_group_event_id_seq ??

My postgres version is 7.2.2.

Sample Code

No file was uploaded with this report

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073