« first day (3775 days earlier)      last day (1085 days later) » 

6:25 AM
A chairde - Morning all!
 
6:49 AM
Morning
 
7:06 AM
Morning
 
 
1 hour later…
8:24 AM
Morning
 
8:39 AM
morning
 
 
3 hours later…
12:02 PM
@ypercubeᵀᴹ - I worked on my own fiddle as promised. I was thinking this'll take me 30 mins, max - ha, ha... A project manager friend of mine told me once that he took his programmers' estimates and multiplied them by π and that was normally close to the mark - looks like I'm in the (2*π) category! :-) I did flute about a lot and did a lot of testing (some of which I've left in...). I would be grateful for any comments (and maybe a little help with the regex (see text at beginning of fiddle).
I picked a sample financial instrument trading scenario - but my real question is when (and if) triggers would be better for this and/or what are the relative pros & cons of this type of solution vs. TRIGGERS (again, see text). The fiddle itself is here. Thanks for any input! p.s. really liked your approach - learned a lot!
 
@Vérace Also available for freesies: red-gate.com/library/defensive-database-programming. It may be old but it's good. Day before yesterday I was quoting it to colleague.
 
@MichaelGreen Thanks, but that's the same one that ypercube posted yesterday...
 
Silly me. I saw the Amazon link but missed his Red Gate one.
 
12:37 PM
@Vérace I'll have a look later. At a first glance, you did not put the FKs for the "previous", right?
 
@ypercubeᵀᴹ - no: I don't have a previous_change_date - don't see the need for it really - do you think it's essential? I do have this: CONSTRAINT m_id_d_id_m_type_uq UNIQUE (man_id, d_id, m_dt), -- no txns within same micro-second on the same deal... I've tried my hardest not to have any NULLable fields - I really don't like them (but can deal with them), but excluding them simplfies some of the logic - I don't require: CHECK ((previous_change_date IS NULL AND previous_total_amount IS NULL)
 
12:55 PM
@Vérace I think you need to escape the dash in your regex as well CONSTRAINT m_name_ck CHECK (manager_name ~ '^[A-Z][a-zA-Z \- \'']')
+1 for actually putting the check constraint
Also, I'm confused - where are these deals coming to/from? Or are we just assuming there's an infinite well of things people can put cash into?
 
@Vérace if you don't have those FKs, then you have the potential of wrong values in d_tot` and d_tot_prev
 
And I'm also assuming at some point you'd want to vary the credit limit by customer/manager
 
@Vérace eg: dbfiddle.uk/… (where the last 3 rows added have all kind of nonsense)
You could of course enforce consistency through stored procedures (and restricting access only though them) as it was suggested yesterday. But in that case, you don't need the "previous" values stored.
 
@ypercubeᵀᴹ <Mandalorian>This is the way</Mandalorian>
 
@ypercubeᵀᴹ - yes - that's to be expected. I "imagined" there would be a dealer UI where the dealer (and/or the client) would be prompted for the (man_id, d_id, m_type, m_dt, m_amount) - (m_dt is NOW()) - as you can see from my INSERT (with CTE) SQL, there is a select done on the previous record and calculations to boot - of course you can enter any old rubbish if you do it directly - how many people (apart from DBAs) actually get to do that?
@bbaird It's an imaginary scenario - this started when @ypercubeᵀᴹ took exception to this:
CHECK
( NOT EXISTS
(
SELECT SUM(loan_amount) AS s
FROM portfolio
GROUP BY manager_name
HAVING SUM(loan_amount) > 100
)
)
I wondered how you'd enforce constraints differently...
 
1:15 PM
IF (SELECT SUM(loan_amount) FROM portfolio WHERE manager_name = 'Bob') < 100 THEN <insert statement>
 
@ypercubeᵀᴹ As for the "wrong values in d_tot and d_tot_prev" - there'll be no errors if you update them correctly through the interface. I do see the point though - the data should be protected purely by "the DDL, the whole DDL and nothing but the DDL" (motto for a DBA to fight and die for! :-) ).
Yes, I can sort of see now - if I allow NULLs and do some sort of COALESCE, then no matter what the INSERT method (via interface OR via CLI), then nobody can mess up - not even root/sysadmin... ah well, back to the drawing board! I'll look at it this afternoon...
 
"there'll be no errors if you update through the interface" bbaird's exactly.
So either use DDL that enforces everything or allow access only through a single data interface.
Or both
@Vérace and by the way, I don't see why you'd need nulls if you follow A-K's schema.
There is only a single row with nulls - for every subledger
In you case, where you have a ledger for every manager, only the first row would have some nulls, since there would be no previous total.
 
Yes, I know it's a single row - the first one! But, why can't that first total be 0 using COALESCE?
 
@Vérace yeah it could be 0. but it would complicate a bit the FK and CHECK definitions.
because if it's 0, it's not null so the FK has to point to something.
 
CHECK ((previous_change_date IS NULL AND previous_total_amount IS NULL)
OR (previous_change_date IS NOT NULL AND previous_total_amount IS NOT NULL)), - just add an AND something = 1?
Could use MATCH PARTIAL - not sure if I've totally understood the whole MATCH FULL, PARTIAL, SIMPLE thing...
?
 
1:28 PM
no, don't mess with that
CHECK ((previous_change_date IS NULL AND previous_total_amount = 0)
OR (previous_change_date IS NOT NULL AND previous_total_amount IS NOT NULL)),
might work ^^
Also depends how you want to define "previous row". A-K example is based on change_date
You could use the m_dt timestamp or portfolio_id or something else.
 
Yes - that might be good. As I've said - I'm big into using DDL as a DSL... :-) And expanding its capabilities - can define previous as to the portfolio_id - with microsecond inserts it's a good candidate.
I could use a "magic date" - 1970-01-01 00:00:00 - but that's an ugly hack!
@ypercubeᵀᴹ - I've a feeling this is developing into an O(𝛑^2) scenario and not O(𝛑*2)! :-)
 
why you say that?
 
Well, I mentioned earlier on about my PM friend who multiplied his programmers' estimates by 𝛑 and found that was a good metric - as I said, I've already used 2*𝛑 my original ~ 30 min. estimate - I'm now moving into 𝛑*𝛑 territory!
 
not too big then ;)
well, not big for a mathematician
 
1:48 PM
@billinkc Are you seeing use cases for file processing or are people literally trying to replace a database with s3 storage and distributed processing? I can't imagine the economy (pricing or otherwise) actually working out in the end, although I guess if you can risk things being wrong and don't mind waiting a bit for things to get loaded into memory so you can process things somewhat quickly without a good key structure.
My one use case for Databricks right now is parsing a 20GB JSON file and staging it in our SQL Server
 
Good morning to all!
 
Morning
 
How is everyone today?
 
Older, tired
 
@bbaird Then maybe you need a day off. ;)
 
1:53 PM
@bbaird I'm subbing on a databricks implementation right now. They're just using databricks as a very expensive VM from what I can see. Original sub was an ML person but this is just ETL work that they didn't have the chops for
 
@PaulVargas I agree - sadly having to save time off for summer vacation/family visits later this year
 
It's an analytics project for marketing and it's small data but been interesting to do something "new." FB, GoogleAnalytics and Twitter ingestion are similar yet very different mechanisms
Reporting layer is going to use a tool called Dremio and it runs off parquet files. We also slice the data out into CSVs for the sciencey people to play with as well as storing the source data into json.
 
@billinkc They're (IT + consultants) are trying to replace our entire data infrastructure with Databricks and DeltaLake and I'm just sitting here in awe if they think they can really pull that off. Who's going to build this magical lake, ensure the data isn't riddled with duplicates, etc?
 
Similar story to a different DBrix project I worked on, it was just overly complicated ETL that needed to move data from different databases to other databases
 
@bbaird There's no choice but to adapt. That's life... and the job. :/
 
1:57 PM
Granted, it's probably no worse than our current method of just having a lot of SAS code do the same thing over but it's not substitute for... I dunno, fixing the data once and placing it in a well designed database
 
Right tool for the right job. While I'm thinking about changing my focus from whatever I do now to databricks consultant because the money I think will be better, based on a sample size of 2, I don't know that there is any advantage to this over traditional db & etl
Pity, I was enjoying the fin/insuretech work but I've also become a big fan of not leaving my house
 
@billinkc I'm sure we'll need help digging out of whatever mess they create so I'll keep your name in mind
 
2:17 PM
@ypercubeᵀᴹ That can be very hard to get right.
 
@bbaird - I did what you suggested re. the \- and that seems to have worked - of course hyphen is a metacharacter within square brackets... Found a beauty here - the only problem is that Irish names can be like this: Micheál Ó hUiggin - not to mention our own @Colin'tHart's name which has a space followed by an apostrophe - I'll study the regex when I get a chance - it's a really nice one to study.
@ypercube - financée is grumbling about how I spend all my time in front of the computer... have to go walking around the grounds of some neo-classical mansion built by our oppressors... I'll take a look at the whole CONSTRAINT imbroglio tomorrow...
Micheál Ó hUiggin contains a space followed by a lower case letter internally!
 
@PaulWhite Is it though? Lock down all write/update permissions to stored procedures, only grant read access and execute on stored procedures based on role. I'd say the biggest challenge to getting things right is Postgres' inability to maintain rows in a specified order.
 
And getting the accents in. It enrages me when I'm told that a computer system can't cope with my name here at home - for the French and the Germans for example, an accent is an integral part of the name. I've tried [[:upper:]] but it doesn't appear to accept accents...
 
@bbaird I was more thinking about ensuring the data stays correct under concurrency
 
@PaulWhite Banks do it? With the right isolation level it shouldn't be an issue.
 
2:31 PM
In my experience, financial institutions have some of the shonkiest code around
 
I've something pretty horrible here - '^[A-ZÀ-ÝŐ][a-zA-Zà-öø-ÿő \- \'']+[a-zà-öø-ÿő]$' - I even have an o double acute separate at the end (went out with a Hungarian girl who had it in her name...) but it's not contiguous with the other [[:alpha:]]'s... see here.
 
Outside healthcare and airlines perhaps
 
@PaulWhite Insurance?
 
Assuming the word "shonkiest" is pejorative, then my vote is for airlines!
 
I don't have any personal experience of the insurance world. I wouldn't be surprised if it were equally bad.
Adjective: shonky (comparative shonkier, superlative shonkiest)
  1. (Australia, New Zealand, Britain, informal) Of poor or dubious quality, shoddy, unreliable; deviously dishonest, fraudulent.
  2. 1986, Sociological Association of Australia and New Zealand, ANZJS: The Australian & New Zealand Journal of Sociology, Volume 22, page 475,
  3. The argument gets even shonkier when they claim that the boundary between clerical and administrative work is difficult to define anyway, and that routinisation and fragmentation have affected lower and middle management too (pp. 95–6).
  4. 2000, Australian Senate, Parliamentary Debates (Hansard), page 13548,
  5. The committee heard much evidence that this is a farce, yet this government have continued to try to pretend that their forecast, based on the shonkiest of assumptions—their model, with the shonkiest of assumptions—is really what is going to happen.
(2 more not shown…)
holy one box batman
 
2:33 PM
@PaulWhite nice one, the double innuendo ;)
 
Definitely antipodean - never heard it before - kind of onomatopoeic = a cross between shoddy and wonky!
 
@bbaird For sure one can run transactions at SERIALIZABLE or use application locks, but as I say, it can be tough to get right with a guarantee.
 
@bbaird what?
what?
 
something about clustered indexes perhaps?
shrug
 
@ypercubeᵀᴹ Me: "I want to get the balance for this account, please sum these ten rows" Postgres: "Here, let me read ten pages from the heap"
 
2:35 PM
@Vérace perhaps, I don't actually know
 
@bbaird define how you do "these ten rows"
 
@ypercubeᵀᴹ Rows pertaining the the account. Could be 1, 10, 1000.
 
@ypercubeᵀᴹ unintentional!
 
@bbaird and I suppose SQL Server would have all in one or two pages, right?
Yeah, right. Until you want some other 10 rows which are not related through the CI
 
@ypercubeᵀᴹ Or Oracle or DB2 or MySQL with the right key, yes. (People often choose bad keys)
 
2:38 PM
Oracle has heaps as well, as far as I know. Clustered index tables are not the default nor used very much
 
Oracle has index-organized tables, which you could use when appropriate.
 
I don't know very much about Postgres, but I do know it has index-only scans
It's a decent product, despite Evan's advocacy
Where is Evan, anyway?
 
