Обсуждение: data type to store a lot of text and tables of data

Поиск
Список
Период
Сортировка

data type to store a lot of text and tables of data

От
Karina Guardado
Дата:
Hi,

Is there a special data type to use to store a lot of text and tables of data in a column or attribute?

thanks in advance,

regards,

karina
El Salvador, Centroamerica
#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}

Re: data type to store a lot of text and tables of data

От
Szymon Guz
Дата:


2010/3/24 Karina Guardado <kguardado@gmail.com>
Hi,

Is there a special data type to use to store a lot of text and tables of data in a column or attribute?

thanks in advance,

regards,

karina
El Salvador, Centroamerica

Normally text can be stored in a type named "TEXT". Maybe there would be some other solution to speed things up, but first define how much is "a lot of".

regards
Szymon Guz

Re: data type to store a lot of text and tables of data

От
Raymond O'Donnell
Дата:
On 24/03/2010 21:48, Karina Guardado wrote:
> Hi,
>
> Is there a special data type to use to store a lot of text and tables of
> data in a column or attribute?

For large amounts of text, just use the TEXT data type:

    http://www.postgresql.org/docs/8.4/static/datatype-character.html

Not sure what you mean by "tables of data".

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: data type to store a lot of text and tables of data

От
Karina Guardado
Дата:
for example something like the following :

Table 9-25. Date/Time Operators

OperatorExampleResult
+date '2001-09-28' + integer '7'date '2001-10-05'
+date '2001-09-28' + interval '1 hour'timestamp '2001-09-28 01:00:00'
+date '2001-09-28' + time '03:00'timestamp '2001-09-28 03:00:00'
+interval '1 day' + interval '1 hour'interval '1 day 01:00:00'
+timestamp '2001-09-28 01:00' + interval '23 hours'timestamp '2001-09-29 00:00:00'
+time '01:00' + interval '3 hours'time '04:00:00'
-- interval '23 hours'interval '-23:00:00'
-date '2001-10-01' - date '2001-09-28'integer '3'
-date '2001-10-01' - integer '7'date '2001-09-24'
-date '2001-09-28' - interval '1 hour'timestamp '2001-09-27 23:00:00'
-time '05:00' - time '03:00'interval '02:00:00'
-time '05:00' - interval '2 hours'time '03:00:00'
-timestamp '2001-09-28 23:00' - interval '23 hours'timestamp '2001-09-28 00:00:00'
-interval '1 day' - interval '1 hour'interval '1 day -01:00:00'
-timestamp '2001-09-29 03:00' - timestamp '2001-09-27 12:00'interval '1 day 15:00:00'
*900 * interval '1 second'interval '00:15:00'
*21 * interval '1 day'interval '21 days'
*double precision '3.5' * interval '1 hour'interval '03:30:00'
/interval '1 hour' / double precision '1.5'interval '00:40:00'


is it possible? or is better to use an atached file and store it ? and what should be the data type to store a file that can be xls, doc, pdf for example.
#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;
On Wed, Mar 24, 2010 at 3:55 PM, Raymond O'Donnell <rod@iol.ie> wrote:
On 24/03/2010 21:48, Karina Guardado wrote:
> Hi,
>
> Is there a special data type to use to store a lot of text and tables of
> data in a column or attribute?

For large amounts of text, just use the TEXT data type:

   http://www.postgresql.org/docs/8.4/static/datatype-character.html

Not sure what you mean by "tables of data".

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: data type to store a lot of text and tables of data

От
Raymond O'Donnell
Дата:
On 24/03/2010 22:01, Karina Guardado wrote:
> for example something like the following :
>
> *Table 9-25. Date/Time Operators*
>
> Operator    Example    Result
> +     date '2001-09-28' + integer '7'    date '2001-10-05'
> +     date '2001-09-28' + interval '1 hour'    timestamp '2001-09-28 01:00:00'
> +     date '2001-09-28' + time '03:00'     timestamp '2001-09-28 03:00:00'
> +     interval '1 day' + interval '1 hour'    interval '1 day 01:00:00'
> +     timestamp '2001-09-28 01:00' + interval '23 hours'    timestamp
> '2001-09-29 00:00:00'
> +     time '01:00' + interval '3 hours'    time '04:00:00'
> -     - interval '23 hours'    interval '-23:00:00'
> -     date '2001-10-01' - date '2001-09-28'     integer '3'
> -     date '2001-10-01' - integer '7'    date '2001-09-24'
> -     date '2001-09-28' - interval '1 hour'    timestamp '2001-09-27 23:00:00'
> -     time '05:00' - time '03:00'    interval '02:00:00'
> -     time '05:00' - interval '2 hours'     time '03:00:00'
> -     timestamp '2001-09-28 23:00' - interval '23 hours'    timestamp
> '2001-09-28 00:00:00'
> -     interval '1 day' - interval '1 hour'    interval '1 day -01:00:00'
> -     timestamp '2001-09-29 03:00' - timestamp '2001-09-27 12:00'    interval
> '1 day 15:00:00'
> *     900 * interval '1 second'    interval '00:15:00'
> *     21 * interval '1 day'     interval '21 days'
> *     double precision '3.5' * interval '1 hour'    interval '03:30:00'
> /     interval '1 hour' / double precision '1.5'    interval '00:40:00'
>
>
>
> is it possible? or is better to use an atached file and store it ? and
> what should be the data type to store a file that can be xls, doc, pdf
> for example.

