Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.8.8/8.7.5) with ESMTP id RAA02663 for ; Sun, 30 Aug 1998 17:30:15 -0400 (EDT) Received: (from maillist@localhost) by candle.pha.pa.us (8.8.5/8.8.5) id RAA16751; Sun, 30 Aug 1998 17:11:21 -0400 (EDT) From: Bruce Momjian Message-Id: <199808302111.RAA16751@candle.pha.pa.us> Subject: Re: [HACKERS] Open 6.4 items In-Reply-To: <35E99CB4.A8375D91@alumni.caltech.edu> from "Thomas G. Lockhart" at "Aug 30, 1998 6:40:52 pm" To: lockhart@alumni.caltech.edu (Thomas G. Lockhart) Date: Sun, 30 Aug 1998 17:11:21 -0400 (EDT) Cc: peter@retep.org.uk, hackers@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > Works fine _if_ the user has database creation privileges: Can I ask why sequence creation is related to database CREATION. Seems very strange to me. > > tgl=> create table test (x text, s serial); > NOTICE: CREATE TABLE will create implicit sequence test_s_seq for SERIAL > column test.s > NOTICE: CREATE TABLE/UNIQUE will create implicit index test_s_key for > table test > CREATE > > This statement internally expands to roughly the following: > create table test (x text, s int4 default nextval('test_s_seq')); > create unique index test_s_key on test (s); > create sequence test_s_seq; > > If the user has no database creation privileges, then apparently there > is some checking which insists that the sequence referenced in the > implicit default clause actually exists: > > tgl=> create table test (x text, i int default nextval('test_s_seq')); > ERROR: pg_aclcheck: class "test_s_seq" not found > > So, it looks like the sequence should internally be created before the > table, though in some cases it doesn't matter. I was concerned that this > might be the case, and the parser is not at the moment configured to > allow this. Should be able to fix it up, or have just limited SERIAL > support for the v6.4 release :( > > - Tom > -- Bruce Momjian | 830 Blythe Avenue maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 + If your life is a hard drive, | (610) 353-9879(w) + Christ can be your backup. | (610) 853-3000(h)