@PaulWhite For smaller volumes of data, maybe.
 
Even if what you implied was true - that Postgres heaps perform seriously worse than SQL Server's CI tables - what does this have to do with the DDL vs SPs discussion earlier?
@bbaird nonsense.
 
@ypercubeᵀᴹ In terms of proper locking/isolation/read performance.
 
2:43 PM
I had to start taking Postgres seriously when I saw Sunil Agarwal became the Product Manager for Azure Database for PostgreSQL
 
@PaulWhite correct. And indexes with INCLUDE. Not to mention the various special indexes for full text, intervals, etc. types of searches.
 
Even assuming there is a infinitesimal chance for race conditions, making the duration of the transaction as short as possible reduces the chances substantially.
 
@bbaird That is true, and in some cases that may be a risk one is willing to take. On the other hand, anything that can happen is bound to happen sooner or later. Sooner if it is inconvenient, in my experience. Constraints offer the nice guarantee of being enforced by the engine (not user code!) at all times.
Maybe there is a reason banks aren't very good at preventing people going over credit limits etc.
They're not terrible at imposing fees in such situations, it must be said.
 
Wish my bank did that! :-)
 
Quite.
 
2:47 PM
@PaulWhite That's by design (fees, desire to honor cheques), not limitations of technology.
 
@bbaird No doubt.
It was a somewhat tongue-in-cheek comment.
 
In SQL Server or Sybase you could certainly create a CHECK constraint using a scalar function to check the balance, which would be evaluated after the insert is attempted but before commit to ensure, based on the timestamp of the transaction it was not overdrawn. Not sure if that's too different than having a procedure that locks the appropriate rows until commit.
 
Friends don't let friends use scalar functions in check constraints.
 
Aaron has blogged about it, I think
 
@PaulWhite Enh, scalar function, trigger... if you're doing largely singleton inserts not the end of the world.
 
2:53 PM
@ypercubeᵀᴹ I think it was A-K!
@bbaird Well they're slow, prevent parallelism for the whole query, and might not even be checked in some situations. So, no, we don't use functions in constraints.
Triggers add no benefit either, in terms of concurrency anyway.
 
@PaulWhite Curious of the "might not be checked", I usually don't want my queries to go parallel
I think 2019? started to optimize some scalar functions to be able to run in parallel?
 
@bbaird No. In 2019 some functions can be inlined, but that excludes functions in constraints explicitly.
 
@ypercubeᵀᴹ - I'm going to investigate a partial unique index for the problem we were dicussing earlier?
 
@PaulWhite Yeah, I'd never setup anything like that and I would expect that behavior
 
It has surprised and tripped up several very clever people in the past
17
A: Check Constraint that calls function does not work on update

Tab AllemanWell well, I just learned something. So it turns out that with CHECK CONSTRAINTS and UPDATES, the CONSTRAINT only gets checked if one of the columns referenced in the CONSTRAINT changed. In your case, your CONSTRAINT is checking a UDF that you pass ItemID to. In your UPDATE, presumably you...

I don't know if that is a great example, but it's repeated all over the internet.
 
3:04 PM
People do all sorts of weird things with CHECK constraints they should do with better table design and/or transaction logic
 
I'm not bashing scalar function inlining by the way, it is a very neat piece of technology.
 
It sort of fills a gap that should have been handled by allowing queries in CHECK constraint definitions, or support for subtypes.
 
@bbaird They do. They also sometimes put too much faith into locking hints, make unsafe inferences about isolation levels, and think transactions themselves guarantee more than just success or failure of the whole unit of work.
@bbaird Queries in constraints would be very nice. Unfortunately, it's extremely hard to do in practice.
Firebird seem to have had a crack at it, but with limited success.
 
One of those things, like everything else, could be abused far too easily
 
Which one? Locking hints?
People can be very creative when abusing databases 🙂
Probably code in general
Keeps people in work I guess
 
3:12 PM
@PaulWhite SQL statements in CHECK constraints
 
Oh I see.
I'm sure that's true. Just look at some of the wacky schemes @Vérace comes up with!
 
I'm just glad that the people writing some of this stuff aren't responsible for bridges or buildings
 
At the risk of agreeing with @billinkc, it is much safer to stay indoors at home
Depending on who exactly built your house perhaps
 