Sorry, I still don't get it... what *exactly* are you trying to do?

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: data type to store a lot of text and tables of data

От
Raymond O'Donnell
Дата:
On 24/03/2010 22:01, Karina Guardado wrote:

> what should be the data type to store a file that can be xls, doc, pdf
> for example.

Sorry, I missed this bit - for binary files you can use the bytea type.
Look under "Binary data types" in the docs.

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: data type to store a lot of text and tables of data

От
Karina Guardado
Дата:
You know I need to design a table where some attributes have a data type that allow me to store  text mixed with tables and other information. I use PHP code to get the information and store it in to the database so I wonder if this is posible to do. I found in the link you provided me that  If character varying is used without length specifier, the type accepts strings of any size. So this is useful for me when only text has to be stored but when the user wants to store information mixed with tables like the following :


Reciba un respetuoso saludo y deseo de éxitos en sus actividades. El motivo de la presente es para solicitarle se realice una corrección en el plan de mantenimiento preventivo y correctivo de fotocopiadoras, duplicadores e impresoras debido a que en el Centro de Cómputo aparecen, según el reporte, 4 impresoras asignadas y en realidad solamente tenemos dos que son las que detallo a continuación:

 

Impresora

Marca

Modelo

No. De Inventario

Observaciones

       X

HP

LaserJet 1300

12040-3701-080-0005

Si aparece en el listado.

       X

HP

LaserJet 3055

12040-0603-080-0002

No aparece en el listado

 


I hope this help,


thanks a lot,


karina



#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}
On Wed, Mar 24, 2010 at 4:08 PM, Raymond O'Donnell <rod@iol.ie> wrote:
On 24/03/2010 22:01, Karina Guardado wrote:

> what should be the data type to store a file that can be xls, doc, pdf
> for example.

Sorry, I missed this bit - for binary files you can use the bytea type.
Look under "Binary data types" in the docs.

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: data type to store a lot of text and tables of data

От
Raymond O'Donnell
Дата:
On 24/03/2010 22:39, Karina Guardado wrote:
> You know I need to design a table where some attributes have a data type
> that allow me to store  text mixed with tables and other information. I
> use PHP code to get the information and store it in to the database so I
> wonder if this is posible to do. I found in the link you provided me
> that  If character varying is used without length specifier, the type
> accepts strings of any size. So this is useful for me when only text has
> to be stored but when the user wants to store information mixed with
> tables like the following :

I suppose it depends on what the format of the data is.... the example
you posted is HTML, which is pure text, so could be stored in a VARCHAR
or TEXT column.

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

Re: data type to store a lot of text and tables of data

От
Karina Guardado
Дата:
Thank you very much  for your help and so soon answears. I will try using the solutions you suggest.

best regards,

karina
#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}
On Wed, Mar 24, 2010 at 4:44 PM, Raymond O'Donnell <rod@iol.ie> wrote:
On 24/03/2010 22:39, Karina Guardado wrote:
> You know I need to design a table where some attributes have a data type
> that allow me to store  text mixed with tables and other information. I
> use PHP code to get the information and store it in to the database so I
> wonder if this is posible to do. I found in the link you provided me
> that  If character varying is used without length specifier, the type
> accepts strings of any size. So this is useful for me when only text has
> to be stored but when the user wants to store information mixed with
> tables like the following :

I suppose it depends on what the format of the data is.... the example
you posted is HTML, which is pure text, so could be stored in a VARCHAR
or TEXT column.

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

help

От
赤松 建司
Дата:
help

Re: help

От
Raymond O'Donnell
Дата:
On 29/03/2010 15:43, 赤松 建司 wrote:
> help

Surely. What with? :-)

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie