Oswaldo,
pelo que entendi, voce pode criar a tabela com oids. mas depois de criada,
nada feito:
segue trechos dos 'alter table ...'

8.2
...

    CLUSTER ON *index_name*
    SET WITHOUT CLUSTER
    SET WITHOUT OIDS
    SET ( *storage_parameter* = *value* [, ... ] )
    RESET ( *storage_parameter* [, ... ] )
    INHERIT *parent_table*

8.3

    ENABLE ALWAYS RULE *rewrite_rule_name*
    CLUSTER ON *index_name*
    SET WITHOUT CLUSTER
    SET WITHOUT OIDS
    SET ( *storage_parameter* = *value* [, ... ] )
    RESET ( *storage_parameter* [, ... ] )
    INHERIT *parent_table*

8.4


    ENABLE REPLICA RULE *rewrite_rule_name*
    ENABLE ALWAYS RULE *rewrite_rule_name*
    CLUSTER ON *index_name*
    SET WITHOUT CLUSTER
    SET WITH OIDS
    SET WITHOUT OIDS
    SET ( *storage_parameter* = *value* [, ... ] )
    RESET ( *storage_parameter* [, ... ] )


Att.,
Sergio

2009/6/24 Osvaldo Kussama <[email protected]>

> 2009/6/24 sergio nogueira <[email protected]>
> >
> > Pessoal,
> > no PostgreSQl abaixo
> > foi criada uma tabela sem oids de colunas. Agora preciso deste campo.
> > O comando retorna a mensagem:
> >   bdx => alter table tabelax set with oids;   (funciona no 8.4.rc1)
> >   ERROR:  syntax error at or near "with oids"
> >   LINE 1: alter table cv2samge set with oids;
> >
> > PostgreSQL 8.2.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.6
> 20060404 (Red Hat 3.4.6-3)
> >
> > Pelo que entendi do manual, nesta versão não existe oids para tabelas de
> usuários.
> >
> > Haveria alguma outra opção? Acrescentei novos campos mas a tabela não tem
> um identificador de linha para que eu pudesse executar o update destes
> campos (update tabelax set novo_campo1 = valor where id_da_linha = valor1,
> novo_campo2 = valor2;
> >
>
>
> Do manual:
> http://www.postgresql.org/docs/8.2/interactive/sql-altertable.html
> "Note:  While CREATE TABLE allows OIDS to be specified in the WITH
> (storage_parameter) syntax, ALTER TABLE does not treat OIDS as a
> storage parameter."
>
> Atenção para a consideração:
> "The use of OIDs in user tables is considered deprecated, so most
> installations should leave this variable disabled."
>
> http://www.postgresql.org/docs/8.2/interactive/runtime-config-compatible.html#RUNTIME-CONFIG-COMPATIBLE-VERSION
>
> A recomendação é que seja criada uma chave primária SERIAL (caso não
> exista uma chave natural).
>
> Osvaldo
> _______________________________________________
> 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