Skip site navigation (1) Skip section navigation (2)

Bad timestamp external representation

From: Mark Tessier <m_tessier(at)sympatico(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Bad timestamp external representation
Date: 2003-04-28 20:45:54
Message-ID: 20030428164554.6165d41b.m_tessier@sympatico.ca (view raw or flat)
Thread:
Lists: pgsql-general
Hi,

When I try to insert with the "current" constant, as in:

herboris=> INSERT INTO cart (cartid, clientid, invdate, paydate) VALUES
herboris-> (4469858, 2, 'current_timestamp', 'now');

I get the following message:

ERROR:  Bad date external representation 'current_timestamp'

This is how my table is set up:

/* -------------------------------------------------------- 
  Table structure for table "cart" 
-------------------------------------------------------- */
CREATE TABLE "cart" (
   "cartid" int8 NOT NULL,
   "clientid" varchar(8) NOT NULL,
   "packnum" varchar(20),
   "shipcost" numeric(5,2),
   "prepinit" varchar(2),
   "order_by" varchar(12),
   "paytype" varchar(20),
   "invdate" date NOT NULL,
   "paydate" date,
   CONSTRAINT "cart_pkey" PRIMARY KEY ("cartid")
);
GRANT ALL ON "cart" TO "apache";
GRANT ALL ON "cart" TO "mark";

ALTER TABLE "cart" ALTER COLUMN "invdate" SET DEFAULT 'now';

I changed "paytype" to type "timestamp" and that didn't work either. Could someone please tell me what "Bad external representation" means, and hopefully what I'm doing wrong.

-- 
Thanks,

Mark


Responses

pgsql-general by date

Next:From: scott.marloweDate: 2003-04-28 20:50:43
Subject: Re: set passwd for users
Previous:From: Johnson, ShaunnDate: 2003-04-28 20:34:58
Subject: set passwd for users

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group