Re: Question regarding the new SQL standard

2023-10-26 Thread Raymond Brinzer
I'd like to express my appreciation for a project with a feature set so extensive that a person might mistakenly assume that its goal was to cover the spec comprehensively. On Thu, Oct 26, 2023 at 10:32 AM Tom Lane wrote: > Anders Kildemand writes: > > What's the situation with Property Graph Q

Re: Records, Types, and Arrays

2023-05-19 Thread Raymond Brinzer
On Fri, May 19, 2023 at 2:58 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thursday, May 18, 2023, Raymond Brinzer wrote: > >> scratch=# select row(2,3)::test_type; >> > > Unknown typed value, immediately converted to a known concrete instan

Re: Records, Types, and Arrays

2023-05-18 Thread Raymond Brinzer
nd even so, assuming this is the important difference, how is the ability to change row structure on the fly making the cast possible? In what way would the query calling get_row() be critical? On Fri, May 19, 2023 at 2:48 AM Raymond Brinzer wrote: > On a problem which came up while trying

Re: Records, Types, and Arrays

2023-05-18 Thread Raymond Brinzer
()::test_type; ERROR: cannot cast type record to test_type LINE 1: select get_row()::test_type; If row(2,3) and get_row() are both of type record, and the records have the same values, why can one be cast to test_type, and the other not? On Fri, May 19, 2023 at 1:07 AM Raymond Brinzer wrote: > Greeti

Re: Records, Types, and Arrays

2023-05-18 Thread Raymond Brinzer
On Fri, May 19, 2023 at 1:42 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, May 18, 2023 at 10:06 PM Raymond Brinzer > wrote: > >> How do I turn arrays into composite typed values? >> > > Using just SQL syntax and no string munging: > >

Records, Types, and Arrays

2023-05-18 Thread Raymond Brinzer
Greetings, all. It's been a down-the-rabbit-hole day for me. It all started out with a simple problem. I have defined a composite type. There are functions which return arrays whose values would be suitable to the type I defined. How do I turn arrays into composite typed values? Conceptually,

Re: A Small psql Suggestion

2023-02-07 Thread Raymond Brinzer
people. Again, though, my thanks. This has been like a rough spot on the handle of a tool: trivial for occasional use, prone to raise a blister over thousands of repetitions. On Wed, Feb 1, 2023 at 11:04 AM hubert depesz lubaczewski wrote: > On Tue, Jan 31, 2023 at 11:17:16AM -0500, Ray

A Small psql Suggestion

2023-01-31 Thread Raymond Brinzer
Greetings, There is (for me) a small speed bump in psql. I think it's worth mentioning, minor though it is, because psql is such a polished tool generally, and because it's something which affects me many, many times a day. As it is, \d is a shortcut for \dtmvs. What I actually want to see, on

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-11 Thread Raymond Brinzer
On Fri, Feb 11, 2022 at 3:16 AM Ron wrote: > On 2/10/22 10:33 PM, Raymond Brinzer wrote: > > The answer is obvious to every grey beard: SQL was developed from SEQUEL, > Structured *ENGLISH* Query Language at a company that loved English-style > programming languages. > >

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-10 Thread Raymond Brinzer
On Fri, Feb 11, 2022 at 12:26 AM Guyren Howe wrote: > I’m not proposing some crackpot half-baked idea here. There are > well-defined and researched alternatives to SQL. > I didn't suggest that you were. Anything which was written, someone had to actually write. > The most fully-developed you-

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-10 Thread Raymond Brinzer
On Thu, Feb 10, 2022 at 11:56 PM Guyren Howe wrote: > I feel like anyone who is defending SQL here isn’t aware of how much > better the alternatives are, and how bad SQL really is. > Have you written a language description we can read and talk about? -- Ray Brinzer

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-10 Thread Raymond Brinzer
On Thu, Feb 10, 2022 at 5:51 PM Guyren Howe wrote: > When you dig into it, the powerful idea here is the relational algebra, > and its equivalence to a first-orderish logic. > > I put up with SQL so I can use relations, and I love Postgres because it > has the least bad SQL (by a mile!) > > But S

Re: Nested Schemata, in a Standard-Compliant Way?

2021-09-28 Thread Raymond Brinzer
On Tue, Sep 28, 2021 at 9:36 AM Tom Lane wrote: > I don't think it's possible to do it without huge ambiguity > problems, unless you introduce some separator other than dot, as indeed > you suggest here. Heh... the moment I saw you'd replied, I thought, "Uh oh!"... because I think of you as "the

Re: Nested Schemata, in a Standard-Compliant Way?

