Re: inserting a text file via json

Поиск
Список
Период
Сортировка
От Emanuel Calvo
Тема Re: inserting a text file via json
Дата
Msg-id CAGHEX6aaT659OHedBaKpbR4Z6Wyjkq27Z7YfQJjL2iNE2Z_R9g@mail.gmail.com
обсуждение исходный текст
Ответ на inserting a text file via json  ("john.tiger" <john.tigernassau@gmail.com>)
Список pgsql-general

Did you mean something like...?:

postgres=# \! echo "{\"menu\": { \"id\": \"file\" }}" > /opt/pgdata/exampl.json
postgres=# select pg_read_file('/opt/pgdata/exampl.json');
        pg_read_file       
----------------------------
 {"menu": { "id": "file" }}+
 
(1 row)

postgres=# select pg_read_file('/opt/bdr/bdr1/exampl.json')::json;
        pg_read_file       
----------------------------
 {"menu": { "id": "file" }}+
 
(1 row)

postgres=# create table json_exam as select pg_read_file('/opt/bdr/bdr1/exampl.json')::json as jsonColumn;
SELECT 1
postgres=# \d json_exam 
   Table "public.json_exam"
   Column   | Type | Modifiers
------------+------+-----------
 jsoncolumn | json |

2014-09-05 20:51 GMT-03:00 john.tiger <john.tigernassau@gmail.com>:
we want to store markdown text files into our json fields - can this be done ?  I guess we could have a separate json field and bytea field for the markdown file but this might be difficult when it comes to our REST response - anyone do something like this ?


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
--
Emanuel Calvo http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: xlog min recovery request is past current point -- is it real problem?
Следующее
От: Cal Heldenbrand
Дата:
Сообщение: Re: Querying a time range across multiple partitions