« first day (3060 days earlier)      last day (1825 days later) » 

5:18 AM
Good morning
 
6:01 AM
Morning
 
6:57 AM
Morning
 
7:22 AM
Morning
 
7:45 AM
Morning
 
8:39 AM
morning
 
9:19 AM
Morning
 
9:58 AM
anyone feel like sharing tips on reading broad tables in psql?
i'm starting to go a bit goofy
select row_to_json(t) from (select * from pg_stat_replication) t;
i was kind of hoping it'd pretty-print the row(s) vertically (like Format-List in powershell)
alas i've made it worse
 
10:15 AM
herp. derp.
select row_to_json(t,1::bool) from (select * from pg_stat_replication) t;
i'm gonna go to the quiet corner now...
coneOfShame.gif
 
10:26 AM
@PeterVandivier That's an interesting syntax
 
10:38 AM
@PeterVandivier if you are using the psql command lone, you could use \x, to show one item per row.
Not very good iif oyu have many rows though
 
10:54 AM
@ypercubeᵀᴹ yeeeessssss 💪
ty
 
 
1 hour later…
11:56 AM
@ypercubeᵀᴹ the lone psql command
 
12:16 PM
@TomV oyu ;)
 
 
2 hours later…
1:49 PM
British wording, from an official gov.uk questionnaire: Have you ever had an Indeterminate Leave to Remain?" (emphasis mine)
No wonder they can't decide whether to Brexit or not ;)
 
2:05 PM
@ypercubeᵀᴹ What does that mean?
 
it's a visa status
citizen minus 1
 
@TomV You are allowed (leave) to stay (remain). What Peter said ^^
 
Ah "you were allowed to stay without time limitation"
 
The wording may be intentional, looks tongue-in-cheek to me
 
The wording seems like something I wouldn't know what to answer to and then end up at a customs office in the airport trying to explain what I meant
 
2:42 PM
@ypercubeᵀᴹ was the word "Indeterminate" or "Indefinite"?
i thought it was #2
though it could be both, depending on who wrote it & whether they had coffee yet, i wouldn't be surprised
 
@PeterVandivier You are right. It is "Indefinite"
Indefinite leave to remain (ILR) or permanent residency (PR) is an immigration status granted to a person who does not hold the right of abode in the United Kingdom (UK), but who has been admitted to the UK without any time limit on his or her stay and who is free to take up employment or study. When indefinite leave is granted to persons outside the United Kingdom it is known as indefinite leave to enter (ILE). A person who has indefinite leave to remain, the right of abode or Irish citizenship has settled status if resident in the United Kingdom (all full British citizens have the right of abode...
 
2:58 PM
0
A: How to determine if a hyphen (-) exists inside a column

Evan CarrollI don't get this problem at all, SELECT new_address FROM ( VALUES ('O-89421') ) AS t(new_address) WHERE new_address LIKE '%-%'; Seems to work for me

Not sure what that problem is for those mssql guyhs
 
full text search is different
 
@CadeRoux the asnwer with 10 votes already mentions LIKE '%-%'
 
Yes, the problem the OP has is that they are using CONTAINS and hyphen is a delimiter for FTS.
 
@CadeRoux yes but at some point they added this in the question:
> I'm currently using the exact same code that @Josh provided (LIKE '%-%'), but it doesn't work ...
 
Ugh
 
3:05 PM
@ypercubeᵀᴹ Haha I wouldn't have expected that to ping me.
 
@JoshDarnell it's a side-effect-ping ;)
 
Chat should have been implemented in Haskell.
 
Please help me with this question

https://stackoverflow.com/questions/56250062/how-to-calculate-the-double-integration-in-r
 
If the interface to chat was half as crufty as the prelude in haskell, it too could have 10 people using it.
 
@CadeRoux and sorry, the 1st ping was meant for @EvanCarroll. I mean I don't see a point for a second answer with LIKE.
 
3:07 PM
I'm curious why PATINDEX worked for the OP, but LIKE didn't. I wonder if there is some weird collation thing happening, and the functions treat collations differently.
 
Close as not enough information is provided, and ask the question.
The whole question is bunk as-is, it's just an empty assertion that the right tool for the job doesn't work for him.
 
@JoshDarnell or they run different queries ...
 
Why isn't that question valid?
 
@ypercubeᵀᴹ Haha yeah, there may be some funny business going on.
 
@noob Why don't you check with an SO chatroom? This is for DBA.SE
@EvanCarroll It would seem the question is mostly related to you misconstruing the term 'batch'?
 
3:38 PM
@George.Palacios happens to the best of us, we should straighten that up though if it's not documented anywhere officially.
 
@EvanCarroll That's a fair point. I think it's one of those overloaded terms
Maybe a community-wiki QA of "What is a batch?"
 
4:24 PM
Why should that be a community-wiki?
as compared to a regular question?
it clearly has a SQL-server specific context, and optimizations are performed on it
Seems that makes it an ideal question.
 
5:36 PM
The batch question isn't terrible, but it is a bit open-ended so I'm not altogether surprised it was closed initially. Not immediately sure how to make it less "list of x". It does have a couple of reopen votes and an active reopen review. Will think about it.
 
5:49 PM
@PaulWhite Be interested how to make it more acceptable. PostgreSQL has no such notion. I believe I understand how to think of what's happening as being a list of things to process, but being that no other database implements it I'm wondering what this logical grouping provides.
If batches aren't executed in a transaction, and can't be rolled back then what are they providing
 
Well the beginning of an answer would talk about batches as being one level of a "unit of work" within SQL Server. For example, the execution plans for a batch are cached as a unit, and a batch runs on the same parent worker thread for its lifetime. The optimizer also compiles all the plans for a batch as a unit.
I honestly don't know its origins, or if it was even a feature of the product before the huge 7.0 rewrite of most of the Sybase code.
There are some other obvious things like table variables being scoped to a batch, and some quirks of error handling.
In a sense I can see why the Wiki suggestion was made: it is unlikely any one person could write or maintain a comprehensive answer.
OTOH wiki is rare for a reason, and such open-ended questions are normally considered off topic.
 
6:14 PM
It's certainly possible that the concept of a batch arises from reusing the stored procedure infrastructure to apply to multiple ad-hoc SQL statements.
 
6:29 PM
Nice blog post.
 
 
2 hours later…
9:25 PM
In triggers, is there a way to be able to use TRY/CATCH on an operation to be able to complete the trigger even though an error occurred? The particular scenario is that I need to send a message to service broker, but I don't want it to fail the INSERT/UPDATE/DELETE if I fail to form a message or send it to the broker. I have TRY/CATCH, but I inserted a THROW in the middle of the TRY block to inject an error and it causes it to fail the transaction.
`ALTER TRIGGER dbo.Entity_Notify
ON dbo.[Entity]
AFTER INSERT, UPDATE, DELETE
AS
BEGIN
SET XACT_ABORT, NOCOUNT ON;

IF (ROWCOUNT_BIG() = 0)
RETURN;

BEGIN TRY
PRINT 'Begin Dialog';
PRINT 'Building Message';
THROW 0, 'Throw Test', 1;
PRINT 'Message Built';
PRINT 'Send Message';
PRINT 'Send Complete';
END TRY
BEGIN CATCH
PRINT 'Catch Error in Trigger';
END CATCH
END`
Well, so much for markdown, anyway you get the idea
This is what I get:

An error was raised during trigger execution. The batch has been aborted and the user transaction, if any, has been rolled back.
 

« first day (3060 days earlier)      last day (1825 days later) »