Re: Tablespace with multiple locations

2023-01-03 Thread Peter Eisentraut

On 29.12.22 15:29, PG Doc comments form wrote:

I m kindly requesting a clarification regarding a debatable subject in one
of my projects, that if it's possible to create one global tablespace and
assign many locations like the following example:

create tablespace TBS1 location ('/pgdata1','/pgdata2');


What kind of clarification are you looking for?  This feature doesn't 
exist and is not planned AFAICT.






Tablespace with multiple locations

2022-12-30 Thread PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/sql-createtablespace.html
Description:

Hello,

I m kindly requesting a clarification regarding a debatable subject in one
of my projects, that if it's possible to create one global tablespace and
assign many locations like the following example:

create tablespace TBS1 location ('/pgdata1','/pgdata2');

Which will be helpful on database migration, once the new database to be
restored needs further available space than the created tablespace ( if the
new DB is larger than the existing tablespace ), so it can be automatically
distributed on the assigned locations ( filesystems ) with no need for
manual intervention to distribute the schema objects between many
tablespaces that can't be done automatically.

And if a tablespace needs to be extended on a physical partitioned disk
device that is not configured as a logical volume.

Thank you,
Hussein Younes


Re: TABLESPACE

2022-09-05 Thread Nicolas Shiacolas
Yes realised just after posting
Thank you very much for the response!
Nicolas

On Sun, 4 Sep 2022 at 12:45, Guillaume Lelarge 
wrote:

>
>
>
> Le dim. 4 sept. 2022, 10:19, PG Doc comments form 
> a écrit :
>
>> The following documentation comment has been logged on the website:
>>
>> Page: https://www.postgresql.org/docs/14/sql-createtablespace.html
>> Description:
>>
>> When exporting a table create script pgAdmin includes a command
>> "TABLESPACE
>> pg_default;" such as below
>>
>> CREATE TABLE IF NOT EXISTS "DbTest"."Test"
>> (
>> "TestID" integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1
>> START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
>> "TestName" character varying(80) COLLATE pg_catalog."default" NOT
>> NULL,
>> "CreateTimestamp" timestamp without time zone NOT NULL DEFAULT
>> LOCALTIMESTAMP,
>> "UpdateTimestamp" timestamp without time zone NOT NULL DEFAULT
>> LOCALTIMESTAMP,
>> CONSTRAINT "Test_pk" PRIMARY KEY ("TestID"),
>> )
>>
>> TABLESPACE pg_default;
>>
>
> As you can see, there's no ";" between ")" and "TABLESPACE", so it's not a
> command on its own but another clause of the CREATE TABLE statement. It
> indicates the tablespace for the new table.
>


Re: TABLESPACE

2022-09-04 Thread Guillaume Lelarge
Le dim. 4 sept. 2022, 10:19, PG Doc comments form 
a écrit :

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/14/sql-createtablespace.html
> Description:
>
> When exporting a table create script pgAdmin includes a command "TABLESPACE
> pg_default;" such as below
>
> CREATE TABLE IF NOT EXISTS "DbTest"."Test"
> (
> "TestID" integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1
> START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
> "TestName" character varying(80) COLLATE pg_catalog."default" NOT
> NULL,
> "CreateTimestamp" timestamp without time zone NOT NULL DEFAULT
> LOCALTIMESTAMP,
> "UpdateTimestamp" timestamp without time zone NOT NULL DEFAULT
> LOCALTIMESTAMP,
> CONSTRAINT "Test_pk" PRIMARY KEY ("TestID"),
> )
>
> TABLESPACE pg_default;
>

As you can see, there's no ";" between ")" and "TABLESPACE", so it's not a
command on its own but another clause of the CREATE TABLE statement. It
indicates the tablespace for the new table.


TABLESPACE

2022-09-04 Thread PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/sql-createtablespace.html
Description:

When exporting a table create script pgAdmin includes a command "TABLESPACE
pg_default;" such as below

CREATE TABLE IF NOT EXISTS "DbTest"."Test"
(
"TestID" integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1
START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
"TestName" character varying(80) COLLATE pg_catalog."default" NOT
NULL,
"CreateTimestamp" timestamp without time zone NOT NULL DEFAULT
LOCALTIMESTAMP,
"UpdateTimestamp" timestamp without time zone NOT NULL DEFAULT
LOCALTIMESTAMP,
CONSTRAINT "Test_pk" PRIMARY KEY ("TestID"),
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS "DbTest"."Test"
OWNER to postgres;

What the command TABLESPACE on it's own does or how it should be used is not
documented at all

Thanks