[GENERAL] Facing Problem in Autovacuuming Deamon....

2010-06-22 Thread Deven
Hi all, I am using Postgresql Database for our system storage and I am running Autovacuuming Deamon on my entire database. But on of the table set in my database never undergoes the Autovacuuming. I always need to do the manual vacuuming on that table. Can anyone kindly tell me the solution for

Re: [GENERAL] Facing Problem in Autovacuuming Deamon....

2010-06-23 Thread Deven
# - Previous PostgreSQL Versions - #add_missing_from = off #array_nulls = on #backslash_quote = safe_encoding# on, off, or safe_encoding #default_with_oids = off #escape_string_warning = on #regex_flavor = advanced# advanced, extended, or basic #sql_inheritance = on #standard_conforming_strings = off #synchronize_seqscans = on # - Other

Re: [GENERAL] Facing Problem in Autovacuuming Deamon....

2010-06-23 Thread Deven
ing_warning = on #regex_flavor = advanced# advanced, extended, or basic #sql_inheritance = on #standard_conforming_strings = off #synchronize_seqscans = on # - Other Platforms and Clients - #transform_null_equals = off #-

[GENERAL] json-patch support?

2015-03-27 Thread Deven Phillips
could just select for the changes via a trigger and use NOTIFY to tell our application about a patch. If nobody has discussed it previously, perhaps I will look into implementing it myself. Thanks in advance, Deven

[GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Deven Phillips
Thanks in advance!!! Deven

Re: [GENERAL] json-patch support?

2015-03-27 Thread Deven Phillips
OK, then I will look into perhaps implementing it as a pl-python or pl-java function. Thanks for the advice!! Deven On Fri, Mar 27, 2015 at 2:40 PM, Merlin Moncure wrote: > On Fri, Mar 27, 2015 at 1:36 PM, Arthur Silva wrote: > > On Fri, Mar 27, 2015 at 1:56 PM, Deven Phillips < &

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Deven Phillips
s; ERROR: failed to prepare the MySQL query: Unknown column 'backend_network_id' in 'field list' I still cannot figure out what the problem might be so any help would be GREATLY appreciated. Thanks, Deven On Fri, Mar 27, 2015 at 4:15 PM, Deven Phillips wrote: > I am trying

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Deven Phillips
72184 DEFAULT CHARSET=latin1 On Fri, Mar 27, 2015 at 5:19 PM, Adrian Klaver wrote: > On 03/27/2015 01:55 PM, Deven Phillips wrote: > >> Better example of the problem... My FDW table schema is: >> >> CREATE FOREIGN TABLE liquorstore_backendipaddress

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Deven Phillips
OK, one of the devs on the GitHub page for that FDW helped me realize that I had accidentally mapped the wrong table! Doh! Deven On Fri, Mar 27, 2015 at 5:31 PM, Adrian Klaver wrote: > On 03/27/2015 02:20 PM, Deven Phillips wrote: > >> Yes. Here's the MySQL schema: &

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

2015-03-30 Thread Deven Phillips
ervice_type AS "service_type", vm.template_name AS "template_name", (get_vm_with_interfaces(vm.id)) as interfaces FROM liquorstore_customer c LEFT JOIN liquorstore_virtualdatacenter vdc ON c.id=vdc.customer_id LEFT JOIN liquorstore_virtualmachine vm ON vm.virtual_data_center_id= vdc.id WHERE c.snt_code='abcd' AND vdc.id=111 AND vm.uuid='422a141f-5e46-b0f2-53b8-e31070c883ed' ) row Is there a way to do this in a single join? Thank in advance! Deven

[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] 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 wrote: > To prevent multiple foreign table scans during queries, I would like to be > able to create an FDW against a VIEW in a f

[GENERAL] JSON "pretty" and selecting nested JSON fields

2015-03-30 Thread Deven Phillips
"self", 'cc.v3.sungardas.vm' AS "type", (get_virtual_interfaces(vm.vmid)) as interfaces FROM virtual_machines vm ) row; The outer level of JSON is "pretty printed", but the content of the array from the function is NOT, even though I have specified that it should be. Any suggestions of how to address this? Thanks in advance! Deven

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

2015-03-30 Thread Deven Phillips
quot;template_name":"", "self":"https://mysite.mydomain.tld /v3/customer/3mcc/vdc/1241/vm/421ea391-b292-ca2e-9a3a-6da3037748c8", "type":"cc.v3.vm", "interfaces":[ {"vlan": null, "vmid": 114778, "order&

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

2015-03-30 Thread Deven Phillips
res; END; $$ LANGUAGE PLPGSQL; On Mon, Mar 30, 2015 at 5:22 PM, Deven Phillips 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_virtu

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

2015-03-30 Thread Deven Phillips
true)), true) FROM ( SELECT DISTINCT * FROM virtual_interfaces WHERE vmid=vm_id) i INTO res; RETURN res; END; $$ LANGUAGE PLPGSQL; Thanks for any help! Deven On Mon, Mar 30, 2015 at 3:25 PM, Merlin Moncure wrote: > On Mon, Mar 30, 2015 at 6:27 AM, Deven Phillips > w

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

2015-03-30 Thread Deven Phillips
ROM virtual_interfaces WHERE vmid=*vm.id <http://vm.id>*) as interfaces FROM virtual_machines vm ) row; Placing the vm.id value there for the WHERE clause gives the error: SQL Error [42703]: ERROR: column vm.id does not exist Position: 351 ERROR: column vm.id does not exist Position: 3

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

2015-03-31 Thread Deven Phillips
blem I am having is that I cannot put the results of multiple tables into a single array_add() call. How can I aggregate multiple joined tables into a single array? Thanks again for the help!! Deven On Mon, Mar 30, 2015 at 10:25 PM, Deven Phillips wrote: > I have already attempted a simi

Re: [GENERAL] INSERT ... ON CONFLICT DO UPDATE

2015-07-20 Thread Deven Phillips
you want (retry insert until it succeeds). Just my 2 cents, Deven On Sun, Jul 19, 2015 at 9:47 AM, Rafal Pietrak wrote: > Hi, > > W dniu 19.07.2015 o 14:10, Geoff Winkless pisze: > > On 19 July 2015 at 11:30, Rafal Pietrak > <mailto:ra...@ztk-rp.eu>> wrote: > &

[GENERAL] How to insert/update a bunch of JSOB values?

2016-07-11 Thread Deven Phillips
l changes from the temp table? I've tried to use a simple case: UPDATE target AS d SET data=jsonb_set(d.data, n.path, is_valid::JSONB, true) > FROM temp_table n > WHERE d.time_inserted=n.time_inserted AND d.data->>'id'=n.id But this results in just the first update for a given PK being applied. Any assistance would be appreciated!!! Deven Phillips

[GENERAL] Verifying LISTEN subscriptions?

2016-09-17 Thread Deven Phillips
>From a connection which has previously executed a LISTEN statement, is there a query which I can run which will tell me if it is still listening on those channels? Thanks in advance!! Deven Phillips

Re: [GENERAL] Verifying LISTEN subscriptions?

2016-09-17 Thread Deven Phillips
NVM, a quick search through the output of `\dfS` showed me the `pg_listening_channels()` function, which returns a TEXT[] of currently subscribed channels. Cheers, Deven On Sat, Sep 17, 2016 at 8:45 AM, Deven Phillips wrote: > From a connection which has previously executed a LIS

[GENERAL] jsonb_set for nested new item?

2016-09-23 Thread Deven Phillips
output to be: { "foo": "bar", "boo": { "baz": "newvalue" } } But that does not appear to work.. Any suggestions would be appreciated. Deven

Re: [GENERAL] jsonb_set for nested new item?

2016-09-23 Thread Deven Phillips
Actually, it looks like I have to create all of the parent objects first before it would work... Is that correct? Deven On Fri, Sep 23, 2016 at 10:14 AM, Deven Phillips wrote: > Is there a way to set a nested element for which the parent paths do not > yet exist? > > For example,

Re: [GENERAL] jsonb_set for nested new item?

2016-09-23 Thread Deven Phillips
Thanks for the confirmation. Unfortunately, I will need to handle more complex situations. I will look into creating a recursive subroutine to handle things. On Sep 23, 2016 5:12 PM, "Vitaly Burovoy" wrote: On 9/23/16, Deven Phillips wrote: > On Fri, Sep 23, 2016 at 10:14 AM, D

[GENERAL] DB Corruption after running out of disk space?

2016-10-14 Thread Deven Phillips
in advance! Deven Phillips

Re: [GENERAL] DB Corruption after running out of disk space?

2016-10-14 Thread Deven Phillips
NVM, I guess that I just didn't wait long enough for the re-index operation to complete... We're good now... On Fri, Oct 14, 2016 at 6:45 AM, Deven Phillips wrote: > Here's hoping someone can help me... Overnight, our primary database > server (part of a master/slave repl

Re: [GENERAL] json-patch support?

2016-10-24 Thread Deven Phillips
Finally got around to doing this... The link below points to a complete implementation of JSONPatch in pure PostgreSQL. It is compatible with PostgreSQL >= 9.5 (Not tested using earlier versions) https://gist.github.com/InfoSec812/b830a9db4c9048552f8c51d7987cc4d0 Cheers! Deven On Fri, Mar

[GENERAL] PostgreSQL 9.5, mysql_fdw, and IMPORT FOREIGN SCHEMA question

