Re: COPY for .CSV files problem

Поиск
Список
Период
Сортировка
От Jorge Godoy
Тема Re: COPY for .CSV files problem
Дата
Msg-id 200710010635.39894.jgodoy@gmail.com
обсуждение исходный текст
Ответ на COPY for .CSV files problem  (pere roca <peroc79@gmail.com>)
Список pgsql-general
On Monday 01 October 2007 05:20:52 pere roca wrote:
>   Hi everybody,
>   I want to enter a .CSV file using COPY comand and plpgsql. It enters
> lat,lon and some data. In the CSV data there is no field (such as
> "user_name" or current_time) that allow distinguish future queries for
> different users (ex: select x,y from table where user_name=z; after
> entering lat,lon I would like to update the_geom in  another table using
> the lat,lon of ONLY this user).
>
>   I could update this kind of data ("user_name") using php but next user
> could not enter his data by COPY (it only lets fill the destination table
> if ALL the fields are the same as the CSV or text file).
>   So, I have a problem. I thought that may be I can reference/select data
> of a SINGLE USER using parameters like default_time without need to insert
> this data as a field in the table (otherwise, problems with COPY). Maybe
> can I use catalog?

COPY won't allow you to process your data.  You either write something to
insert record by record or you change your data to include the needed
information before using COPY.

I would change the input file to include the user name.


--
Jorge Godoy      <jgodoy@gmail.com>


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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: 3 tables join update
Следующее
От: "Anoo Sivadasan Pillai"
Дата:
Сообщение: ERROR: invalid byte sequence from psql - Works perfectly from pgAdmin III query window