how to store more than 3 MB of character data in Postgres Varchar field

Поиск
Список
Период
Сортировка
От Vadivel Subramaniam
Тема how to store more than 3 MB of character data in Postgres Varchar field
Дата
Msg-id OFD54B33E3.AEC7F197-ON65257018.00386389-65257018.00388347@flextronicssoftware.com
обсуждение исходный текст
Ответы Re: how to store more than 3 MB of character data in Postgres  (Richard Huxton <dev@archonet.com>)
Re: how to store more than 3 MB of character data in Postgres Varchar field  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql



Hi,

We have  a requirement wherein we have to store around 3 MB of data in
Postgres database.

We had gone through the postgres website
http://www.postgresql.org/docs/7.4/interactive/datatype-character.html#DATATYPE-CHARACTER-SPECIAL-TABLE


The above link says "varchar" can store upto 1 GB of data.  But when i try
to insert using ODBC API's the varchar field takes
only 65484 characters.    But i could insert more characters using INSERT
SQL command.  Even in this case when we fetch the data it reads only 65540
characters. Remaining data is not read from the varchar field.

We have tried in 2 ways

1. table is created without any limit specified for varchar.     create table details (name varchar, data varchar);

2. create table utilntmlscripts (name character varying, data character
varying(10485770));     ERROR:  length for type 'varchar' cannot exceed 10485760     It's not allowing more than 10 MB
ofsize during table creation.
 


Is there anything needs to be configured to make the varchar field to
support upto 1 GB.
Even if it does not support 1 GB, can we store & retrieve atleast 10 MB of
character data
in Varchar field?

Please send the details of how this can be acheived.

Postgres Version 7.4.2
Accessing using UnixODBC driver from C++ application.

thanks,
Vadivel.

***********************  FSS-Private   ***********************
"DISCLAIMER: This message is proprietary to Flextronics Software Systems
Limited (FSS) and is intended solely for the use of the
individual to whom it is addressed. It may contain  privileged or
confidential information and should not be circulated or used for
any purpose other than for what it is intended. If you have received this
message in  error, please notify the originator immediately.
If you are not the intended recipient, you are notified that you are
strictly  prohibited  from  using, copying, altering, or disclosing
the contents of this message.  FSS  accepts no  responsibility  for loss or
damage arising from the use of  the information transmitted
by this email including damage from virus."



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

Предыдущее
От: KÖPFERL Robert
Дата:
Сообщение: Re: How do write a query...
Следующее
От: KÖPFERL Robert
Дата:
Сообщение: Re: Returning a Cross Tab record set from a function