I have created a table
CREATE TABLE mytable
(food VARCHAR(20) references myfood(BIN)
,name NUMERIC(2)
,servingsize VARCHAR(15)
,time TIMESTAMP
,PRIMARY KEY(food, time)
);
and what I want is to insert data in to this table which I use:
INSERT INTO dinnertime (food, name, servingsize, time) VALUES
('earl', 3, 'one cup', '1300'),
('phebeo', 2, 'two cup', '1100'),
('apollo', 1, 'one Cup', '0700'),
('oscar', 4, 'one cup', '2200');
But PostgrSQL does not let me do this. The problem is with the time. What changes do I need to make to my table for it to take this format of time
Use time instead of timestamp (timestamp is date + time, you only have time), then convert to one of the recognized formats for time:
http://www.postgresql.org/docs/8.0/static/datatype-datetime.html