From: Najm Hashmi <najm@mondo-live.com>
To: pgsql <pgsql-sql@postgresql.org>
Subject: Wierd postgres Problem
Date: Tue, 13 Feb 2001 10:20:09 -0500
Message-ID: <3A8950A9.B8D51FCB@mondo-live.com> (raw)
Hi All,
I am trying to define a new set of tables an I am getting this strange
syntex problem on date, or timestamp data types. I am also getting error on
not null constranit as well... Postgres is behaving strangely.... first
definations with not null
cmdb=# create table media_received (
cmdb(# comp_id not null,
cmdb(# dept_id not null,
cmdb(# date_rec timestamp default 'now',
cmdb(# units int4 default 0,
cmdb(# media_type varchar(64),
cmdb(# enqued int4 check (enqued=<units),
cmdb(# encoded int4 check(encoded=<enqued),
cmdb(# insys int4 check(insys=<encoded),
cmdb(# constraint media_rec_pk primary key(comp_id,dept_id,date_rec),
cmdb(# constraint media_dept_fk foreign key(dept_id) references department,
cmdb(# constraint media_comp_fk foreign key(comp_id) references company
cmdb(# );
ERROR: parser: parse error at or near "not"
Second definition without not null and data type timestamp,
cmdb=# create table media_received (
cmdb(# comp_id,
cmdb(# dept_id,
cmdb(# date_rec timestamp,
cmdb(# units int4 default 0,
cmdb(# media_type varchar(64),
cmdb(# enqued int4 check (enqued=<units),
cmdb(# encoded int4 check(encoded=<enqued),
cmdb(# insys int4 check(insys=<encoded),
cmdb(# constraint media_rec_pk primary key(comp_id,dept_id,date_rec),
cmdb(# constraint media_dept_fk foreign key(dept_id) references department,
cmdb(# constraint media_comp_fk foreign key(comp_id) references company
cmdb(# );
ERROR: parser: parse error at or near "timestamp"
3rd def with date as data type:
cmdb=# create table media_received (
cmdb(# comp_id,
cmdb(# dept_id,
cmdb(# date_rec date,
cmdb(# units int4 default 0,
cmdb(# media_type varchar(64),
cmdb(# enqued int4 check (enqued=<units),
cmdb(# encoded int4 check(encoded=<enqued),
cmdb(# insys int4 check(insys=<encoded),
cmdb(# constraint media_rec_pk primary key(comp_id,dept_id,date_rec),
cmdb(# constraint media_dept_fk foreign key(dept_id) references department,
cmdb(# constraint media_comp_fk foreign key(comp_id) references company
cmdb(# );
ERROR: parser: parse error at or near "date"
is something wrong with my table definition syntex?
All kind of help is appreciated.
Regards, Najm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: najm@mondo-live.com
Subject: Re: Wierd postgres Problem
In-Reply-To: <3A8950A9.B8D51FCB@mondo-live.com>
References: <3A8950A9.B8D51FCB@mondo-live.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox