Re: EXCEPT doesn't compare TIMESTAMP type?
От
dipti shah
Тема
Re: EXCEPT doesn't compare TIMESTAMP type?
Дата
Msg-id
v2nd5b05a951004230417p820091a6w914d25fd0ef2e50e@mail.gmail.com
Ответ на
Re: EXCEPT doesn't compare TIMESTAMP type? (Raymond O'Donnell)
Список
Дерево обсуждения
EXCEPT doesn't compare TIMESTAMP type? dipti shah <shahdipti1980@gmail.com>
Re: EXCEPT doesn't compare TIMESTAMP type? Raymond O'Donnell <rod@iol.ie>
Re: EXCEPT doesn't compare TIMESTAMP type? dipti shah <shahdipti1980@gmail.com>
Re: EXCEPT doesn't compare TIMESTAMP type? Alexandr Popov <alexandr.popov@nexui.com>
Re: EXCEPT doesn't compare TIMESTAMP type? Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Re: EXCEPT doesn't compare TIMESTAMP type? dipti shah <shahdipti1980@gmail.com>
Re: EXCEPT doesn't compare TIMESTAMP type? Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Re: EXCEPT doesn't compare TIMESTAMP type? dipti shah <shahdipti1980@gmail.com>
Re: EXCEPT doesn't compare TIMESTAMP type? Thomas Kellerer <spam_eater@gmx.net>
Re: EXCEPT doesn't compare TIMESTAMP type? Grzegorz Jaśkiewicz <gryzman@gmail.com>
Thanks but I don't have text type in my table.
sysdb=# \d changelogtest
...
...
Table "sysdb.changelogtest"
Column | Type | Modifiers
----------------+-----------------------------+------------------------------------------
id | integer | not null
txid | integer | not null default txid_current()
txtime | timestamp without time zone | not null default transaction_timestamp()
Foreign-key constraints:
"changelogtest_id_fkey" FOREIGN KEY (id) REFERENCES logtable(id)
Column | Type | Modifiers
----------------+-----------------------------+------------------------------------------
id | integer | not null
txid | integer | not null default txid_current()
txtime | timestamp without time zone | not null default transaction_timestamp()
Foreign-key constraints:
"changelogtest_id_fkey" FOREIGN KEY (id) REFERENCES logtable(id)
Moreover, the query behaves differently when I proive brackates after SELECT in second query.
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 timestamp without time zone cannot be matched
LINE 2: except select id, txid, txtime
^
techdb=# INSERT INTO changelogtest (id, txid, txtime) values (5, 123, 'now')
except select (id, txid, txtime)
from changelogtest
where id=5;
ERROR: each EXCEPT query must have the same number of columns
LINE 2: except select (id, txid, txtime)
^
Below works:
except select id, txid, txtime
from changelogtest
where id=5;
ERROR: EXCEPT types text and timestamp without time zone cannot be matched
LINE 2: except select id, txid, txtime
^
techdb=# INSERT INTO changelogtest (id, txid, txtime) values (5, 123, 'now')
except select (id, txid, txtime)
from changelogtest
where id=5;
ERROR: each EXCEPT query must have the same number of columns
LINE 2: except select (id, txid, txtime)
^
Below works:
techdb=# INSERT INTO changelogtest (id, txid) values (5, 123)
except select id, txid
from changelogtest
where id=5;
INSERT 0 0
except select id, txid
from changelogtest
where id=5;
INSERT 0 0
I don't know how to resolve my issue. Could you please help me out.
Thanks,
Dipti
On Fri, Apr 23, 2010 at 4:08 PM, Raymond O'Donnell <rod@iol.ie> wrote:
On 23/04/2010 11:31, dipti shah wrote:Try adding a cast to one of them.
> ERROR: EXCEPT types text and timestamp without time zone cannot be matched
> LINE 2: except select id, txid, txtime
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie
В списке pgsql-general по дате отправления