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
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
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
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
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
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
Thanks but I don't have text type in my table.
sysdb=# \d changelogtest
...
Table "sysdb.changelogtest"
Column |Type |Modifiers
+-+--
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 (
it tells you that it is not able to compare timestamp with text. Different
types. Cast if you have to explicitly.
--
GJ
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
10 matches
Mail list logo