@PaulWhite - which one of my schemes was "wacky"?
 
@Vérace All of them!
It's kinda your thing
Please see @ypercubeᵀᴹ's code review for details
😁
Ha I just noticed the double-posted message. Fixed now.
Dodgy internet connection
 
3:18 PM
I'm exploring possibilities - and I did ask about pros and cons of using triggers as opposed to using CHECK CONSTRAINTs. Yes, I did look at it in detail and modelled my fiddle on his - I've always been banging on about how DDL should be much more powerful - and the 1992 standard has stuff about asserts and database level constraints - they should be implemented in the engine so as not to oblige programmers to write (often flawed) trigger logic!
 
All power to you.
I'm just pulling your leg.
It's nice to see people excited about databases.
Even in a wacky way.
 
Vendor just sent me a box... full of plastic bubble wrap... for a pamphlet and some stickers
 
Doing their bit to save the planet
 
@Vérace sounds good. You'll need one for implementing A-K's design in Postgres (due to difference in NULL - UNIQUE behaviour vs. SQL Server)
 
Nulls were a mistake
 
3:31 PM
Yes - that was intesting - maybe it's just a "wacky scheme" though?
Or maybe it's SQL Server that's wacky?
 
@PaulWhite @bbaird Postgres allows user defined functions in CHECK constraints as well. Not that anyone advises to use this feature.
 
@Vérace It is wacky, but very backward-compatible 😀
 
No, just backward!
:-)
 
@Vérace regarding the specific NULLs in UNIQUE index feature? You could say so but all products have such wackinesses ;)
 
I have no time for my-database-is-better-than-yours type arguments. Each has strengths and weaknesses.
 
3:33 PM
Check how your favourite Postgres treats array[null] = array[null] condition.
Would you expect TRUE or UNKNOWN?
 
That's why you have NOT NULL - you can choose - personally, I like the idea (consistent) that no NULL is either equal to nor not equal to any other NULL !
 
@ypercubeᵀᴹ I'd expect a fire in the server room
 
I'd expect NULL... try not to use arrays and I avoid NULLs if at all possible. They have their place, but sparingly...
 
@Vérace So when NULLs contribute to a GROUP BY, would you expect one group or many?
One group implies all nulls are equal. Many groups implies they are not equal.
 
<!-- -->
>     select array[null] = array[null]
>
> <pre>
> | ?column? |
> | :------- |
> | t        |
> </pre>
 
3:37 PM
That formatted nicely
Talking of weird semantics, I was surprised again by that question looking to double rows in a table. The answer using generate_series is an abomination.
1
A: How can I display twice each stored row without using UNION ALL or a temporary table?

Evan CarrollIf you're using PostgreSQL, put a SET RETURN FUNCTION in the ORDER BY clause. CREATE TABLE foo AS SELECT * FROM ( VALUES (1,'A'),(2,'B'),(3,'C') ) AS x(id,name); And, then SELECT id,name FROM foo ORDER BY 1, generate_series(1,2); id | name ----+------ 1 | A 1 | A 2 | B 2 | B 3 |...

We should all seek alternate employment immediately.
 
3:53 PM
@PaulWhite That's what COALESCE is for - or not! This is a bit like the set paradox... is a set a member of itself then it can't be in the set of... &c...
 
@Vérace But if you use COALESCE, you have to choose a non-null value, so the null row could end up in the wrong group.
 
@PaulWhite using set returning functions in the SELECT or ORDER BY list is an abomination, agreed.
 
There ought to be a law
 
@PaulWhite either way, we are flipped.
 
yep
last one out, turn off the lights
 
3:57 PM
Boot down the server...
 
I also remember a related conundrum when we group by ()
should the result be 1 or 0 rows?
I had a headache from trying to interpret the standard
 
Not an unusual situation
And it ought to be group by {}
 
SQL Server returns different results for select max(tid) from t; vs. select max(tid) from t group by ();
 
In mathematical logic, Russell's paradox (also known as Russell's antinomy), is a set-theoretic paradox discovered by the British philosopher and mathematician Bertrand Russell in 1901. Russell's paradox shows that every set theory that contains an unrestricted comprehension principle leads to contradictions. The paradox had already been discovered independently in 1899 by the German mathematician Ernst Zermelo. However, Zermelo did not publish the idea, which remained known only to David Hilbert, Edmund Husserl, and other academics at the University of Göttingen. At the end of the 1890s, Cantor...
 
