pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas G. Lockhart <lockhart@alumni.caltech.edu>
To: Peter T Mount <peter@retep.org.uk>
Cc: Bruce Momjian <maillist@candle.pha.pa.us>
Cc: hackers@postgreSQL.org
Subject: Re: [HACKERS] Open 6.4 items
Date: Sun, 30 Aug 1998 18:40:52 +0000
Message-ID: <35E99CB4.A8375D91@alumni.caltech.edu> (raw)
References: <Pine.LNX.3.96.980830115328.493T-100000@maidast.retep.org.uk>

Works fine _if_ the user has database creation privileges:

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



view thread (141+ messages)  latest in thread

Message-ID: <35E99CB4.A8375D91@alumni.caltech.edu>
Permalink:  ../35E99CB4.A8375D91@alumni.caltech.edu/
Also on:    postgresql.org/message-id/35E99CB4.A8375D91@alumni.caltech.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: lockhart@alumni.caltech.edu, peter@retep.org.uk, maillist@candle.pha.pa.us, hackers@postgreSQL.org
  Subject: Re: [HACKERS] Open 6.4 items
  In-Reply-To: <35E99CB4.A8375D91@alumni.caltech.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox