vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello List, Is it possible to import in a TIMESTAMP(6) field a timestamp in which the format of hour is HH.MM.SS (and not HH:MM:SS) ? In the documentation, at http://www.postgresql.org/docs/8.2/i...TYPE-TIMEZONES, I didn't find this format. So can I think that it is not possible to import this kind of hour in PostgreSQL ? (I work with PostgreSQL 8.2.0). Any workaround to do that ? Thanks in advance for the reply. Best Regards, Alexandra DANTE ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| |||
| am Thu, dem 01.02.2007, um 15:58:08 +0100 mailte DANTE Alexandra folgendes: > Hello List, > > Is it possible to import in a TIMESTAMP(6) field a timestamp in which > the format of hour is HH.MM.SS (and not HH:MM:SS) ? > In the documentation, at > http://www.postgresql.org/docs/8.2/i...TYPE-TIMEZONES, > I didn't find this format. > So can I think that it is not possible to import this kind of hour in > PostgreSQL ? (I work with PostgreSQL 8.2.0). > Any workaround to do that ? test=# select replace('2007-01-01 12.00.00', '.',':')::timestamp; replace --------------------- 2007-01-01 12:00:00 (1 row) Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match |
| |||
| am Thu, dem 01.02.2007, um 16:13:28 +0100 mailte A. Kretschmer folgendes: > am Thu, dem 01.02.2007, um 15:58:08 +0100 mailte DANTE Alexandra folgendes: > > Hello List, > > > > Is it possible to import in a TIMESTAMP(6) field a timestamp in which > > the format of hour is HH.MM.SS (and not HH:MM:SS) ? > > In the documentation, at > > http://www.postgresql.org/docs/8.2/i...TYPE-TIMEZONES, > > I didn't find this format. > > So can I think that it is not possible to import this kind of hour in > > PostgreSQL ? (I work with PostgreSQL 8.2.0). > > Any workaround to do that ? > > test=# select replace('2007-01-01 12.00.00', '.',':')::timestamp; > replace > --------------------- > 2007-01-01 12:00:00 > (1 row) If you want to COPY such data in a table, you can first COPY the data in a temp. table with TEXT-columns and then insert from this table the data into the destination table and convert the data using the way above. Or, convert the input-data with usual text-tools like sed or awk. HTH, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| ||||
| Thank you Andreas, I had thought about this solution but in my case, it is not really possible to do that... I am converting an Oracle database to PostgreSQL 8.2.0 via ora2pg which allows me to extract the tables, data, ... The timestamp extracted from Oracle have the format "DD-MON-YY HH.MI.SSXFF AM" and I am trying to import them in a TIMESTAMP(6) via a "COPY" command in PostgreSQL. I tried to modify "lc_time" and others "lc_*" variables to import this format but I didn't find the good solution... How can I import these dates without using the "replace" function ? Any suggestions ? Regards, Alexandra A. Kretschmer wrote: >am Thu, dem 01.02.2007, um 15:58:08 +0100 mailte DANTE Alexandra folgendes: > > >>Hello List, >> >>Is it possible to import in a TIMESTAMP(6) field a timestamp in which >>the format of hour is HH.MM.SS (and not HH:MM:SS) ? >>In the documentation, at >>http://www.postgresql.org/docs/8.2/i...TYPE-TIMEZONES, >>I didn't find this format. >>So can I think that it is not possible to import this kind of hour in >>PostgreSQL ? (I work with PostgreSQL 8.2.0). >>Any workaround to do that ? >> >> > >test=# select replace('2007-01-01 12.00.00', '.',':')::timestamp; > replace >--------------------- > 2007-01-01 12:00:00 >(1 row) > > >Andreas > > ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |