| From: | Igor Korot <ikorot01(at)gmail(dot)com> |
|---|---|
| To: | "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: CREATE TABLE fails |
| Date: | 2026-03-08 23:38:59 |
| Message-ID: | CA+FnnTysPCFsd4DKkw8OBRDisS93Tg=tuH0ouj0r446Fz9MQSQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
For the reference (from the same page):
[quote]
WITH ( storage_parameter [= value] [, ... ] )
This clause specifies optional storage parameters for a table or
index; see Storage Parameters below for more information. For
backward-compatibility the WITH clause for a table can also include
OIDS=FALSE to specify that rows of the new table should not contain
OIDs (object identifiers), OIDS=TRUE is not supported anymore.
[/quote]
So the "WITH " clause is definitely available for indexes.
Thank you.
On Sun, Mar 8, 2026 at 6:32 PM Igor Korot <ikorot01(at)gmail(dot)com> wrote:
>
> Sahul,
>
> On Sun, Mar 8, 2026 at 5:40 PM Sahul Hameed <mail2shameed(at)gmail(dot)com> wrote:
> >
> > The problem is that you're putting the WITH clause on the PRIMARY KEY constraint, which applies to the index, not the table.
> >
> > CREATE TABLE leagues_new(id serial, name varchar(100),
> > drafttype smallint,scoringtype smallint,roundvalues smallint,
> > leaguetype char(5),salary integer,benchplayers smallint,primary
> > key(id) INCLUDE (drafttype, scoringtype)) WITH( fillfactor = 50, autovacuum_enabled = true );
>
> This definitely is supported for the PRIMARY KEY constraint.
> Just remove the faulty clause and leave only "fillfactor" one...
>
> Thank you.
>
> >
> > --Sahul
> >
> > On Sun, Mar 8, 2026 at 10:10 PM Igor Korot <ikorot01(at)gmail(dot)com> wrote:
> >>
> >> Hi, ALL,
> >>
> >> [quote]
> >> draft=# CREATE TABLE leagues_new(id serial, name varchar(100),
> >> drafttype smallint, scoringtype smallint, roundvalues smallint,
> >> leaguetype char(5), salary integer, benchplayers smallint, primary
> >> key(id) INCLUDE (drafttype, scoringtype) WITH( fillfactor = 50,
> >> autovacuum_enabled ));
> >> ERROR: unrecognized parameter "autovacuum_enabled"
> >> [/quote]
> >>
> >> But the page at
> >> https://www.postgresql.org/docs/16/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS
> >> says it's available.
> >>
> >> What am I missing?
> >>
> >> Thank you.
> >>
> >>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Igor Korot | 2026-03-08 23:41:39 | Re: CREATE TABLE fails |
| Previous Message | David G. Johnston | 2026-03-08 23:37:26 | Re: CREATE TABLE fails |