Thread: PGOPTIONS and default_tablespace

PGOPTIONS and default_tablespace

From
Jan-Peter.Seifert@gmx.de
Date:
Hello,

without success I tried to set the default tablespace via the environment variable PGOPTIONS.

My tries:
set PGOPTIONS="default_tablespace='pgdata'"
set PGOPTIONS=default_tablespace='pgdata'
set PGOPTIONS=default_tablespace(pgdata)
set PGOPTIONS=default_tablespace('pgdata')

When I try to connect to the server via psql I get the error message: "FATAL: invalid command-line arguments for server
process.HINT: Try "postgres --help" for more information." 

However, when I start the server with: postgres -c default_tablespace='pgdata'
it works.

What am I missing?

The OS is Windows xp Pro sp3. PostgreSQL version: 8.3.5.

BTW: Why aren't new databases created in the 'new' tablespace? Just because it's not a dbspace but a tablespace? It
wouldbe much more convenient if the createdb commands would make use of the default_tablespace setting as it's the case
withtables. 

Thank you very much,

Peter Seifert


--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Re: PGOPTIONS and default_tablespace

From
Thomas Markus
Date:
hi,

try

set PGOPTIONS="-c default_tablespace='pgdata'"

regards
thomas



Jan-Peter.Seifert@gmx.de schrieb:
> Hello,
>
> without success I tried to set the default tablespace via the environment variable PGOPTIONS.
>
> My tries:
> set PGOPTIONS="default_tablespace='pgdata'"
> set PGOPTIONS=default_tablespace='pgdata'
> set PGOPTIONS=default_tablespace(pgdata)
> set PGOPTIONS=default_tablespace('pgdata')
>
>


Attachment

Re: PGOPTIONS and default_tablespace

From
Jan-Peter.Seifert@gmx.de
Date:
Hello Thomas,

thank you very much for your quick reply. However, this version doesn't work either - at least on Windows.

Peter

> try
>
> set PGOPTIONS="-c default_tablespace='pgdata'"

> > without success I tried to set the default tablespace via the
> environment variable PGOPTIONS.
> >
> > My tries:
> > set PGOPTIONS="default_tablespace='pgdata'"
> > set PGOPTIONS=default_tablespace='pgdata'
> > set PGOPTIONS=default_tablespace(pgdata)
> > set PGOPTIONS=default_tablespace('pgdata')
> >
> >
>

--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Re: PGOPTIONS and default_tablespace

From
"Scott Marlowe"
Date:
On Mon, Jan 12, 2009 at 2:34 AM,  <Jan-Peter.Seifert@gmx.de> wrote:
> Hello,
>
> without success I tried to set the default tablespace via the environment variable PGOPTIONS.
>
> My tries:
> set PGOPTIONS="default_tablespace='pgdata'"
> set PGOPTIONS=default_tablespace='pgdata'
> set PGOPTIONS=default_tablespace(pgdata)
> set PGOPTIONS=default_tablespace('pgdata')
>
> When I try to connect to the server via psql I get the error message: "FATAL: invalid command-line arguments for
serverprocess. HINT: Try "postgres --help" for more information." 

I do this one of two ways usually.  Either I set the user / database
to have a default tablespace permanently via alter user / database, or
I put it at the top of my script I'm running.  PGOPTIONS isn't really
the place I think of setting it myself.

Re: PGOPTIONS and default_tablespace

From
Jan-Peter.Seifert@gmx.de
Date:
Hello Scott,

> Date: Mon, 12 Jan 2009 13:09:19 -0700
> From: "Scott Marlowe" <scott.marlowe@gmail.com>

> > without success I tried to set the default tablespace via the
> environment variable PGOPTIONS.
> >
> > My tries:
> > set PGOPTIONS="default_tablespace='pgdata'"
...

> I do this one of two ways usually.  Either I set the user / database
> to have a default tablespace permanently via alter user / database, or
> I put it at the top of my script I'm running.  PGOPTIONS isn't really
> the place I think of setting it myself.

The ALTER USER way works perfectly. Thanks a lot!

There's just one detail I'm not happy with.:
http://www.postgresql.org/docs/8.3/interactive/manage-ag-tablespaces.html

"If a database is created without specifying a tablespace for it, it uses the same tablespace as the template database
itis copied from." 

It would be really nice if the create db commands would follow the default_tablespace setting as well.

Thank you very much,

Peter Seifert

--
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a