another thing that won't be changed due to backwards-compatibility
 
4:01 PM
indeed. no one knew the answer at the time, so they guessed
 
and that glitch is not even null related
 
well you get a null or not
or is it an empty set
🤣
 
;)
I should have used count(*), not max ...
 
@ypercubeᵀᴹ yeah dbfiddle.uk/…
 
yep, either 1 row with a 0 or 0 rows.
@PaulWhite nice one.
reminds me of the tripping dereference (is that a word?): dbfiddle.uk/…
 
4:11 PM
I think everyone has made that error at some stage
I forget who made a v. clever use of that. Was it you or @AndriyM?
Aha
52
A: How to select specific rows if a column exists or all rows if a column doesn't

ypercubeᵀᴹMy first thought would be to use the INFORMATION_SCHEMA first, so you get to know (in one query for all tables in the MySQL instance) which tables have an active column and then use that info to construct your queries. And this is probably the most sane approach. There is one other, tricky way t...

 
me first. AndriyM answered a more complicated question with the same trick
 
44
A: Why can't I use a CASE statement to see if a column exists and not SELECT from it?

Andriy MThe following query uses the same idea as in this amazing answer by ypercube: SELECT x.* FROM (SELECT NULL AS SomeCol) AS dummy CROSS APPLY ( SELECT ID, SomeCol AS MyTest FROM dbo.Customers ) AS x; It works like this: if dbo.Customers has a column named SomeCol, then SomeCol in S...

 
That generate_series by the way in ORDER BY can produce different results on different versions!
ORDER BY generate_series(1,2), generate_series(1,3) will do x6 rows in Postgres 9.6 but x3 rows in versions 10+
 
Abomination
 
I admire Guido van Rossum for having had the courage to break old code in the interests of "doing the right thing"™
 
4:21 PM
I still use Python 2 where possible ;)
He broke integer arithmetic. Not forgiven.
 
Eh? I thought it was the form of functions that was the major change - how can you break INTEGER arithmetic?
 
But then, there's an explanation for everything. He joined the evil empire ;)
I'm only kidding by the way ^^
@Vérace have you tried 3 / 2 in python 2 and 3?
 
No - I haven't used much Python - what are the results?
 
@ypercubeᵀᴹ I find it hard to keep track of who is the evil empire at each moment
Facebook? Google?
 
4:26 PM
Yeah nah that's historical
 
@Vérace 1 and 1.5 respectively
 
You might be thinking of the Microsoft that used to write code
They're a hosting company now
 
yeah, just kidding.
 
They don't write code anymore? What's SQL Server run on then?
 
@Vérace Azure
 
4:27 PM
More money in robbing other people's software... Oh, wait, MS did that with DOS!
 
and kittens
 
I thought it was kicking puppies down the street - preferably blind ones!
They can't run as fast at the ones that can see!
 
They're an equal-opportunities evil empire
Puppies, kittens, it's all the same, so long as it is hosted on Azure
I just looked it up. The current evil empire is Amazon.
 
I'd like a Retro Azure section with DOS, Access, Windows 3.1
 
Simpler times.
 
4:30 PM
@ypercubeᵀᴹ I remember kind of fondly 2 of those 3
 
> Please insert a disk into drive A
 
I remember spending an entire day doing just that, to back up a hard drive
It did not work
 
I remember ARJ
so many disks just to play doom
 
ARJ?
 
4:35 PM
like zip, but in DOS...what I used to copy a file and split it in multiple disks
 
ARJ (Archived by Robert Jung) is a software tool designed by Robert K. Jung for creating high-efficiency compressed file archives. ARJ is currently on version 2.86 for DOS and 3.20 for Microsoft Windows and supports 16-bit, 32-bit and 64-bit Intel architectures.ARJ was one of many file compression utilities for DOS and Windows during the early and mid-1990s. Parts of ARJ were covered by U.S. Patent 5,140,321 (expired). ARJ was well documented, and was the most feature rich compression utility at the time, with over 150 documented command line switches, which contributed to its wide-spread adoption...
2
well
 
never used it?
 
nope
 
