« first day (588 days earlier)      last day (4578 days later) » 
03:00 - 17:0017:00 - 00:00

03:12
@jcolebrand that's beyond my simple PS understanding I'm afraid :-)
 
2 hours later…
05:35
Woo, dba.se gear arrived. The t-shirt is really good quality
05:50
@Phil you are genuinely chuffed, aren't you?
.
Needed a new pen
:D
@Phil mine were requisitioned as soon as they arrived - I just ended up with the shirt - but then I needed new pyjamas :-)
.
for those who care about such things, we are getting a fair bit of traffic and it's been growing steadily for quite a while. We seem to have got over our dependence on SO migrations (that stopped abruptly earlier this year).
Oooh, I'm 12th in the year rankings. Not bad for a newbie
Also not bad considering 90% of the questions are mysql+SQL server
The user has stated he's going to write some java to do it
gbn
gbn
06:16
mronign all
Hiya
mronign!
@Phil I think it can be a good solution if kept simple
 
2 hours later…
08:08
@Phil yes, I agree that might be the easiest way
What to do with the Q though?
I say leave it
I've commented - asking him to post his code
do you think we should close it?
it is an ETL question in my book
Was just thinking that he didn't need any outside help
That was all
but he can answer his Q
That's true but won't stop it helping someone else. If he doesn't answer it then we'll need to get rid of it.
@Phil pg can export hex easily enough- can Oracle convert hex to blob?
hextoraw is limited length I think
08:15
i wrote a perl script to import blobs/clobs ages ago
quick change to that would sort it
that use use PL/SQL and UTL_FILE
If you have the time to post it... it doesn't matter if it helps the OP really if it might work for someone else.
one file per blob?
yup
when i looked at this yesterday it was the postgres part that was a pain. looks like it's easy to export to base64, but a nightmare for straight binary
08:32
Morning all
Yo
@Phil wouldn't dream of it. recipe for all sorts of nastiness. Am considering answering myself with a SQL only solution ;-)
08:48
Morning all
@Jack: I'm on travel, haven't managed to test your answer.
09:32
0
Q: Difference between MSSQL and MYSQL

AntoWhat are the main differences between MSSQl and MYSQL, other than the case of storage engines in mysql.??

10 PRINT "LOL"
20 GOTO 10
you mean


HAI
CAN HAS STDIO?
IM IN YR LOOP
   VISIBLE LOL
IM OUTTA YR LOOP
KTHXBYE
The (XOR) difference is only 2-bits. 3 if you write MySQL with a smal y
 
2 hours later…
11:22
@ypercube sure - it's not going anywhere :-)
 
1 hour later…
12:43
Oh geez
0
A: Does this look right to delete a row with the primary key?

G.SIs This something you are looking for ??? Create Trigger RecordChange on P1 after insert, update As begin declare c_get_row cursor for select MsgNumber,CardNumber,Action from inserted declare @MsgNumber int,@CardNumber int,@Action varchar(10) open c_get_row fet...

sigh let me downvote it
I'm in rigorous mood today
@ypercube You wouldn't be swinging by London at any point in your travels?
13:21
No, not this month.
How dirty do I feel for writing this...
AND ih.invPaid IN (
CASE @IsPaid
WHEN 1 THEN 1
WHEN 0 THEN 0
END,
CASE WHEN @IsPaid IS NULL THEN 0 END,
CASE WHEN @IsPaid IS NULL THEN 1 END
)
Answer: Very
what is the first CASE doing, convert everything but 0 or 1 to NULL?
@ypercube there is no 1st CASE ;-)
JNK
JNK
13:39
@MarkStorey-Smith Do you know the view that stores index filter definitions off the top of your head?
Can't seem to find it
it's hard to google since searching for index and view always gives you indexed views
@JNK No, sorry
JNK
JNK
nvm im an idiot
it's in sys.indexes as a column
I thought it was separate
there's a filter_definiton field there.
@ypercube the snippet is just generating the values for IN. Where the parameter is NULL, to get IN (1,0)
Its a hack job
Can't do much refactoring of this monster yet so just slotting in hacks/workarounds where I can.
@MarkStorey-Smith IN (CASE WHEN @IsPaid IS NULL THEN 0 ELSE @IsPaid END, CASE WHEN @IsPaid IS NULL THEN 1 ELSE @IsPaid END)?
@MarkStorey-Smith Wouldn't it be when the parameter is NULL, then its IN (NULL,1,0)?
I remember seeing that IN (something, NULL) doesn't work very well
13:48
@Lamak Exactly!
@Lamak @AndriyM Not quite. The only two values for invpaid (InvoicePaid) are 0 or 1. The query is for paid, not paid or all
@MarkStorey-Smith I mean that your conditions seems to be like that when the parameter is NULL, its evaluating IN (NULL,0,1)
IsPaid IS NULL gives you IN(0,1)
No, you've got 3 expressions there
@MarkStorey-Smith really?
13:51
the first one gives NULL
@AndriyM I see that too
I'm not getting null in the plan
weird
Collation settings at proc creation time matter? dba.stackexchange.com/questions/22448/…
How odd
It should be as Lamak says, CASE has an implied ELSE NULL part
13:55
@MarkStorey-Smith What Lamak means (and I agree), is that this IN list, `IN (
CASE @IsPaid
WHEN 1 THEN 1
WHEN 0 THEN 0
END,
CASE WHEN @IsPaid IS NULL THEN 0 END,
CASE WHEN @IsPaid IS NULL THEN 1 END
)`, evaluates to `IN (NULL, 0, 1)` when `@IsPaid` is NULL.
but IN (NULL, 0, 1) is the same as IN (0,1)
@ypercube I remember seeing some cases where IN (NULL, something) behaves strangely
@AndriyM IN (NULL) is thrown away as it is equivalent to x = NULL which is of course not x IS NULL
mmm....I think that the problem was with a NOT IN
something like this:
41
Q: SQL NOT IN constraint and NULL values

Jamie IdeThis issue came up when I got different records counts for what I thought were identical queries one using a not in where constraint and the other a left join. The table in the not in constraint had one null value (bad data) which caused that query to return a count of 0 records. I sort of unders...

yes, because then it is like c <> NULL AND c <> 0 AND c <> 1
14:00
@ypercube yeah, that was it
I remembered that too now
I remember a series of posts by Quassnoi that talked about this, really good posts. (It was something like "NOT IN vs NOT EXISTS vs LEFT JOIN")
found it
@MarkStorey-Smith: Isn't your expression equivalent to: AND (ih.invPaid = @IsPaid OR @IsPaid IS NULL) ?
@ypercube I wish :)
(corrected)
or hv.invPaid can have other values buit 0 and 1?
a candidate for DBA?
0
Q: Perf Mon Metrics Analysis

Brent AriasI'm reading the book "SQL Server 2008 Query Performance Tuning Distilled" and found its description of perf mon metrics to be a little vague in some cases. I'll list all the metrics it covered, with my sense of each. I'd like to have clarifications shared where necessary. As my comments sugges...

It's equivalent to AND (
ih.invPaid = @IsPaid
OR
@IsPaid IS NULL
)
I'm waiting to ascertain if there's any other gremlin values in there also
and if the plan remains the same regardless of the syntax
Which one assumes it should but optional parameters make me nervous
you coulds also write it as: AND ih.invPaid IN (COALESCE(@IsPaid,0), COALESCE(@IsPaid,1))
@ypercube much neater
14:16
@MarkStorey-Smith this may be a long read, but worth it (and relevant)
@Lamak Got it bookmarked, dip in now and again :)
@Lamak Have there been any updates since 2008 SP1 i.e. 2008R2/2012?
@MarkStorey-Smith I think it haven't, sadly
Looks like this is going to have to be a RECOMPILE query so might as well use the OR @Param IS NULL syntax I guess
There's the one for SQL Server 2008 and one for SQL Server 2005 -
AND HOLD ON TO THE DRRREEEEEEEEEEEEAAAAAAAAAAAMMMMMMMMMMMMM
sorry.
14:21
what?
@Phil yes, some settings do matter.
:-)
@Lamak Pink Floyd --- The Gunner's Dream. I'm listening to it.
Wow, I don't think I've ever seen ALL() syntax used in the practical world before. But I find the logic significantly complicated to parse. Anyone else?
0
A: Update table based on conditions in another table

Ivan GYou can try this demo: CREATE TABLE #ATMStatusHistory (Code INT, RawFeed INT, Resolved INT, Ticket INT) INSERT #ATMStatusHistory VALUES (2341283 ,2350426 ,0 ,205656), (2341460 ,2350603 ,1 ,205656), (2341597 ,2350740 ,1 ,205656), (2341689 ,2350832 ,1 ...

@AaronBertrand I'm ashame to say that I didn't even know of the existance of ALL
in SQL Server
14:24
@Phil this is actually one of the typical causes for "slow in the application, fast in SSMS" - since the procedure is usually created in SSMS, the creation-time and runtime settings match. C# uses different default settings, no match = recompile or poor plan choice
@Lamak it's terribly vague terminology and look at the clause that's require to meet eligibility. What does WHERE 1 = ALL (SELECT ... FROM ... WHERE something <> 0) mean? Can you express that easily in English? I can't.
Yeah, it seems overly convoluted
@rfusca ... are there any optimization benefits of using functions instead of in-line sql in postgresql? (pardon my ignorance)
@swasheck not really, optimization-wise. Mostly if you write a function as 'LANGUAGE SQL STABLE' then it gets inlined anyways and all the same stuff happens
that's what i thought. thanks.
np
@lamak @aaron actually I find his use of ALL() kind of awesome in the "I always wondered how somebody would actually use it" way
14:40
@rfusca I still find EXISTS cleaner and more self-documenting, and it's not as intuitive to figure out what's going on without his additional comment, but I agree I'm actually impressed that someone was able to find a practical use.
Hi there! Can anyone help me with listener problem in Oracle?
@AaronBertrand Ya, I think EXISTS is more 'standard' but I thought the use was fairly obvious once I saw it. Otherwise the logic becomes 'NOT EXISTS (SELECT --the part not resolved)' and I find that more convoluted.
@hmmftg maybe
ask away
I wanted to call an external proc
So I come to modify listener.ora
i'm not sure any of the super oracle guys are online in chat though (@phil or @jack)
and add this lines;
14:44
I'm here
(ADDRESS =
(PROTOCOL = IPC)
(KEY = EXTPROC)
)
Hi mr Phil can you help me?
I modified my listener.ora file to support external procedure calls
but I saw this error:
Starting /oracle/10.2.4/db/OraHome_1/bin/tnslsnr: please wait...

TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
System parameter file is /oracle/10.2.4/db/OraHome_1/network/admin/listener.ora
Log messages written to /oracle/10.2.4/db/OraHome_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testiold)(PORT=1521)))
TNS-12542: TNS:address already in use
TNS-12560: TNS:protocol adapter error
The listener is already running
What does lsnrctl status say?
I cannot connect to db
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
IBM AIX RISC System/6000 Error: 2: No such file or directory
it says:
@hmmftg Ask a question on this site: dba.stackexchange.com/questions/ask
14:48
and include the full listener.ora, tnsnames.ora and the output of ps auxww | grep pmon | grep -v grep
and the full output of lsnrctl status
ps auxww | grep pmon | grep -v grep returns nothing
I'm writing the question
The DB isn't running then
You mean I should start db by sqlplus?
export ORACLE_SID=DBNAME then sqlplus / as sysdba then startup
and after that I have to start listener again?
14:58
looks like it's already running
i'm guessing your a developer? Don't tend to get hobbyists on AIX ;P
wow worked
thank you very much phil
no probs, easy stuff
can I ask something else?
yup
@Phil easy stuff....for the geniuses ;-)
15:02
I have a C library which has been maked and now I have .so file in my dir
@hmmftg if it's about external procedures, please ask it as a question on the site. it's complicated
and can be a pain to setup
Ok I'll do that
thanks for your help
no worries
So, here, after 5 seconds of answering, it already had an upvote. This kinda things have always bothered me somehow. It even has a typo
1
A: How to create a sum column without an internal subquery?

AnandPhadkeDeclae @sum int SELECT @sum=SUM(value) FROM @t WHERE condition = 1 select *,@sum from yourtable

Am I worrying pointlessly here? Somehow I feel uneasy about making any assumptions about inexact types:
I wonder if at least in theory it is possible that random() would return a value <1 that when multiplied by 9 would be >=9 due to the inexact nature of the double precision type? In practice even if it is possible it would be vanishingly unlikely of course because of the 15 digits or so precision. — Jack Douglas 11 mins ago
15:10
@JackDouglas that would be ....very, very unusual
@rfusca very, very, really extremely unusual
but, can't say with 100% percent of certainty that it's impossible
I tried to think of a way to artificially construct one but drew a blank
@JackDouglas i'm not even sure who would know....some kind of C super, insane expert maybe
Until I get an answer from depesz, I'm going to stick with using (trunc(random() * 10)::integer % 10) + 1
@JackDouglas is there a signif diff speedwise?
15:19
@rfusca probably :-)
I'm not usually CPU bound
hmmm, how about width_bucket(random(), 0, 1, 10)
@JackDouglas I don't think this is possible with multiplication by a whole number (which is exact), because the number of total decimal places cannot increase.
@CadeRoux I think the integer is cast to dp implicitly
@JackDouglas i.e. rounding in the final digit is not going to come into play.
@JackDouglas i just ran the two and the speed diff was totally trivial
@JackDouglas Yes, but every integer DOES have an exact representation in IEEE fp
15:22
@JackDouglas a tiny bit faster than either
@rfusca have you a stable environment for running speed tests?
@CadeRoux 0.2*9=1.8
@JackDouglas its a test server that isn't doing anything (currently)
isn't it based on signifcant figures rather than decimal places?
(in binary of course)
@rfusca useful
yup
its 8.4 though
@rfusca Debian?
15:27
centos
@rfusca that's odd - is it a backport?
complied from source
just for mucking around with?
and its an older version of centos
our production is complied from source
its ...political
how do you deal with security problems - recompile?
I bet you don't
15:30
@JackDouglas btw, it would be 1,9 not 1,10
@JackDouglas problems...as in updates?
@rfusca the 0,1 is the range of the random(), the 10 is the number of buckets
@rfusca vulnerabilities - normally these get patched by your distro
@JackDouglas .2 is inexact in IEEE fp because it is 1/5 and 5 is not a power of 2. So the binary representation will be non-terminating. So you are saying it's really .20000000000000000001 or whatever and then when multiplied by 9 it/s really 1.80000000000000000009
@JackDouglas that function gives you 1-10, not 1-9 like the previous function
there's only 9 buckets in the previous one
@rfusca doesn't it give 0-9?
@JackDouglas we recompile for PG updates
@JackDouglas nope
15:33
which one?
ok, dep's gives 1-9, the modulo one gives 1-10
and the bucket one you posted gives 1-10
Has anyone any idea for my asked question?
@JackDouglas So you're worried about getting .9999999999999999999 (whatever binary equivalent - by this point exact/inexact conversion to/from decimal is not an issue because the random is already an fp binary entity) and then multiplying that by 9 and getting something > 9?
@hmmftg looks like phil's helping ya out on it
Yup
15:41
0
Q: Which RDBMS best fits my need?

PureferretI realise this may be come a subjective mess, but I'm hoping for some objective information on the subject. I also don't want to go shopping, I just want to know 'what to shop for'. I'm very new to database management. As in I started SQL 4 weeks ago, and using MS Access last week. I'm coming to...

@Phil i love this "As in I started SQL 4 weeks ago, and using MS Access last week. I'm coming to the end of out perrenial database project using MS Access wherein I've hit up against a lot of the limiations to Access, and I've mentioned that we need something different."
@CadeRoux yes - are you saying that is definitely impossible?
hey i wan't some help to my web app: i'm searching for a good design framework like bootstrap can any one help ??
lol
@Splinky i'm thinking you might be in the wrong room?
15:50
sorry
:p
@Splinky This is a 50 Shades Of Grey discussion room. I think you're lost
@JackDouglas I'm not 100% sure, no. en.wikipedia.org/wiki/… I guess this would probably be a good question for the Computer Science SE. Basically can an fp <1 (I believe this can be known exactly) be multiplied by some integer in fp form to get a number larger than that integer due to rounding?
@Phil i think I'm in the wrong room then lol
@rfusca The 50 Sheds of Grey twitter is pretty funny.
probably not good to browse at work though lol
Uh oh, Robert doesn't like migration
2
Q: Setting up a central CLR storeproc/function respository library for internal stored procs in other databases to use?

Alex ErwinI would like to use code that I developed in C Sharp CLR to be used in all of the databases on the system so that I don't have to set each to trustworthy and turn CLR on and keep a bunch of the same code inside each one. Is there a best way to do this from an administrative and security standpoi...

I'm waiting until we get "The Rest of the Story"
oh wait ... that was Paul Harvey
@AaronBertrand i think its a valid question in general - should a question exist where its an acceptable fit or best fit
well, its at dba now
black ops
Yeah I'd be curious to know if Robert moved it or if someone else did.
Anyway, he could make that same argument for EVERY SINGLE question that has ever been migrated.
We'll see if he replies to my latest comment.
16:10
I'd like to get this reviewed now if no-one objects
@JackDouglas hmm?
@Aaron broadly speaking, what is the answer to the OPs question?
is it databasey or source-controly
@JackDouglas It's databasey. We implemented plenty of CLR at my last job and we only ever implemented one central copy of the CLR assemblies. You can create wrappers that EXECUTE AS to avoid the trustworthy bit, but personally I don't understand all of the objection to trustworthy in the first place. And we had so much cross-db crap going on (mostly service broker) that we just turned on trustworthy anyway.
@AaronBertrand excellent, thanks.
@Shog9 can you cast your eyes over this migration and give it your stamp of approval or otherwise?
As for the backup / restore, the DLL is stored in the file system, not the database, so yes the DLL has to move. If the file path differs, then it needs to be updated, though I've never done that so I'm not sure how to re-register an assembly only updating the path.
16:16
@Shog9 please note the comments on the question pre-migration by Robert in particular
so now we have to go upvote the crap out of the question so that we can show 'em how nice and helpful we are
Unfortunately I don't have time to craft a proper response now (headed to a Dr's appt) but if anybody wants to take my text here and form some kind of answer or comment, I won't object.
@JackDouglas Is this a topic y'all are particularly interested in? Sounds like he is primarily interested in the logistics of maintaining such a library, not so much actually writing it, which would point in your direction.
It seemed like much of the logistics he's interested in are how to implement the CLR library from a security perspective inside of SQL Server.
e.g. how to let databases call a central CLR assembly without turning on the trustworthy bit. That seems to have very little at all to do with source control.
@Shog9 I think we are happy to say we think the question fits here squarely on-topic - it is not on the edge.
@Shog9 I'm not sure Robert would agree with your logic though - he seems to be arguing that it is also on-topic on SO
16:22
@JackDouglas It is. Most migrations are. But if you guys can give it a good home, no worries.
If you are happy, we are happy - just don't want to store up trouble down the line
thanks
Robert had objections, but he did end up migrating it. I think you're fine.
I'm happy to see that this was discussed in the comments prior to
ok, it was him that did it - we didn't know that, thanks
His name is listed below the question on SO... ;-)
OK, sounds good. As long as I don't hear crickets from the dead silence about the question. Always had luck at stackoverflow — Alex Erwin 4 mins ago
PRESSURE'S ON!
JNK
JNK
Lol @Shog9
I was just coming in here to get someone on that Q
16:32
so if i understand the question ... he wants to include CLR ... but only have [dbo] be able to execute (from any db) ... i may be naive but is that just DENY ... GRANT?
JNK
JNK
No idea, I'm weak on security
I am trying to setup a secure install of postgres
@myusuf3 hi :-)
about this right?
what vector do you need to secure your database from?
16:49
Hi jack
basically ripped me a new on there? :P
I was looking for resources to get up and running
i am developer but I need to administer a db; looking for best practices and get my proficiencies up to snuff.
@myusuf3 what do you know already?
@JackDouglas so I need to be able to send databack secure to an app server; I need to secure all external connections except for one(appserver) and encrypt the data
@swasheck I know how to setup and use it
create users
tables etc
and dbs
but I need to learn cover my bases from making noob mistakes
test in test so that you don't break production
@myusuf3 is your appserver at a remote location?
i've found that i only really learn something when stuff breaks and i have to fix it (typical adult learning pattern ... need-to-know)
16:53
@JackDouglas yes
can you tunnel ssh or use a vpn between the two?
I would not rely on the built-in security features of pg personally (eg ssl etc)
they both on aws
@Jack no? why's that?
@JackDouglas yeah why is that?
@swasheck not tested enough
stuff like ssh is battered
much vpn stuff likewise
16:56
Urgh
@myusuf3 does your budget run to this: aws.amazon.com/vpc
Long answer is long (and a nightmare to setup a test case for)
0
A: Error on Oracle calling external procedures

PhilThe following configuration works for me on Oracle 11.2.0.2: C prog: [oracle@node1 ~]$ cat exec_hmmftg.c #include <stdio.h> int exec_hmmftg ( char *p1 , char *p2, char *p3 ) { return 5; } [oracle@node1 ~]$ Compile it, and make sure it's placed in $ORACLE_HOME/bin or $ORACLE_HOME/lib ...

@Phil that's nothing compared to some of the stuff emitted by @ConcernedOfTunbridgeWells
i appreciate your concise response :)
03:00 - 17:0017:00 - 00:00

« first day (588 days earlier)      last day (4578 days later) »