Re: Date format for bulk copy

Поиск
Список
Период
Сортировка
От David Rysdam
Тема Re: Date format for bulk copy
Дата
Msg-id 416D83EA.1000701@ll.mit.edu
обсуждение исходный текст
Ответ на Re: Date format for bulk copy  (Michael Fuhr <mike@fuhr.org>)
Ответы Re: Date format for bulk copy
Список pgsql-general
Michael Fuhr wrote:

>On Wed, Oct 13, 2004 at 01:32:01PM -0400, David Rysdam wrote:
>
>
>>Michael Fuhr wrote:
>>
>>
>>>You could filter the data through a script that reformats certain
>>>fields, then feed the reformatted data to PostgreSQL.  This is
>>>usually a trivial task for Perl, awk, sed, or the like.
>>>
>>>
>>>
>>Right, I *can* do this.  But then I have to build knowledge into that
>>script so it can find each of these date fields (there's like 20 of them
>>across 10 different files) and then update that knowledge each time it
>>changes.
>>
>>
>
>In your case that's a reasonable argument against filtering the
>data with a script.  Using a regular expression in the script might
>reduce or eliminate the need for some of the logic, but then you'd
>run the risk of reformatting data that shouldn't have been touched.
>
>
>
>>I'm still leaning towards just making postgres accept at ':'
>>delimiter for milliseconds.
>>
>>
>
>Based on your requirements, that might indeed be a better solution.
>I'd probably choose to extend PostgreSQL rather than hack what
>already exists, though.  Doing the latter might break something
>else and you have to remember to add the hack every time you upgrade
>the server software.  That can cause headaches for whoever inherits
>the system from you unless it's well-documented.
>
>
>
By "extend PostgreSQL" do you mean create a custom input_function for
timestamp?  Are there docs that give hints for replacing the input
function of an existing type?  Someone else replied similarly, but I'm
afraid I'm not familiar enough with PG to decipher it all.

>>Why not the user-defined type with associated user-defined input function?
>>
>>
>
>If filtering the data is awkward, then that might be a better way
>to go.
>
>
I think I will, when I get to that point.


В списке pgsql-general по дате отправления:

Предыдущее
От: Pierre-Frédéric Caillaud
Дата:
Сообщение: Re: Date format for bulk copy
Следующее
От: phil campaigne
Дата:
Сообщение: correct representation of timestamp difference