Re: [GENERAL] column names and dollar sign

2017-05-17 Thread Armand Pirvu (home)
Thanks Tom Armand On May 17, 2017, at 4:14 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: > "Armand Pirvu (home)" <armand.pi...@gmail.com> writes: >> Ran into the following statement > >> CREATE TABLE test( >> Date$ date, >> Month_N

Re: [GENERAL] column names and dollar sign

2017-05-17 Thread Armand Pirvu (home)
Thank you Steve — Armand On May 17, 2017, at 4:10 PM, Steve Atkins <st...@blighty.com> wrote: > >> On May 17, 2017, at 2:02 PM, Armand Pirvu (home) <armand.pi...@gmail.com> >> wrote: >> >> Hi >> >> Ran into the following sta

[GENERAL] column names and dollar sign

2017-05-17 Thread Armand Pirvu (home)
Hi Ran into the following statement CREATE TABLE test( Date$ date, Month_Number$ int, Month$ varchar(10), Year$ int ); While it does execute, I wonder if the $ has any special meaning ? Can anyone shed some light please ? Thanks Armand -- Sent via

[GENERAL] pglogical and slony

2017-05-11 Thread Armand Pirvu (home)
Thanks to Adrian I got pointed in the direction of enabling triggers to use with pglogical In other words, whatever comes down the pglogical in terms of inserts/updates/deletes, I can track those in some audit table or do something else That got me thinking why not putting at the end of

Re: [GENERAL] views and fdw usage and performance

2017-05-09 Thread Armand Pirvu (home)
On May 9, 2017, at 7:11 PM, Adrian Klaver wrote: > On 05/09/2017 05:02 PM, armand pirvu wrote: >> Well >> Jt1 is prod and jt2 is dev > > You are talking schemas, not databases, correct? > > Correct >> Before someone pushes to prod it does work in dev. The jdbc

[GENERAL] views and fdw usage and performance

2017-05-09 Thread Armand Pirvu (home)
Hi I have two schemas jt1, and jt2 in the same db In both I have the same table tbl3 The idea is to keep in sync jt1.tbl3 from jt2.tbl3 each time I have an insert/update/delete on jt2.tbl3 So I was thinking about the following cases to avoid replication 1) in jt2 rather than have the tbl3

Re: [GENERAL] data transformation and replication

2017-05-09 Thread Armand Pirvu (home)
9.5 both But the enable always trigger I missed that Once that set it runs Thank you for your help Armand On May 9, 2017, at 8:26 AM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > On 05/08/2017 08:31 PM, Armand Pirvu (home) wrote: >> My bad >> db1 I have two tabl

Re: [GENERAL] data transformation and replication

2017-05-08 Thread Armand Pirvu (home)
pointers ? Thanks Armand On May 8, 2017, at 4:49 PM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > On 05/08/2017 12:46 PM, Armand Pirvu (home) wrote: >> Hi >> >> Here it is a scenario which I am faced with and I am hoping to find a >> pointer/tip/help >

[GENERAL] data transformation and replication

2017-05-08 Thread Armand Pirvu (home)
Hi Here it is a scenario which I am faced with and I am hoping to find a pointer/tip/help db1 is the OLTP system db2 is the Reporting system The data from db1 needs to get to db2, but the database on those two have tables with different layout/structure and hence data will need to suffer

Re: [GENERAL] getting column names

2017-04-04 Thread Armand Pirvu (home)
Thanks David Worked like a charm and results are correct Armand On Apr 4, 2017, at 5:00 PM, David G. Johnston <david.g.johns...@gmail.com> wrote: > On Tue, Apr 4, 2017 at 2:51 PM, Armand Pirvu (home) <armand.pi...@gmail.com> > wrote: > > But if I join back

[GENERAL] getting column names

2017-04-04 Thread Armand Pirvu (home)
Hi Can somebody please tell me if the below is possible ? I may not see the forest from the trees Thanks Armand levregdb=# select * from foo1; audit_id | table_name --+ 6012 | foo2 6013 | foo2 6014 | foo2 select * from foo2; levregdb=# select *

Re: [GENERAL] store key name pattern search

2017-04-04 Thread Armand Pirvu (home)
Thank you — Armand On Apr 4, 2017, at 10:50 AM, Oleg Bartunov <obartu...@gmail.com> wrote: > > On Tue, Apr 4, 2017 at 11:41 AM, Armand Pirvu (home) <armand.pi...@gmail.com> > wrote: > Hi > > I have the following case > > > select * from foo; >

