Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread dipti shah
Thanks again Alban. I didn't mention but if I remove the braces then it gives below error but the meaning is same as the error when I specify braces. techdb=# SELECT insert_history_info(); ERROR: error from Perl function "insert_history_info": each EXCEPT query must have the same number of column

Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread Alban Hertroys
On 23 Apr 2010, at 14:28, dipti shah wrote: > Great! Thanks Alban, Alexander, and Thomas. > > That solved the issue but could you tell me what is the issue when I give > brackets in second query? > > techdb=# INSERT INTO changelogtest (id, txid, txtime) values (5, 123, now()) > except select

Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread dipti shah
Great! Thanks Alban, Alexander, and Thomas. That solved the issue but could you tell me what is the issue when I give brackets in second query? techdb=# INSERT INTO changelogtest (id, txid, txtime) values (5, 123, now()) except *select id, txid, txtime *from changelogtest where id=5; INSERT 0 1

Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread Alban Hertroys
On 23 Apr 2010, at 13:17, dipti shah wrote: For this case you're using 3 values in the first half of the expression and only 1 in the second: > techdb=# INSERT INTO changelogtest (id, txid, txtime) > values (5, 123, 'now') ^^ ^^^ --- 3 columns, namely int, int & text. > except > s

Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread Alexandr Popov
On Friday 23 April 2010 14:17:32 dipti shah wrote: > Thanks but I don't have text type in my table. But you are trying to insert text value 'now' into table, that's why appears this error. If you want to insert current time try using function now() not text 'now' In Your case insert should be f

Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread Thomas Kellerer
dipti shah, 23.04.2010 13:17: Thanks but I don't have text type in my table. sysdb=# \d changelogtest techdb=# INSERT INTO changelogtest (id, txid, txtime) values (5, 123, 'now') except select id, txid, txtime from changelogtest where id=5; 'now' *is* a text type value Thomas -- Sent via pgs

Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread dipti shah
Thanks but I don't have text type in my table. sysdb=# \d changelogtest ... Table "sysdb.changelogtest" Column |Type |Modifiers +-+--

Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread Raymond O'Donnell
On 23/04/2010 11:31, dipti shah wrote: > ERROR: EXCEPT types text and timestamp without time zone cannot be matched > LINE 2: except select id, txid, txtime Try adding a cast to one of them. Ray. -- Raymond O'Donnell :: Galway :: Ireland r...@iol.ie -- Sent via pgsql-general mailing list (

Re: [GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread Grzegorz Jaƛkiewicz
it tells you that it is not able to compare timestamp with text. Different types. Cast if you have to explicitly. -- GJ

[GENERAL] EXCEPT doesn't compare TIMESTAMP type?

2010-04-23 Thread dipti shah
Hi, could anyone please tell me what is wrong in below query. Does it mean that EXCEPT doesn't allow comparing TIMESTAMP type? techdb=# INSERT INTO changelogtest (id, txid, txtime) values (5, 123, 'now') except select id, txid, txtime from changelogtest where id=5; ERROR: EXCEPT types text and t