Pessoal,
como faço para descobrir a(o) tablespace default do banco?

dmonitor=> select dattablespace from pg_database where datname='dmonitor';
 dattablespace
---------------
         16390          ---> e daí?
(1 row)

Euler,
talvez o comando abaixo não exiba o nome de tablespaces default de banco (o
que seria, talvez, estranho).

Att.,
Sergio

2009/6/20 sergio nogueira <[email protected]>

> Bom dia, Euler.
>
> dmonitor=> select version();
>                                                   version
>
> ------------------------------------------------------------------------------------------------------------
>  PostgreSQL 8.4rc1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.3.2
> 20081105 (Red Hat 4.3.2-7), 32-bit
> (1 row)
>
> Red Hat -> Fedora 10
>
> Inseri uma linha e ...
>
> dmonitor=> insert into whattbs(id) values(1);
> INSERT 17464 1
> dmonitor=>
>
> dmonitor=> select tablename, tablespace from pg_tables where
> tablename='whattbs';
>  tablename | tablespace
> -----------+------------
>  whattbs   |
> (1 row)
>
> Att.,
> Sergio Nogueira
>
>
> 2009/6/20 Euler Taveira de Oliveira <[email protected]>
>
> sergio nogueira escreveu:
>> > Em que tablespace está a tabela?
>> >
>> Funciona aqui. Qual versão?
>>
>> psql (8.4beta2)
>> Digite "help" para ajuda.
>>
>> euler=# \! mkdir /tmp/foo
>> euler=# create tablespace footbs location '/tmp/foo';
>> CREATE TABLESPACE
>> euler=# create table foo (a int);
>> CREATE TABLE
>> euler=# insert into foo select generate_series(1, 10);
>> INSERT 0 10
>> euler=# select tablename,tablespace from pg_tables where tablename='foo';
>>  tablename | tablespace
>> -----------+------------
>>  foo       |
>> (1 row)
>>
>> euler=# alter table foo set tablespace footbs;
>> ALTER TABLE
>> euler=# select tablename,tablespace from pg_tables where tablename='foo';
>>  tablename | tablespace
>> -----------+------------
>>  foo       | footbs
>> (1 row)
>>
>>
>> --
>>  Euler Taveira de Oliveira
>>  http://www.timbira.com/
>> _______________________________________________
>> pgbr-geral mailing list
>> [email protected]
>> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>>
>
>
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a