Re: DB insert Error

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: DB insert Error
Дата
Msg-id 20060816053802.GA48210@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: DB insert Error  ("Jasbinder Bali" <jsbali@gmail.com>)
Ответы Re: DB insert Error  ("Jasbinder Bali" <jsbali@gmail.com>)
Re: DB insert Error  ("Jasbinder Bali" <jsbali@gmail.com>)
Список pgsql-general
On Wed, Aug 16, 2006 at 01:20:08AM -0400, Jasbinder Bali wrote:
> This is how the array is formed in my C code
> -------------------------------------------------------------------------------------------
> FILE   *fp;
>
> while(!feof(fp))
>      {ch[i]=fgetc(fp);
>       if(ch[i]=='\n') lines++;       i++;      }
>    ch[i-1]='\0';
>    fclose(fp);
> ------------------------------------------------------------------------------
> and then am inserting ch as a whole in the varchar column in the database.
>
> Do you want me to append a leading '{' and a trailing '}' to ch??

Do you intend to handle the data as an array in SQL?  If not then
the raw_email column should be declared as varchar or text instead
of varchar[].  In that case your C code won't need to change.

--
Michael Fuhr

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

Предыдущее
От: "Harpreet Dhaliwal"
Дата:
Сообщение: Trigger (Calling a Procedure)
Следующее
От: "Jasbinder Bali"
Дата:
Сообщение: Re: DB insert Error