[GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread avpro avpro
Hi all, Have you ever experienced how to populate fields from a MS Office Word document with a PostgreSQL data available either in a table or view? I haven’t seen anything on the web; only possible with MS products, VS or Access. Thank you for your input

Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread Tim Clarke
Two options that I know of: 1) Use Java and the Apache POI project 2) Write a file containing the data in some other format like HTML then open that with Word. Tim Clarke On 30/03/15 09:20, avpro avpro wrote: Hi all, Have you ever experienced how to populate fields from a MS Office Word

Re: [GENERAL] JSON TO POSTGRE TABLE

2015-03-30 Thread Michael Paquier
On Mon, Mar 30, 2015 at 6:54 PM, Kavi kaviraj...@gmail.com wrote: I sample data as below- { glossary: { title: example glossary, GlossDiv: { title: S, GlossList: { GlossEntry: { ID: SGML,

[GENERAL] JSON TO POSTGRE TABLE

2015-03-30 Thread Kavi
I sample data as below- { glossary: { title: example glossary, GlossDiv: { title: S, GlossList: { GlossEntry: { ID: SGML, SortAs: SGML,

Re: [GENERAL] pgadmin3 installation on Oracle Linux 6.6 64-bit ?

2015-03-30 Thread Alban Hertroys
On 28 March 2015 at 02:14, Yuri Budilov yuri.budi...@hotmail.com wrote: I am new to PostgreSQL and Linux (coming across from Microsoft SQL Server). I installed PostgreSQL 9.4 on Oracle Linux 6.6 and its working ok (psql, etc). Now I try to install pgadmin3 on the same OS. I am having

Re: [SQL] [GENERAL] JSON TO POSTGRE TABLE

2015-03-30 Thread Shujie Shang
Hi, I want to ask a question about json index. Can I make a index on a field of a json column? e.g, for table 'json_tab' you given, can I run something like create index 'json_index' on json_tab::key? On Mon, Mar 30, 2015 at 6:11 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Mon,

[GENERAL] How to recover or resent the password for the user 'postgres'

2015-03-30 Thread Arup Rakshit
Hi, I am trying to follow what has been mentioned below **Setting Up Postgres** (https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres). But no luck! [shreyas@myapp(add_postgres_addapter)]$ su - postgres Password: su: Sorry [shreyas@myapp

Re: [GENERAL] JSON TO POSTGRE TABLE

2015-03-30 Thread Michael Paquier
On Mon, Mar 30, 2015 at 7:11 PM, Michael Paquier michael.paqu...@gmail.com wrote: On Mon, Mar 30, 2015 at 6:54 PM, Kavi kaviraj...@gmail.com wrote: I sample data as below- { glossary: { title: example glossary, GlossDiv: { title: S,

Re: [GENERAL] How to recover or resent the password for the user 'postgres'

2015-03-30 Thread Michael Paquier
On Mon, Mar 30, 2015 at 5:09 PM, Arup Rakshit arupraks...@rocketmail.com wrote: Hi, I am trying to follow what has been mentioned below **Setting Up Postgres** ( https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres ). But no luck!

Re: [GENERAL] Extensibility features in PQSQL

2015-03-30 Thread Adrian Klaver
On 03/30/2015 06:20 AM, Danushka Menikkumbura wrote: Hi all, I am interesting in understanding the extensibility features available in PostgreSQL. For instance what it takes to define a new operator or a new index and in particular what goes into the query optimizer in that case. Please kindly

Re: [GENERAL] [SQL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread Hector Vass
If you have windows then yes something like vba to pull data into MS Office Word .. search google for 'ms word odbc connection' a postgres mailing list is not the right place to do this search If you are on *nix don't have/want windows office products but want to generate/write to a MS

Re: [NOVICE] [SQL] [GENERAL] JSON TO POSTGRE TABLE

2015-03-30 Thread Felipe Santos
Hi, I want to ask a question about json index. Can I make a index on a field of a json column? e.g, for table 'json_tab' you given, can I run something like create index 'json_index' on json_tab::key? Yes. Here it is an example:

[GENERAL] Muti-table join and roll-up aggregate data into nested JSON?

2015-03-30 Thread Deven Phillips
I have a multi-table join which will return 1 row per interface and I would like to aggregate the interfaces as a nested section on the resulting JSON output. Could someone help me to figure out how to accomplish that? Example: SELECT row_to_json(row) AS json FROM ( SELECT

Re: [GENERAL] How to recover or resent the password for the user 'postgres'

2015-03-30 Thread John McKown
On Mon, Mar 30, 2015 at 3:09 AM, Arup Rakshit arupraks...@rocketmail.com wrote: Hi, I am trying to follow what has been mentioned below **Setting Up Postgres** (https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres). But no luck!

Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread Vincent Veyron
On Mon, 30 Mar 2015 10:20:15 +0200 avpro avpro avprowebe...@gmail.com wrote: Have you ever experienced how to populate fields from a MS Office Word document with a PostgreSQL data available either in a table or view? I haven’t seen anything on the web; only possible with MS products, VS or

[GENERAL] Extensibility features in PQSQL

2015-03-30 Thread Danushka Menikkumbura
Hi all, I am interesting in understanding the extensibility features available in PostgreSQL. For instance what it takes to define a new operator or a new index and in particular what goes into the query optimizer in that case. Please kindly point me to some useful resources on this. Thanks and

Re: [GENERAL] Extensibility features in PQSQL

2015-03-30 Thread Seref Arikan
Postgres documentation is really excellent. http://www.postgresql.org/docs/9.1/static/extend.html should get you started. On Mon, Mar 30, 2015 at 2:20 PM, Danushka Menikkumbura danushka.menikkumb...@gmail.com wrote: Hi all, I am interesting in understanding the extensibility features

[GENERAL] Slow trigger on insert: alternative solutions?

2015-03-30 Thread Guillaume Drolet
Hello, I need your help speeding up the procedure I will explain below. I am looking for improvements to my method or different approaches/ideas to would help in this matter. I have a set of DBF files that I load into my database using a plpython function and a call to ogr2ogr

Re: [GENERAL] How to recover or resent the password for the user 'postgres'

2015-03-30 Thread Adrian Klaver
On 03/30/2015 01:09 AM, Arup Rakshit wrote: Hi, I am trying to follow what has been mentioned below **Setting Up Postgres** (https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres). But no luck! [shreyas@myapp(add_postgres_addapter)]$ su - postgres

Re: [GENERAL] Foreign Data Wrapper for remote view?

2015-03-30 Thread Deven Phillips
Nevermind, it works exactly as I would have expected and it is the exact speed improvement I needed! Deven On Mon, Mar 30, 2015 at 10:12 AM, Deven Phillips deven.phill...@gmail.com wrote: To prevent multiple foreign table scans during queries, I would like to be able to create an FDW against

Re: [GENERAL] Slow trigger on insert: alternative solutions?

2015-03-30 Thread Adrian Klaver
On 03/30/2015 06:04 AM, Guillaume Drolet wrote: Hello, I need your help speeding up the procedure I will explain below. I am looking for improvements to my method or different approaches/ideas to would help in this matter. I have a set of DBF files that I load into my database using a plpython

[GENERAL] Foreign Data Wrapper for remote view?

2015-03-30 Thread Deven Phillips
To prevent multiple foreign table scans during queries, I would like to be able to create an FDW against a VIEW in a foreign MySQL database. Is this possible? Thanks in advance! Deven

Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread John R Pierce
On 3/30/2015 1:20 AM, avpro avpro wrote: Have you ever experienced how to populate fields from a MS Office Word document with a PostgreSQL data available either in a table or view? I haven’t seen anything on the web; only possible with MS products, VS or Access. Thank you for your input

[GENERAL] Memory management in postgres (with liblwgeom functions in particular)

2015-03-30 Thread Igor Stassiy
Hello, I am developing a C++ extension (most of the code is C++) for postgres that links dynamically with liblwgeom, without linking to postgis. I call liblwgeom functions that serialize/deserialize LWGEOM* (and similar structures) that don't need a backend like GEOS. I wonder how is the memory

[GENERAL] Re: [postgis-users] Memory management in postgres (with liblwgeom functions in particular)

2015-03-30 Thread Paul Ramsey
Igor, Your supposition is is all correct (you might want to ask your questions on postgis-devel, where the developer density is higher). lwalloc by default is just a facade over malloc, for standalone use. But, when used in PostGIS, it it backed by palloc, which is in turn the memory manager

Re: [SQL] Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread Vincenzo Campanella
Il 30.03.2015 15:01, Vincent Veyron ha scritto: Hi, I use Perl for this. The process is : -unzip the .docx document, and look for /word/document.xml in the resulting directory -substitute field names with their values in this file (I don't use MS Word 'fields', though, just placeholders that

[GENERAL] JSON pretty and selecting nested JSON fields

2015-03-30 Thread Deven Phillips
Hi all, I have a query which selects several rows of data, and contained in one of those rows is some aggregated JSON data. I am using row_to_json() to make the whole output JSON and I am providing true for pretty formatting of the JSON. The problem that I am seeing is that they nested JSON

Re: [GENERAL] JSON pretty and selecting nested JSON fields

2015-03-30 Thread Deven Phillips
Here's an example of the JSON output I am getting: {customer_code:abcd, vdc:1241, vmid:114778, uuid:421ea391-b292-ca2e-9a3a-6da3037748c8, name:vmname, os:Red Hat Enterprise Linux 6 (64-bit), service_type:CU, template_name:, self:

Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread Andy Colson
On 3/30/2015 10:18 AM, John R Pierce wrote: On 3/30/2015 1:20 AM, avpro avpro wrote: Have you ever experienced how to populate fields from a MS Office Word document with a PostgreSQL data available either in a table or view? I haven’t seen anything on the web; only possible with MS products,

Re: [SQL] Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread Vincent Veyron
On Mon, 30 Mar 2015 17:37:28 +0200 Vincenzo Campanella vin...@gmail.com wrote: Stirling Newberry stirling.newbe...@gmail.com wrote: post the code Here you go : http://pastebin.com/eVXZiFws This is a mod_perl module used in the HeaderParser phase of the Apache request cycle; it first grabs

Re: [GENERAL] Muti-table join and roll-up aggregate data into nested JSON?

2015-03-30 Thread Merlin Moncure
On Mon, Mar 30, 2015 at 6:27 AM, Deven Phillips deven.phill...@gmail.com wrote: I have a multi-table join which will return 1 row per interface and I would like to aggregate the interfaces as a nested section on the resulting JSON output. Could someone help me to figure out how to accomplish

[GENERAL] unrecognized configuration parameter bdr.connections

2015-03-30 Thread negrus
Hi , all the installation of the BDR according to the documentation: https://wiki.postgresql.org/wiki/BDR_Packages I have set the following parameters: max_replication_slots = 3 max_wal_senders = 4 wal_level = 'logical' track_commit_timestamp = on shared_preload_libraries = 'bdr'

Re: [GENERAL] store and retrieve html in postgres from rails

2015-03-30 Thread David G. Johnston
On Mon, Mar 30, 2015 at 1:06 PM, john.tiger john.tigernas...@gmail.com wrote: want to include html text from newsletters into postgres - then retrieve have seen posts saying this is really difficult (?) and others just sugesting pg_escape_string and pg entities - tried to put into text field

[GENERAL] store and retrieve html in postgres from rails

2015-03-30 Thread john.tiger
want to include html text from newsletters into postgres - then retrieve have seen posts saying this is really difficult (?) and others just sugesting pg_escape_string and pg entities - tried to put into text field but it seems stripped out does anyone have a good suggestion -- Sent via

Re: [GENERAL] Index corruption

2015-03-30 Thread Scott Marlowe
On Tue, Mar 24, 2015 at 12:49 PM, Bankim Bhavsar ban...@nimblestorage.com wrote: Hello postgres experts, We are running a test that periodically abruptly kills postgres process(equivalent to kill -9) and restarts it. After running this test for 24 hrs or so, we see duplicate primary key

Re: [GENERAL] JSON pretty and selecting nested JSON fields

2015-03-30 Thread Merlin Moncure
On Mon, Mar 30, 2015 at 12:54 PM, Deven Phillips deven.phill...@gmail.com wrote: Hi all, I have a query which selects several rows of data, and contained in one of those rows is some aggregated JSON data. I am using row_to_json() to make the whole output JSON and I am providing true for

Re: [GENERAL] JSON pretty and selecting nested JSON fields

2015-03-30 Thread Adrian Klaver
On 03/30/2015 10:54 AM, Deven Phillips wrote: Hi all, I have a query which selects several rows of data, and contained in one of those rows is some aggregated JSON data. I am using row_to_json() to make the whole output JSON and I am providing true for pretty formatting of the JSON. The

Re: [GENERAL] Slow trigger on insert: alternative solutions?

2015-03-30 Thread Guillaume Drolet
Thanks Adrian, In option 2, when you say this is automated in an external Python script, do you mean that you use something like psycopg2 to perform the queries the database (e.g. for comparing data in the holding table with the older table)? Thanks. 2015-03-30 9:53 GMT-04:00 Adrian Klaver

Re: [GENERAL] Muti-table join and roll-up aggregate data into nested JSON?

2015-03-30 Thread Deven Phillips
Sorry, typo!! CREATE OR REPLACE FUNCTION get_vm_with_interfaces(vm_id BIGINT) RETURNS jsonb AS $$ DECLARE res jsonb; BEGIN SELECT array_to_json(array_agg(row_to_json(i, true)), true) FROM ( SELECT DISTINCT * FROM virtual_interfaces WHERE vmid=vm_id) i INTO res; RETURN

Re: [GENERAL] Muti-table join and roll-up aggregate data into nested JSON?

2015-03-30 Thread Deven Phillips
I'm using PostgreSQL 9.4.1 on Ubuntu 14.10. The function does the following: DROP FUNCTION get_vm_with_interfaces(vm_id BIGINT); CREATE OR REPLACE FUNCTION get_virtual_interfaces(vm_id BIGINT) RETURNS jsonb AS $$ DECLARE res jsonb; BEGIN SELECT array_to_json(array_agg(row_to_json(i, true)),

Re: [SQL] Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread avpro avpro
thank you all for your responses. I think to easiest option for me would be to use the ODBC connection. Now my problem is where to start with the VBA code; but that's for another list. cheers On 30 March 2015 at 19:51, Vincent Veyron vv.li...@wanadoo.fr wrote: On Mon, 30 Mar 2015 17:37:28

Re: [SQL] Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread Ken Tanzer
On Mon, Mar 30, 2015 at 1:51 PM, avpro avpro avprowebe...@gmail.com wrote: thank you all for your responses. I think to easiest option for me would be to use the ODBC connection. Now my problem is where to start with the VBA code; but that's for another list. cheers On 30 March 2015 at

Re: [GENERAL] Muti-table join and roll-up aggregate data into nested JSON?

2015-03-30 Thread Merlin Moncure
On Mon, Mar 30, 2015 at 4:22 PM, Deven Phillips deven.phill...@gmail.com wrote: I'm using PostgreSQL 9.4.1 on Ubuntu 14.10. The function does the following: DROP FUNCTION get_vm_with_interfaces(vm_id BIGINT); CREATE OR REPLACE FUNCTION get_virtual_interfaces(vm_id BIGINT) RETURNS jsonb AS

Re: [GENERAL] Slow trigger on insert: alternative solutions?

2015-03-30 Thread Adrian Klaver
On 03/30/2015 01:43 PM, Guillaume Drolet wrote: Thanks Adrian, In option 2, when you say this is automated in an external Python script, do you mean that you use something like psycopg2 to perform the queries the database (e.g. for comparing data in the holding table with the older table)?

Re: [GENERAL] JSON pretty and selecting nested JSON fields

2015-03-30 Thread Merlin Moncure
On Mon, Mar 30, 2015 at 3:30 PM, Adrian Klaver adrian.kla...@aklaver.com wrote: On 03/30/2015 10:54 AM, Deven Phillips wrote: Hi all, I have a query which selects several rows of data, and contained in one of those rows is some aggregated JSON data. I am using row_to_json() to make the

Re: [GENERAL] unrecognized configuration parameter bdr.connections

2015-03-30 Thread Ian Barwick
Hi On 15/03/31 4:59, negrus wrote: Hi , all the installation of the BDR according to the documentation: https://wiki.postgresql.org/wiki/BDR_Packages I have set the following parameters: max_replication_slots = 3 max_wal_senders = 4 wal_level = 'logical'

Re: [GENERAL] Muti-table join and roll-up aggregate data into nested JSON?

2015-03-30 Thread Deven Phillips
I have already attempted a similar approach and I could not find a way to pass the outer value of the VM ID to the inner SELECT. For example: SELECT row.snt_code AS snt_code, row.vdc AS vdc, row.uuid AS uuid, row_to_json(row, true)::json AS json FROM ( SELECT vm.*,

Re: [GENERAL] Link Office Word form document with data from PostgreSQL

2015-03-30 Thread Stephen Davies
Open Office etc can populate fields via JDBC from any database including PostgreSQL. Cheers, Stephen On 30/03/15 19:52, Tim Clarke wrote: Two options that I know of: 1) Use Java and the Apache POI project 2) Write a file containing the data in some other format like HTML then open that with