« first day (3373 days earlier)      last day (1502 days later) » 

12:45 AM
@PrashinJeevaganth row_number()
 
 
7 hours later…
Morning
 
 
4 hours later…
11:49 AM
Feb 23 at 15:19, by Peter Vandivier
I’m sure it’s a solved problem, but intuitively I feel like I’d probably just write it from scratch because I hate doing things “smart” or “easy”
Peter, I had cause to dust this off, so here it is.
My use-case is determining the sequence in which to run object creation files. Each object (SP, function, type etc.) is in its own file. Each table's file include the PK, FKs, indexes and triggers so they don't need separate files.
This sorting is then input to a devops-style DB creation Powershell which submits each object file in dependency sequence ensuring no errors.
There's a parallel one for populating reference data. It's the same but looking only at tables' FKs.
 
12:40 PM
i'll try to have a deep dive on that as soon as possible
 
1:36 PM
YOOOO
 
Would anyone mind enlightening me what's wrong with the typecasting here? paste.ofcode.org/367m7p2u7T7CGkmneSNTvKe
 
3:24 PM
you are adding two integers
but the function needs to return a date
oh, no, you are trying to add a number to a date
let me check
The extract() returns a double, not an int. No idea why but there's your issue
 
 
2 hours later…
5:35 PM
@ypercubeᵀᴹ Really? I just ran it and it shows an integer though
 
 
1 hour later…
6:48 PM
I enjoyed watching Picard @ypercubeᵀᴹ
 
@TomV-trytopanswers.xyz did you see them all at once?
nice
@PrashinJeevaganth yep: postgresql.org/docs/current/…
I suppose because it can return values that would not fit inside 4-bit integer
xx# select extract(epoch from now() + interval '292256 year') ;
    date_part
------------------
 9224294151634.01
 
7:09 PM
I think I fixed the bug already, I guess moral of the story is not to stare at the same code for more than 3hours straight
3
 
7:30 PM
@ypercubeᵀᴹ over a couple of days
 
 
2 hours later…
9:31 PM
No dark mode here, right?
 

« first day (3373 days earlier)      last day (1502 days later) »