pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
data type to store a lot of text and tables of data
9+ messages / 3 participants
[nested] [flat]

* data type to store a lot of text and tables of data
@ 2010-03-24 21:48 Karina Guardado <kguardado@gmail.com>
  2010-03-24 21:52 ` Re: data type to store a lot of text and tables of data Szymon Guz <mabewlun@gmail.com>
  2010-03-24 21:55 ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  0 siblings, 2 replies; 9+ messages in thread

From: Karina Guardado @ 2010-03-24 21:48 UTC (permalink / raw)
  To: pgsql-general

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

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: data type to store a lot of text and tables of data
  2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
@ 2010-03-24 21:52 ` Szymon Guz <mabewlun@gmail.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Szymon Guz @ 2010-03-24 21:52 UTC (permalink / raw)
  To: Karina Guardado <kguardado@gmail.com>; +Cc: pgsql-general

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

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: data type to store a lot of text and tables of data
  2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
@ 2010-03-24 21:55 ` Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:01   ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Raymond O'Donnell @ 2010-03-24 21:55 UTC (permalink / raw)
  To: Karina Guardado <kguardado@gmail.com>; +Cc: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: data type to store a lot of text and tables of data
  2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 21:55 ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
@ 2010-03-24 22:01   ` Karina Guardado <kguardado@gmail.com>
  2010-03-24 22:04     ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:08     ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  0 siblings, 2 replies; 9+ messages in thread

From: Karina Guardado @ 2010-03-24 22:01 UTC (permalink / raw)
  To: rod@iol.ie; +Cc: pgsql-general

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.

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
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: data type to store a lot of text and tables of data
  2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 21:55 ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:01   ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
@ 2010-03-24 22:04     ` Raymond O'Donnell <rod@iol.ie>
  1 sibling, 0 replies; 9+ messages in thread

From: Raymond O'Donnell @ 2010-03-24 22:04 UTC (permalink / raw)
  To: Karina Guardado <kguardado@gmail.com>; +Cc: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: data type to store a lot of text and tables of data
  2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 21:55 ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:01   ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
@ 2010-03-24 22:08     ` Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:39       ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Raymond O'Donnell @ 2010-03-24 22:08 UTC (permalink / raw)
  To: Karina Guardado <kguardado@gmail.com>; +Cc: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: data type to store a lot of text and tables of data
  2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 21:55 ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:01   ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 22:08     ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
@ 2010-03-24 22:39       ` Karina Guardado <kguardado@gmail.com>
  2010-03-24 22:44         ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  0 siblings, 1 reply; 9+ messages in thread

From: Karina Guardado @ 2010-03-24 22:39 UTC (permalink / raw)
  To: rod@iol.ie; +Cc: pgsql-general

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



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
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: data type to store a lot of text and tables of data
  2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 21:55 ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:01   ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 22:08     ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:39       ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
@ 2010-03-24 22:44         ` Raymond O'Donnell <rod@iol.ie>
  2010-03-25 14:30           ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Raymond O'Donnell @ 2010-03-24 22:44 UTC (permalink / raw)
  To: Karina Guardado <kguardado@gmail.com>; +Cc: pgsql-general

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



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: data type to store a lot of text and tables of data
  2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 21:55 ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:01   ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 22:08     ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
  2010-03-24 22:39       ` Re: data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
  2010-03-24 22:44         ` Re: data type to store a lot of text and tables of data Raymond O'Donnell <rod@iol.ie>
@ 2010-03-25 14:30           ` Karina Guardado <kguardado@gmail.com>
  0 siblings, 0 replies; 9+ messages in thread

From: Karina Guardado @ 2010-03-25 14:30 UTC (permalink / raw)
  To: rod@iol.ie; +Cc: pgsql-general

Thank you very much  for your help and so soon answears. I will try using
the solutions you suggest.

best regards,

karina

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
>

^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2010-03-25 14:30 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-03-24 21:48 data type to store a lot of text and tables of data Karina Guardado <kguardado@gmail.com>
2010-03-24 21:52 ` Szymon Guz <mabewlun@gmail.com>
2010-03-24 21:55 ` Raymond O'Donnell <rod@iol.ie>
2010-03-24 22:01   ` Karina Guardado <kguardado@gmail.com>
2010-03-24 22:04     ` Raymond O'Donnell <rod@iol.ie>
2010-03-24 22:08     ` Raymond O'Donnell <rod@iol.ie>
2010-03-24 22:39       ` Karina Guardado <kguardado@gmail.com>
2010-03-24 22:44         ` Raymond O'Donnell <rod@iol.ie>
2010-03-25 14:30           ` Karina Guardado <kguardado@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox