« first day (2698 days earlier)      last day (2174 days later) » 

5:51 AM
Morning
 
Morning
 
6:31 AM
Morning and evening
 
6:53 AM
Morning
 
7:12 AM
Morning
 
7:50 AM
Is there a reason for a Postgres trigger function to return int[]?
 
"A trigger procedure is created with the CREATE FUNCTION command, declaring it as a function with no arguments and a return type of trigger (for data change triggers) or event_trigger (for database event triggers)."
So, no.
 
@Colin'tHart Thanks
 
But not sure what you mean: do you mean the declared return type? Or the type of the value that is actually returned with a return statement?
"A trigger function must return either NULL or a record/row value having exactly the structure of the table the trigger was fired for."
So, an array of ints is still wrong.
 
8:15 AM
Have you tried to read the pg_dump documentation? — dezso 3 mins ago
Another new close vote suggestion: RTFM.
 
exactly
 
@Colin'tHart ...and goodbye to that.
 
@ypercubeᵀᴹ Maybe, I don't remember, and I'm too lazy to look at the documentation... — Akina 1 min ago
 
@dezso LOL, the guy who was arguing explicit conversions weren't necessary because it's in the documentation somewhere is too lazy to look at the documentation today :D
 
@TomV :-)
 
8:33 AM
@ypercubeᵀᴹ I think you missed a closing paren
 
@TomV IMHO the difference between good users and experts is that the experts read and digest the documentation.
 
@TomV He's tired from reading too much documentation yesterday.
2
 
@TomV I deleted as my main point is mute
@dezso Wouldn't this work?
cur.execute("SELECT * FROM t WHERE col LIKE %s ;", ('%PE%',))
 
8:51 AM
@ypercubeᵀᴹ that's totally fine. Doubling is needed only if the query text itself (not counting placeholders) contains %
 
What language is that? Does it have better ways of parametrisation than using % placeholders? That one doesn't look safe.
I admit, though, that a one-liner like cur.execute('...', [params]) is very enticing
 
@AndriyM Pyhton
 
@ypercubeᵀᴹ Oh, that one. Never heard of it. The name looks a bit like Python. Is it similar? :P
 
@AndriyM Typocube™
 
Typocal
 
9:05 AM
ypical
3
 
@AndriyM how is it not safe? Like can be confusing? You can name them, if you want like %(this_here)s and then use a dict with that key as the second parameter. And then there are some extras for doing more complicated stuff (partially in a more² complicated way)
 
@dezso Not safe as in prone to SQL injection
 
If used only internally, then not a problem I guess, provided the source is verified to have safe data
 
cur.execute('SELECT %s', ['1; SELECT 2--'])

cur.fetchall()
==> [('1; SELECT 2--',)]
 
9:14 AM
@AndriyM it is safe.
 
(the above example may not be a good proof, but I have to drop users from databases thanks GDPR right now)
 
Oh, so it adds quotation marks as necessary? That's nice
 
@dezso I thought the same thing - about removing CASE - bu beware if the nulls!
@AndriyM yes, depending on the type of the value. It does different things for string, integer, boolean, list, ...
 
Very versatile, this %s thing
@ypercubeᵀᴹ Good point. Would've removed my comment but the OP appears to be already trying that.
 
9:29 AM
@AndriyM I could be wrong about the arrays (in input). But it (psycopg2) does convert them (arrays to lists) in output.
 
9:49 AM
@ypercubeᵀᴹ your answer might be also important once fixed
I think something along the pattern of INSERT ... SELECT FROM (VALUES ...) v WHERE v.code LIKE ...
 
@sp_BlitzErik Just wanted to post the same link.
@sp_BlitzErik Up early?
 
-1
A: How can I reset a mysql table auto-increment to 1 in phpMyAdmin?

HLPAFirst delete 'id' column, then create 'id' column again. So easy.

Bwahahaha
 
@hot2use hopefully only temporarily! Back later, hahaha.
 
10:15 AM
@dezso I think the issue is that code needs to be replaced with a parameter, too, and row['code']
 
@ypercubeᵀᴹ that's also an option
 
@dezso I've edited your answer. Perhaps using named parameters would be a clearer.
 
10:32 AM
@ypercubeᵀᴹ much clearer
 
 
1 hour later…
11:49 AM
@gbn Swiss supermarket giant Coop will sell products containing insects . . .
Pretty sure I've bought plenty of food with insects in it before. They might not have been the core product though.
 
12:29 PM
Consumers have gotten pretty used to buying products with bugs :-)
 
1:11 PM
LOL! "Coop's marketing analysts are reportedly targeting windows users. A source close to the director allegedly said 'Those idiots already paid for a thousand bugs mashed together - that's why we decided to call our product hamburgers 10!'"
ohh, that's too long to be funy. I should have just written "The bug-patties are marketed as "hamburgers 10"...
 
Well used up all my Close Votes. I think I'll call it a day.
 
@James That could be explained at greater length
 
lollll
 
Anyone here have any experience with busy email servers? Our server can send out about 4 emails per second -- trying to get a feel for whether that is good or bad performance
 
pretty sure it's not good. mine does about 4,000
but not pretty ones, just text.
Kinda got me in trouble once, lol
my guess would be that it's hardware dependent
 
gbn
1:28 PM
@Colin'tHart that seems quite limited, maybe deliberately
 
@James Heh, I remember the horror of my first infinite loop email alert
 
lol! I forgot a where clause and sent out an email for every patient that has ever come back to the ER in 72 hours of their last visit.
 
We receive 600'000 mails per day. We send around 200'000 mails per day (138 mails / minute = 2.3 mails / second)
But if you spread 200'000 mails to working hours only, then that give you approx. 7 mails per second
I would recommend releasing the hand-brake.
@billinkc Something I've always wanted to ask: Was your avatar picture taken with a logitech camera?
@billinkc Hi
 
It's not just a postfix or sendmail MTA, but a whole Zimbra server which includes spam check etc
 
hmm, if it's spam checking out-going mail, that might do it.
 
1:38 PM
@James Yeah, it is -- default install seems to do that
 
@hot2use It's cropped from a picture @Lamak made a few years ago
 
@TomV thanks
 
@hot2use I'm trying to find it
Got to run, someone will find the picture of bill being punched in the face by homer
 
@TomV Nope. It's from a MacBook Pro running Photobooth. Unsure of the pinhole camera manufacturer
 
@billinkc I was referring to the photoshopped picture where you were punched in the face, but I ruined the joke being unable to find that picture
 
1:48 PM
LookMark would never be mean to me like that
 
Amused by the email spam talk
I once sent myself thousands of SMSes. Wasn't fun hitting the phone SMS limit, deleting a few, then it filling up again. Think i got someone to delete them off the SMSC in the end
 
2:01 PM
@Philᵀᴹ :-)
 
i probably would have just buried the phone outside.
 
May 16 at 9:40, by dezso
@George.Palacios did you notice the small arrow on the right of each message when hovering over with the mouse? It links the answers neatly to posts.
 
Good for you, @PaulWhite !
from this
presumably, you're not actually retired; the post is?!
great answer, @sp_BlitzErik, by the way!
 
2:34 PM
just a joke~
 
ahhh. well played then. Thanks for JEAGLing.
 
3:05 PM
The review queue needs some love if anyone is bored
 
0
A: How to exclude the Minimum and Maximum value from Between Condition in sql server 2008 R2?

alrocFrom Adam Bertand's "Bad Habits" series: What do BETWEEN and the devil have in common? BETWEEN does an inclusive search with the bounds; that is, it's greater than or equal to the start and less than or equal to the end. Your query is the equivalent of select * from temp where a >= 2 and a <= 6 ...

Adam!!
 
and four answers! I VtC'd it, but probably way too late.
 
I liked this answer:
1
A: How to exclude the Minimum and Maximum value from Between Condition in sql server 2008 R2?

JamesYou could toss in and a not in ('2','6') or and a not in ((select min(a) from temp),(select max(a) from temp)) ..but only if you really hate your SAN administrator.

 
@McNets where is Adam when you need him
 
@Colin'tHart because "SAN"?
 
3:19 PM
it's beer o'clock, BTW. I opted for an alcohol-free IPA because curiosity. It's surprisingly IPA-like.
 
@dezso name?
 
3:38 PM
@MaxVernon Yeah
 