2021-09-28 Thread Raymond Brinzer
On Tue, Sep 28, 2021 at 10:13 AM rob stone wrote: > Double colons are used for casting. > E.g., $1::INET or $1::INTEGER where $1 is a string. Quite right; slipped my mind. Thank you. -- Ray Brinzer

Nested Schemata, in a Standard-Compliant Way?

2021-09-28 Thread Raymond Brinzer
Greetings. For some people the "what?" and "why?" of this will be immediately obvious from the title, but I'm going to spend a little time on those before "whether?" and "how?" We have schemata. They're namespaces; very convenient for organizing things. They let you group tables and other entit

Re: The tragedy of SQL

2021-09-17 Thread Raymond Brinzer
On Fri, Sep 17, 2021 at 7:49 AM Raymond Brinzer wrote: > Now, if this sort of thing suits the way you think, I say, "Great!" > I'm glad you have a language which suits you. Reading this over, I realized I should have been more clear: I mean "you" generally. I lik

Re: The tragedy of SQL

2021-09-17 Thread Raymond Brinzer
On Tue, Sep 14, 2021 at 9:06 AM Merlin Moncure wrote: > I've long thought that there is more algebraic type syntax sitting > underneath SQL yearning to get out. I wanted to come back to this, because I've been looking to take a single problem (from my perspective) and explain it concisely. Your

Re: The tragedy of SQL

2021-09-17 Thread Raymond Brinzer
On Wed, Sep 15, 2021 at 2:46 AM Julien Rouhaud wrote: > I agree, and actually sent a patch some time ago to allow usage of > third-party parser(s). They can coexist with the core one, meaning > that you can (if you write your parser this way) use both languages, > even in a multi-query string. S

Re: SQL queries as sets: was The tragedy of SQL

2021-09-15 Thread Raymond Brinzer
On Wed, Sep 15, 2021 at 12:55 AM Steve Litt wrote: > Rich, could you please elaborate on SQL queries being based on sets? I > never thought of it that way, and would like to hear your related > thoughts. I'll take a crack at this. Going through the setup will require a little patience, but I thi

Re: The tragedy of SQL

2021-09-14 Thread Raymond Brinzer
So, on a practical note: I'd like it if PostgreSQL supported alternate languages for queries, as it does for stored procedures. Yes, I know this will strike some of you as an abomination. I think we can take that part as read. ;-) I see two ways of going about this. The quick & dirty way woul

Re: The tragedy of SQL

2021-09-14 Thread Raymond Brinzer
On Tue, Sep 14, 2021 at 4:16 PM FWS Neil wrote: > What people hate about SQL is that the programmer has to optimize SQL to get > acceptable performance. Oh, no, that's just one thing. :-) And to be fair, it's a hard problem. We're asking for an optimizer, written for databases generally, to o

Re: The tragedy of SQL

2021-09-14 Thread Raymond Brinzer
On Tue, Sep 14, 2021 at 3:58 PM Guyren Howe wrote: > You’re confusing SQL with the relational model. Datalog and Quel and Tutorial > D and other database languages and systems can and did provide those features > also. By analogy: Arabic and Roman numerals both describe the natural numbers. H

Re: The tragedy of SQL

2021-09-14 Thread Raymond Brinzer
On Tue, Sep 14, 2021 at 2:41 PM Brian Dunavant wrote: > I have the opposite perspective. As a dev/manager, SQL is much more powerful > at getting data storage from abstract concept, into a usable structure, than > any programming language I've had the (mis)fortune of using. I've long > sinc

Re: The tragedy of SQL

2021-09-14 Thread Raymond Brinzer
This is a subject which is important to me, but I find discussing it often goes poorly. Most people (not necessarily those on this list) don't distinguish between SQL and the relational model. When you criticize SQL the language, people tend to defend relational databases; when you praise relatio

Re: The tragedy of SQL

2021-09-13 Thread Raymond Brinzer
Many languages are awesome. I'm always astonished at what great things people have come up with, over the years; it's been a wonderfully fertile field. We would certainly not be better off if we'd just buckled down, and used COBOL and FORTRAN... or even relatively good languages like C, APL, and

Re: Where **not** to use PostgreSQL?

2019-02-28 Thread Raymond Brinzer
I often avoid PostgreSQL when using software for which PostgreSQL support is secondary. Usually this is the case where MySQL is the default, but PostgreSQL is on the "also supported" list. "Also" is too often a synonym for "badly", here, and unless I really want to be able to approach the underlyi

Re: simple division

2018-12-05 Thread Raymond Brinzer
On Wed, Dec 5, 2018 at 7:55 AM Geoff Winkless wrote: > Where's the logical progression in step 3 here: > > 1 You asked the computer a question > > 2 The values you passed to it don't have decimal points > > ... > > 4 Ergo, you wanted an answer that was incorrect. > Well put. However the nature