you are too young
 
or inexperienced
 
4:40 PM
@Vérace right. That is also what the standard says about array comparisons.
Lists:	pgsql-bugs
Manvendra <manvendra2525(at)gmail(dot)com> writes:
> Comparison should return UNKNOWN but it's returning a true.

> postgres=# select array[null]=array[null];

Yeah, that's intentional, because we have to be able to sort arrays.
Comparison of composites behaves similarly, btw.

> SQL-99 standard use to say it should come out as UNKNOWN

We're going to politely ignore the spec on this.
			regards, tom lane
 
Disregarding standards! Shocking!
 
5:00 PM
The <s>Evil Empire</s> err... MS never did that! :-) Nor did the other <s>Evil Empire</s> err... Amazon didn't, nor did the different <s>Evil Empire</s>... oops Facebook... oh, no, wait <s>Evil Empire</s>... Google... ahh... that's the real <s>Evil Empire</s> - aha Netflix... (insert successful company of whose founders you're insanely jealous here)...
Ah, blast it, strikethrough doesn't work here!
 
@Vérace Yep, my name fails that regex.
So would any number of Dutch name like Nils Göran van der Poel (a Swedish speed skater who must have Dutch roots).
 
~~Verace~~
 
Once you start accepting international names, all bets are off.
My pet peeve is sites that capitalise names for you -- as if I'm not smart enough to write my name correctly.
 
Hmmm ~~strike~~
Oct 29 '20 at 13:32, by Paul White
Oct 6 at 15:42, by Paul White
chat markdown strikes again
suck it
triple dash is strike strikethrough
 
@Colin'tHart - my understanding of Dutch names is that if the surname is given separately, it starts with a capital? Anyway, I may just store it any old way and have a search_name UPPER(TRIM... &c. - remove all accents, spaces, hyphens, apostrophes and capitalise... It's the Irish names that are particularly difficult Ó hUiginn for example... Or Ua hUiginn...
Thanks for your input...
 
5:13 PM
@Vérace what's the target of this exercise?
what problem are you trying to solve?
 
My favorite question
 
Basically, two vowels together don't work in Irish... so I could write a regex for that... still, no matter what you do, some rubbish will be let through no matter what your regex...
The problem is how to have "proper" names in my db and not freeform rubbish - of which I"ve seen far too much!
 
5:29 PM
^[\s\u200c]+|[\s\u200c]+$
 
Oh, yes! The phonebook, official forms and most Dutch websites (eg ecommerce sites) store the "voorvoegsels" (prefixes) separately, with the phonebook listing surnames as
Hart, 't
Poel, van der
and
Beijeren Bergen en Henegouwen, van
 
? WhaDaDoo?
@ypercubeᵀᴹ - the regex?
@Colin'tHart - maybe I'll do that - store an address prefix? I'd like a regex that'll cope with 99% of names - and reject 99.9% of the rubbish...
 
@Colin'tHart bless you
 
6:05 PM
@PaulWhite I WON!
sup ya'll
 
@EvanCarroll - what did you win?
 
@Vérace A surname prefix, yes, but you'll want suffixes too for Jr and III
Americans like those
 
Nope - we don't do those! Pompous WASP affectations are not welcome here...
:-)
 
6:57 PM
@Vérace I am in joke mode today, forgive me. That regex is not exactly related to your issue
 
That's fine - I'm kindof giddy myself - cabin fever maybe - but you'll have to do a bit of JEAGLing for me - what does that regex actually do?
 
> Technical Details
>
> The regular expression was: ^[\s\u200c]+|[\s\u200c]+$ Which is intended to trim unicode space from start and end of a line. A simplified version of the Regex that exposes the same issue would be \s+$ which to a human looks easy (“all the spaces at the end of the string”), but which means quite some work for a simple backtracking Regex engine. The malformed post contained roughly 20,000 consecutive characters of whitespace on a comment line that started with -- play happy sound for player to enjoy. For us, the sound was not happy.
@Vérace the regex in combination with a malformed post resulted in a 34 minute outage of SO
 
 
1 hour later…
8:11 PM
Morning
 
 
2 hours later…
10:31 PM
@Lamak that was the best compression utility of the day. Before .rar
 

« first day (3775 days earlier)      last day (1085 days later) »