Haven't used SSMS 2017 yet, so is the content of the following question true?
0
A: SQL Server 2012 is putting [brackets] around Table and Column Names

K MullenIf you are running SSMS 2017 at least v17.6, there is now an option to turn this off. In the options dialog, go to "SQL Server Object Explorer" and then to "Commands". Under the "Drag/Drop" heading is a new option "Surround object names with brackets when dragged". By default, this is set to T...

 
@dezso The Brewdog one is nice, Nanny State
The best alcohol free beer I've tried so far is Erdinger Alkoholfrei. It's lovely. (I've given up drinking completely, so have been testing them)
 
@MDCCL the question or the 2 recent nswers?
 
@ypercubeᵀᴹ The answer is what I meant to write; is it accurate?
 
@MDCCL seems like it. Two recent answers claiming the same thing. I haven't used SSMS for a while
 
3:50 PM
There's this page from an Azure feedback forum that appears to confirm it.
 
@MaxVernon Dolden NULL (really!) from the deservedly famous Riedenburger Brauhaus
3
@Philᵀᴹ so no pub job anymore
@Philᵀᴹ I drank it once, after a bicycle race. It was very good, but possibly anything would have been. Here (in Germany) there are several better sorts.
 
@dezso awesome name. The beer for DBAs ;)
 
@ypercubeᵀᴹ no doubt!
 
4:28 PM
That's like the credit scene with game over for this game. There are no more dragons to slay.
 
5:12 PM
batten down the hatches; there's a 25K Carroll on the loose! Congrats, Evan!
 
In other news, that's a "milestone" on the site and I have no idea why
Milestone "established user", "gifted user", "access to site analytics"
 
When I first saw the q I was waiting for Solomon to answer
1
A: Another one with collation issues

Solomon RutzkyThe problem is that the old SQL Server Collations (i.e. those with names starting with SQL_) and the first two versions of the Windows Collations (the 80 series which came with SQL Server 2000 and do not have a version number in the name, and the 90 series which came with SQL Server 2005) are mis...

 
 
1 hour later…
6:51 PM
Blah, anyone have some AD expertise that can help me troubleshoot a thing?
0
Q: Select User or Group default location

jcolebrandWhen searching for users there is a locations sub-dialog that lists the typical local machine, the domain (in my case corp) with the sublocations, and etc. Example this image from petri.com: What determines the default location in this dialog? Even tho my machine is domain joined, it is default...

Also open to edits on the Q, including title, or feedback on what I should clarify. I'm having a hard time naming this one ...
 
7:01 PM
@jcolebrand I only have 47 rep on serverfault, so I cannot comment. What OS is the workstation?
I almost flagged it as "unclear what you're asking"
:-)
 
A_V
Hey, so I've got this query which pretty much selects my entire database at once
it's been running for 45 minutes now and I'm thinking there has to be a way to make this faster
can you run an absurdly broad query that selects everything in parallel ?
Like have 10 processes selecting 1/10th of the entire dataset
that wouldn't return any faster right ?
 
7:17 PM
@MaxVernon Excellent question. Windows 10.
@MaxVernon I'm unclear lol
 
@A_V it might. Spreading the work into 10 CPUs might show some gain. If the whole table has to be read from the disk though, you're bound by IO speed
 
A_V
selecting entire databases seemed stupid at first
then it seemed like a great idea
now it seems stupid again
 
But seriously, what are you going to do with billions of rows in a result?
 
A_V
we're talking more like 6 millions of rows coming from aggregations of 50 millions rows of poorly structured data
joins are super costly
The actual way of tuning this query is restructuring the data
guess I'll chunk it up :D
 
7:44 PM
@MaxVernon Just Erik's little joke about me not writing new material very often. It was confusing, so I removed it.
 
@PaulWhite but are you thinking in retiring?
 
Sep 27 '17 at 13:17, by Paul White
I was thinking of maybe starting a sandwich shop.
 
@EvanCarroll Congratulations
 
@PaulWhite I thought you already had a sandwich shop
 
in my dreams!
 
7:51 PM
But then you could loaf around
5
 
@PaulWhite you can make it work
a sandwich with a free database optimization
 
@Forrest Sounds like something worth toasting
4
 

« first day (2698 days earlier)      last day (2174 days later) »