Re: [GENERAL] Array string casts with SELECT but not SELECT DISTINCT

2015-02-21 Thread David G Johnston
On Sat, Feb 21, 2015 at 7:11 PM, Ken Tanzer [via PostgreSQL] < ml-node+s1045698n583889...@n5.nabble.com> wrote: > I tried that and it does indeed work. (With, of course, the appropriate > permissions to create the cast.) > > So this makes me wonder--is there any downside or unwelcome side effects

Re: [GENERAL] Array string casts with SELECT but not SELECT DISTINCT

2015-02-21 Thread sridhar bamandlapally
Currently, this we are running in production, not faced any issues with functional or performance or database maintenance, I am talking about banking related application As per my knowledge/experience this should work without any downside, and, this cast creation method is part of postgresql docu

Re: [GENERAL] Array string casts with SELECT but not SELECT DISTINCT

2015-02-21 Thread Ken Tanzer
I tried that and it does indeed work. (With, of course, the appropriate permissions to create the cast.) So this makes me wonder--is there any downside or unwelcome side effects to having such a cast? And if not, why isn't it part of the default setup? Cheers, Ken On Sat, Feb 21, 2015 at 3:34 A

Re: [GENERAL] Postgres architecture for multiple instances

2015-02-21 Thread David Steele
On 2/21/15 6:08 PM, Adrian Klaver wrote: > On 02/21/2015 02:01 PM, Samuel Smith wrote: >> Howdy, >> I am looking for advice on migrating to postgres from another database >> system. >> >> Without going into too much detail, my company offers a software >> solution which we self host ourselves in ou

Re: [GENERAL] Postgres architecture for multiple instances

2015-02-21 Thread Adrian Klaver
On 02/21/2015 02:01 PM, Samuel Smith wrote: Howdy, I am looking for advice on migrating to postgres from another database system. Without going into too much detail, my company offers a software solution which we self host ourselves in our data center. We have gotten a green light from managemen

[GENERAL] Postgres architecture for multiple instances

2015-02-21 Thread Samuel Smith
Howdy, I am looking for advice on migrating to postgres from another database system. Without going into too much detail, my company offers a software solution which we self host ourselves in our data center. We have gotten a green light from management to start using postgres as a free and

Re: [GENERAL] how to convert "output deleted/inserted into" in My SQL to Postgres

2015-02-21 Thread Marc Mamin
>hey guys, I'm kinda new to Postgres and I'm learning it now. I have work to >convert some stored procedures in MySQL to Postgres and I came across an >issue here that I can't solve: > >update db.user > set Deleted= 1 >, UpdateTerminal = @UpdateTerminal >

Re: [GENERAL] Query optimization to select rows instead of too many or conditions

2015-02-21 Thread Alban Hertroys
> On 21 Feb 2015, at 12:03, Arup Rakshit wrote: > > On Saturday, February 21, 2015 12:42:03 PM Alban Hertroys wrote: >> >>> On 21 Feb 2015, at 9:34, Arup Rakshit wrote: >>> >>> Select * from Emp >>> where (attr1 = val11 and attr2 = val12 and attr3 = val13) or (attr1 = >>> val14and attr2 = v

Re: [GENERAL] Query optimization to select rows instead of too many or conditions

2015-02-21 Thread Arup Rakshit
On Saturday, February 21, 2015 12:42:03 PM Alban Hertroys wrote: > > > On 21 Feb 2015, at 9:34, Arup Rakshit wrote: > > > > Select * from Emp > > where (attr1 = val11 and attr2 = val12 and attr3 = val13) or (attr1 = > > val14and attr2 = val15 and attr3 = val16); > > > > Now suppose I got (x1,

Re: [GENERAL] Query optimization to select rows instead of too many or conditions

2015-02-21 Thread Alban Hertroys
> On 21 Feb 2015, at 9:34, Arup Rakshit wrote: > > Select * from Emp > where (attr1 = val11 and attr2 = val12 and attr3 = val13) or (attr1 = > val14and attr2 = val15 and attr3 = val16); > > Now suppose I got (x1, x2, x3) and (y1, y2, y3). Then I need to rewrite my > query as : > > Select *

Re: [GENERAL] Some indexing advice for a Postgres newbie, please?

2015-02-21 Thread Arjen Nienhuis
Hi, On 19 Feb 2015 17:12, "brian" wrote: > > > Hi folks, > > I have a single-user application which is growing beyond the > fixed-format data files in which it currently holds its data, I need a > proper database as the backend. The front end is written using Lazarus > and FreePascal under Linux,

Re: [GENERAL] Array string casts with SELECT but not SELECT DISTINCT

2015-02-21 Thread sridhar bamandlapally
Hi Please see below, this works, way for implicit type casting bns=# CREATE TEMP TABLE foo (my_array varchar[]); CREATE TABLE bns=# bns=# INSERT INTO foo (my_array) SELECT '{TEST}'; INSERT 0 1 bns=# bns=# SELECT my_array[1],array_length(my_array,1) FROM foo; my_array | array_length --+--

[GENERAL] Query optimization to select rows instead of too many or conditions

2015-02-21 Thread Arup Rakshit
Hi, Suppose I want to select the rows from a table, say Emp, as below : Select * from Emp where (attr1 = val11 and attr2 = val12 and attr3 = val13) or (attr1 = val14and attr2 = val15 and attr3 = val16); Now suppose I got (x1, x2, x3) and (y1, y2, y3). Then I need to rewrite my query as : Sel