2016-01-08 Thread Deven Phillips
the table schemas are imported from the MySQL DB. Does anyone have any advice, links, documentation which might be of help? Thanks in advance! Deven

Re: [GENERAL] PostgreSQL 9.5, mysql_fdw, and IMPORT FOREIGN SCHEMA question

2016-01-08 Thread Deven Phillips
TIMESTAMP, created_time TIMESTAMP) SERVER mysql; CREATE FOREIGN TABLE mydb=# SELECT * FROM customer; ERROR: failed to prepare the MySQL query: Table 'public.customer' doesn't exist Any suggestions would be greatly appreciated! Deven On Fri, Jan 8, 2016 at 10:26 AM, Adrian Klaver wrote:

Re: [GENERAL] PostgreSQL 9.5, mysql_fdw, and IMPORT FOREIGN SCHEMA question

2016-01-08 Thread Deven Phillips
as subsequently able to query that table from PostgreSQL.. I tried to add the "OPTIONS" to the IMPORT FOREIGN SCHEMA and got an error that "dbname" is not a valid parameter. Thanks, Deven On Fri, Jan 8, 2016 at 11:38 PM, Deven Phillips wrote: > Apparently not, though I hav

Re: [GENERAL] PostgreSQL 9.5, mysql_fdw, and IMPORT FOREIGN SCHEMA question

2016-01-08 Thread Deven Phillips
Additional details. The MySQL server I am targeting is running version 5.1.73. Perhaps it's too old of a version to support foreign schema import? Deven On Fri, Jan 8, 2016 at 11:45 PM, Deven Phillips wrote: > I DID get a foreign table to work using the following: > > CREATE

Re: [GENERAL] PostgreSQL 9.5, mysql_fdw, and IMPORT FOREIGN SCHEMA question

2016-01-08 Thread Deven Phillips
= c.TABLE_NAME WHERE t.TABLE_SCHEMA = '%s' When I poked around inside of MySQL that t.TABLE_CATALOG and c.TABLE_CATALOG values are NULL. Trying to compare NULLs in MySQL using an equals sign (=) results in a "FALSE" and thus the "JOIN" does not provide an actual linkage.

Re: [GENERAL] PostgreSQL 9.5, mysql_fdw, and IMPORT FOREIGN SCHEMA question

2016-01-08 Thread Deven Phillips
upposed to!!! Deven On Sat, Jan 9, 2016 at 12:06 AM, Deven Phillips wrote: > I think that I may have found the problem. It looks like the mysql_fdw > uses the following query to gather information about the foreign schema: > > SELECT > t.TABLE_NAME, > c.COLUMN_NAME, > CAS

[GENERAL] Question on how to use to_timestamp()

2016-02-13 Thread Deven Phillips
to_timestamp(data->>'timestamp', '-MM-DDTHH24:MI:SSZ')) AS datapoints $$ LANGUAGE SQL; The conversions for to_timestamp() seems to be my problem. I keep getting an error: # SELECT to_timestamp('2016-01-01T00:00:00Z', '-MM-DDTHH24:MI:SSZ'); ERROR: invalid value ":0" for "MI" DETAIL: Value must be an integer. Time: 1.016 ms Could anyone suggest what it is that I might be doing wrong here? Thanks in advance!!! Deven

Re: [GENERAL] Question on how to use to_timestamp()

2016-02-13 Thread Deven Phillips
Thanks all! On Feb 13, 2016 11:06 PM, "Tom Lane" wrote: > Vitaly Burovoy writes: > > On 2/13/16, Deven Phillips wrote: > >> I'm trying to convert a series of ISO8601 strings into TIMESTAMPs for > use > >> with a function: ... > > > If you

[GENERAL] Appending key-value to JSONB tree

2016-02-17 Thread Deven Phillips
ted) WHERE email=$1 ) SELECT jsonb_pretty(token) FROM newtoken $$ LANGUAGE SQL; Thanks in advance!!! Deven Phillips

Re: [GENERAL] Appending key-value to JSONB tree

2016-02-18 Thread Deven Phillips
ers WHERE email=$1 ), updatecomplete AS ( UPDATE users SET data=(SELECT newdata FROM updated) WHERE email=$1 ) SELECT jsonb_pretty(token) FROM newtoken $ LANGUAGE SQL; The difficult part for me was figuring out how to build the array which makes of the *path* parameter for *jsonb_set*... Hope this he

[GENERAL] Application takes longer time to fetch large no of records from Postgresql 9.0.3

2012-10-15 Thread Deven Thaker
Hi, My application takes longer time (we see time out even) when data to be fetched from Postgresql 9.0.3 is around 190 records. I am doing an improvement at application level, but from database side any performance tuning do i need to do? I have not changed any parameters in postgresql.conf,