[GENERAL] store key name pattern search

2017-04-04 Thread Armand Pirvu (home)
Hi I have the following case select * from foo; col1 - "show_id"=>"1", "group_id"=>"32", "group_name"=>"slb", "group_add_by"=>"557651"

Re: [GENERAL] audit function and old.column

2017-04-04 Thread Armand Pirvu (home)
eat In this case I could go around like it I will post another question related to hstore search since although it has a common ground it is different regarding the goal Thanks Armand On Mar 23, 2017, at 6:38 PM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > On 03/23/2017 02:00 PM,

[GENERAL] audit function and old.column

2017-03-23 Thread Armand Pirvu (home)
Hello I am using in a project the audit trigger from the wiki One particular aspect is that not all tables that I am after have the same columns . And it is one in particular I am stumbling onto , and it ends i n _add_by. It can be group_add_by, car_add_by and so on. The old value of this

Re: [GENERAL] variable value in array_to_string

2016-11-21 Thread Armand Pirvu (home)
for asking help. Will try not to do it again Thanks and laters On Nov 21, 2016, at 7:12 PM, David G. Johnston <david.g.johns...@gmail.com> wrote: > Please don't top-post - it makes following the thread a lot harder. > > On Mon, Nov 21, 2016 at 4:15 PM, Armand Pirvu (h

Re: [GENERAL] variable value in array_to_string

2016-11-21 Thread Armand Pirvu (home)
Played with unnest but not much luck NOTICE: {item_id,show_id} NOTICE: item_id It takes only the first array element in consideration Ug On Nov 21, 2016, at 5:02 PM, Armand Pirvu (home) <armand.pi...@gmail.com> wrote: > My bad on the back tick. No idea why it turned that wa

Re: [GENERAL] variable value in array_to_string

2016-11-21 Thread Armand Pirvu (home)
here on I was looking to get say a.item_id , a.show_id and all sort of variations Thanks for help On Nov 21, 2016, at 4:26 PM, David G. Johnston <david.g.johns...@gmail.com> wrote: > On Mon, Nov 21, 2016 at 3:09 PM, Armand Pirvu (home) <armand.pi...@gmail.com>

[GENERAL] variable value in array_to_string

2016-11-21 Thread Armand Pirvu (home)
Hi Is there anyway I can pass a variable in the array_to_string function ? CREATE OR REPLACE FUNCTION test1 () RETURNS void AS $$ DECLARE foo text; foo1 text; begin execute 'select ARRAY( SELECT d.COLUMN_NAME::text from information_schema.constraint_table_usage c,

Re: [GENERAL] functions - triggers cross schemas

2016-10-13 Thread Armand Pirvu (home)
u, Oct 13, 2016 at 3:18 PM, Armand Pirvu (home) <armand.pi...@gmail.com> > wrote: > 2 schemas , schema1 and schema2, with same tables , a base table and a > tracking one. > > > Search path is set to schema1 by default. > insert into schema2.test1 (col2 , col3) val

[GENERAL] functions - triggers cross schemas

2016-10-13 Thread Armand Pirvu (home)
2 schemas , schema1 and schema2, with same tables , a base table and a tracking one. Search path is set to schema1 by default. insert into schema2.test1 (col2 , col3) values ('foo1','foo2') I get an entry in schema1.test1_hist and not in schema2.test1_hist I understand that the trigger

Re: [GENERAL] executing os commands from a function

2016-09-30 Thread Armand Pirvu (home)
, David G. Johnston <david.g.johns...@gmail.com> wrote: > On Thu, Sep 29, 2016 at 2:41 PM, Armand Pirvu (home) <armand.pi...@gmail.com> > wrote: > I used plsh extension but I had to use two functions and a trigger, see code > below > > ​I don't see any way t

[GENERAL] executing os commands from a function

2016-09-29 Thread Armand Pirvu (home)
All I know this may sound like heresy since it involves executing an OS command from a function , but here goes After an insert in a table, I want to touch a file I.e After insert into table test values (100) I want in a dir to have file 100 I used plsh extension but I had to use two

[GENERAL] jsonb search

2016-06-28 Thread Armand Pirvu (home)
Hi In my quest of JSONB querying and searching without having to actually cast into a text, I found JSQuery I do admit my JSONB knowledge shortcoming and I am not a developer but a DBA. As such some examples would be greatly appreciated since I tend to understand better I compiled and