Kumpulan data saya berisi kolom tahun, bulan, hari, jam, menit, dan detik terpisah sebagai berikut yang dipisahkan oleh spasi:
+-------------------+
|2007|09|28|21|14|06|
|2007|09|28|21|14|06|
|2007|09|28|21|14|06|
|2007|09|28|21|14|06|
|2007|09|28|21|14|06|
+-------------------+
Saya ingin mengintegrasikannya sebagai satu kolom di bawah tipe data stempel waktu. Saya telah membuat kolom baru dalam tipe data stempel waktu dan memperbarui kolom dengan kode berikut:
Update s2
set dt = year || '-' || month || '-' || day
|| ' ' || hour || ':' || min || ':' || second
Tapi saya menghadapi kesalahan berikut:
ERROR: column "dt" is of type timestamp without time zone but expression is of type text
LINE 1: Update temp set dt= year || '-' || month || '-' || day ||...
^
HINT: You will need to rewrite or cast the expression.
********** Error **********
ERROR: column "dt" is of type timestamp without time zone but expression is of type text
SQL state: 42804
Hint: You will need to rewrite or cast the expression.
Character: 22
Selain itu, saya dapat melakukan integrasi sebelumnya dengan tipe data varchar
.
column "dt" is of type timestamp without time zone but expression is of type text, You will need to rewrite or cast the expression.
Sepertinya itu nasihat yang bagus. Apakah Anda mencobanya? - person Mat   schedule 18.11.2012