Обсуждение: help postgres

Поиск
Список
Период
Сортировка

help postgres

От
"petite-etoile@voila.fr"
Дата:
Hy,



I need some help in Postgres, my problem :

I've got a script in which there is :

create sequence num_fa;

create table hst_fa(
id_ori__nom text,
id_ori char(12),
nom char(32),
number int4 not null default nextval('num_fa'),
comment text,
id_f char(8),
gr char(1),
type char(8),
date_app timestamp,
date_cor timestamp,
corrige text,
primary key(id_ori__nom,date_app)
);


I must have date_app in primary key because number is not enought.


Postgres message is :

NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'hst_fa_pkey' for table 'hst_fa'
ERROR: Can't find a default operator class for type 1296.


I've got for example many queries with "INSERT INTO ...." for the database.
If I already had the same queries I want to stop the "INSERT ..." and read the following queries to apply it on the
database.


should I use �cast� to write this in the script :


create table hst_fa(
id_ori__nom text,
id_ori char(12),
nom char(32),
number int4 not null default nextval('num_fa'),
comment text,
id_f char(8),
gr char(1),
type char(8),
date_app timestamp,
date_cor timestamp,
corrige text,
primary key(id_ori__nom, select d (cast date_app as text))
);



thanks

Pe

____________________________________________________________
Faites un voeu et puis Voila ! www.voila.fr
Avec Voila Mail, consultez vos e-mails sur votre mobile Wap.


Re: help postgres

От
Tom Lane
Дата:
"petite-etoile@voila.fr"<petite-etoile@voila.fr> writes:
> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'hst_fa_pkey' for table 'hst_fa'
> ERROR: Can't find a default operator class for type 1296.

Time to update your Postgres.  That must be 6.5 or even older.

If you can't update right now, use 'datetime' not 'timestamp' ... but
really you *need* to update.

            regards, tom lane