Re: what is the solution like oracle DB's datafile

2022-12-27 Thread Eagna
wrote: > - Oracle was developed earlier, and one can argue that in those days file > systems > were not so great, so there was more need to write your own Correct me if I'm wrong, but didn't Postgres (or Ingres upon which it's based) development start in the early-to-mid 70's and Oracle's

Re: Regular expression to UPPER() a lower case string

2022-12-10 Thread Eagna
Hi, and thanks for all of the input - I think I'm beginning to grok it. > On second thought you could probably use NFD normalization to separate > base letters from accents, uppercase the base letters and then > (optionally) NFC normalize everything again. Still insane ;-). As far as I can

Re: Regular expression to UPPER() a lower case string

2022-12-10 Thread Eagna
> `select upper(x) from test` I know about the UPPER() and LOWER() functions - I don't want them! > If you want to do something else, please describe the actual thing you > want to do. Not "how", but "what". I have described it - I want to do the *_same_* thing as UPPER() does using

Re: Regular expression to UPPER() a lower case string

2022-12-10 Thread Eagna
Hi again, and thanks for sticking with this. > You haven't explained what you're trying to accomplish. Ok. CREATE TABLE test(x TEXT); INSERT INTO test VALUES ('abc'); SELECT REGEXP_REPLACE(x, '', '', 'g') FROM test; Expected result: ABC See fiddle here: https://dbfiddle.uk/Q2qXXwtF

Re: Regular expression to UPPER() a lower case string

2022-12-10 Thread Eagna
Ciao and thanks for your input. > * `regexp_replace` doesn't work like that, at all > * your logic only works by accident for some languages (try to upcase > a `ß` or a `ı`) If you have any ideas how it could be done indirectly/different strategy - I'm all ears. You can assume all English

Re: Regular expression for lower case to upper case.

2022-12-10 Thread Eagna
Hi, and thanks for your input. > RegExp by itself cannot do this. You have to match all parts of the input > into different capturing groups, then use lower() combined with format() to > build a new string. Putting the capturing groups into an array is the most > useful option. OK - I

Re: Regular expression for lower case to upper case.

2022-12-10 Thread Eagna
Hi, and thanks for your input, > Tha said, the replacement string in some editors (like Vim) and some > programming languages (like Perl) provides syntax for changing case > (both vi(m) and Perl use \u and \U...\E for uppercasing). This is probably why I was so frustrated - I thought that

Regular expression to UPPER() a lower case string

2022-12-10 Thread Eagna
Hi all, as per the subject, I want a regular expression to do what the UPPER() function does. Obviously, I know about that function and it is not what I want. This should be very (very) easy - I don't know what I'm missing - I've done quite complex regular expressions before and I don't know

Regular expression for lower case to upper case.

2022-12-10 Thread Eagna
Hi all, I want a regex to change the case of a field from UPPER to lower. I know about the UPPER() and LOWER() functions and they are not what I want. I would have thought this should be very simple, but I've searched a lot and can't seem to get an answer. Here's a fiddle with a couple of

Puzzled by ROW constructor behaviour?

2022-11-22 Thread Eagna
Hi all, I'm puzzled by some behaviour of the ROW constructor that I noticed when I was playing around. >From the documentation >(https://www.postgresql.org/docs/current/sql-expressions.html#SQL-SYNTAX-ROW-CONSTRUCTORS), > we have NUMBER 1 > SELECT ROW(1,2.5,'this is a test') = ROW(1, 3,

How to add a variable to a timestamp.

2022-10-29 Thread Eagna
Hi, I'm trying to do something like this. SELECT d.i, h.i, '2022-10-31 00:00:00'::TIMESTAMP + INTERVAL 'd.i DAY' FROM GENERATE_SERIES(0, 6) AS d(i), GENERATE_SERIES(0, 23) AS h(i); where I add d.i days (and also h.i hours) to a timestamp. I can't seem to get this to work. Any ideas

Re: Problem with LATERAL

2022-10-13 Thread Eagna
> > ERROR: syntax error at or near "WHERE" > > LINE 10: WHERE o.total_price > ISNULL(sub.paid, 0); > There error here is because a JOIN clause requires a join condition. Adding an > "ON true" is probably what you want. You would also need to change isnull() > with coalesce(). > The final

Problem with LATERAL

2022-10-13 Thread Eagna
Good Morning all, I am having a problem understanding a simple LATERAL join - I'm working on grasping them. All tables and data are at the bottom of this question and on the fiddles, SQL Server (working) and Postgres (not working). SQL Server fiddle - https://dbfiddle.uk/hjBBd87B Postgres