[SQL] Planner behaviour

2009-10-21 Thread Sebastian
Hi, I have a table with emails. I want to search this column with wildcards. To make a wildcard like this possible: "*...@somedomain.com" , I use this query: SELECT * FROM users WHERE lower(reverse_str(email))) LIKE 'moc.niamode...@%' ORDER BY email (I use reverse_str as the index only g

Re: [SQL] @@Error equivalent in Postgresql

2009-10-21 Thread Pavel Stehule
2009/10/21 maboyz : > > Thanks for the response Pavel. So does this mean i will have to make the > @ReturnValue an OUT parameter too??? am a bit confused here, i guess what i > am driving at is, i see where you are going with the altered function you > suggeted but its fitting the exception handlin

Re: [SQL] @@Error equivalent in Postgresql

2009-10-21 Thread maboyz
Thanks for the response Pavel. So does this mean i will have to make the @ReturnValue an OUT parameter too??? am a bit confused here, i guess what i am driving at is, i see where you are going with the altered function you suggeted but its fitting the exception handling into the grand scheme of th

Re: [SQL] @@Error equivalent in Postgresql

2009-10-21 Thread Pavel Stehule
2009/10/21 maboyz : > > Hi, > > I am in the process of migrating our database from MS Server 2000 to > Postgres. I have a bunch of stored procs which i have to modify the syntax > so they work in postgresql. My ? is is there an equivalent for the @@Error > function in T-SQL for postgres: The stored

[SQL] @@Error equivalent in Postgresql

2009-10-21 Thread maboyz
Hi, I am in the process of migrating our database from MS Server 2000 to Postgres. I have a bunch of stored procs which i have to modify the syntax so they work in postgresql. My ? is is there an equivalent for the @@Error function in T-SQL for postgres: The stored proc i am converting is: ALTER

Re: [SQL] report generation from table.

2009-10-21 Thread Rob Sargent
A. Kretschmer wrote: > In response to sathiya psql : >> Hi All, >> >> I have been searching for, Preparing report from a huge table. >> >> Queries am executing now are, >> SELECT count(*) from HUGE_TBL where cond1, cond2; >> SELECT count(*) from HUGE_TBL where cond1, cond3; >> --- like this i hav

Re: [SQL] report generation from table.

2009-10-21 Thread A. Kretschmer
In response to sathiya psql : > Hi All, > > I have been searching for, Preparing report from a huge table. > > Queries am executing now are, > SELECT count(*) from HUGE_TBL where cond1, cond2; > SELECT count(*) from HUGE_TBL where cond1, cond3; > --- like this i have different conditions(10-15 di

[SQL] report generation from table.

2009-10-21 Thread sathiya psql
Hi All, I have been searching for, Preparing report from a huge table. Queries am executing now are, SELECT count(*) from HUGE_TBL where cond1, cond2; SELECT count(*) from HUGE_TBL where cond1, cond3; --- like this i have different conditions(10-15 different things ) and different amount of condi