Re: weird GROUPING SETS and ORDER BY behaviour

2024-01-08 Thread Geoff Winkless
On Mon, 8 Jan 2024 at 11:12, Geoff Winkless wrote: > What's even more of a head-scratcher is why fixing this this then > breaks the _first_ group's ORDERing. Ignore that. Finger slippage - looking back I realised I forgot the "=0" test after the GROUPING() call. It

Re: weird GROUPING SETS and ORDER BY behaviour

2024-01-08 Thread Geoff Winkless
On Mon, 8 Jan 2024 at 10:23, Geoff Winkless wrote: > Seems there was a reason why I thought that: per the documentation: > > "The arguments to the GROUPING function are not actually evaluated, > but they must exactly match expressions given in the GROUP BY clause > of the as

Re: weird GROUPING SETS and ORDER BY behaviour

2024-01-08 Thread Geoff Winkless
On Sat, 6 Jan 2024 at 23:27, Geoff Winkless wrote: > Well yes. I assumed that since it's required that a group expression is in > the query itself that > the grouping values were taken from the result set, I have to admit to some > surprise that > they're calc

Re: weird GROUPING SETS and ORDER BY behaviour

2024-01-06 Thread Geoff Winkless
On Sat, 6 Jan 2024, 19:49 Tom Lane, wrote: > "David G. Johnston" writes: > > Something does seem off here with the interaction between grouping sets > and > > order by. > > Yeah. I think Geoff is correct to identify the use of subqueries in > the grouping sets as the triggering factor. [snip]

Re: weird GROUPING SETS and ORDER BY behaviour

2024-01-06 Thread Geoff Winkless
On Sat, 6 Jan 2024 at 16:22, David G. Johnston wrote: > On Sat, Jan 6, 2024 at 8:38 AM Geoff Winkless wrote: >> because when gp_conc is 0, it should be ordering by the concat() value. > > Something does seem off here with the interaction between grouping sets and > order by.

Re: weird GROUPING SETS and ORDER BY behaviour

2024-01-06 Thread Geoff Winkless
On Fri, 5 Jan 2024 at 18:34, Zhang Mingli wrote: > > On Jan 6, 2024 at 01:38 +0800, Geoff Winkless , wrote: > > > Am I missing some reason why the first set isn't sorted as I'd hoped? > > > Woo, it’s a complex order by, I try to understand your example. > A

weird GROUPING SETS and ORDER BY behaviour

2024-01-05 Thread Geoff Winkless
We have some (generated) SQL that uses grouping sets to give us the same data grouped in multiple ways (with sets of groups configurable by the user), with the ordering of the rows the same as the grouping set. This generally works fine, except for when one of the grouping sets contains part of ano

Re: First draft of the PG 15 release notes

2022-05-10 Thread Geoff Winkless
I'm guessing this should be "trailing", not training? > Prevent numeric literals from having non-numeric training characters (Peter > Eisentraut)

Re: Should we support new definition for Identity column : GENERATED BY DEFAULT ON NULL?

2021-11-03 Thread Geoff Winkless
On Wed, 3 Nov 2021 at 14:39, David Fetter wrote: > Unfortunately, the PREPARE/EXECUTE infrastructure, and not just for > PostgreSQL, has no way of passing along DEFAULT explicitly, i.e. it > My $.02: I'd be much happier with the idea of changing those obviously-deficient interfaces to allow expl

Re: Replace l337sp34k in comments.

2021-07-30 Thread Geoff Winkless
On Thu, 29 Jul 2021 at 22:46, Gavin Flower wrote: > Though in code, possibly it would be better to just use 'up-to-date' in > code for consistency and to make the it easier to grep? If it's causing an issue, perhaps using a less syntactically problematic synonym like "current" might be better? :

Re: Replace l337sp34k in comments.

2021-07-29 Thread Geoff Winkless
On Thu, 29 Jul 2021 at 11:22, Andrew Dunstan wrote: > Personally, I would have written this as just "up to date", I don't > think the hyphens are required. > FWIW Mirriam-Webster and the CED suggest "up-to-date" when before a noun, so the changes should be "up-to-date answer" but "are up to date

Re: "an SQL" vs. "a SQL"

2021-06-12 Thread Geoff Winkless
On Thu, 10 Jun 2021, 15:35 Alvaro Herrera, wrote: > src/backend/libpq/auth.c:847:* has. If it's an MD5 hash, we must do > MD5 authentication, and if it's a > src/backend/libpq/auth.c:848:* SCRAM secret, we must do SCRAM > authentication. > Not sure whether you were just listing examples

Re: INSERT ON CONFLICT and RETURNING

2020-09-03 Thread Geoff Winkless
On Mon, 31 Aug 2020 at 14:53, Konstantin Knizhnik wrote: > If we are doing such query: > > INSERT INTO jsonb_schemas (schema) VALUES (obj_schema) >ON CONFLICT (schema) DO UPDATE schema=jsonb_schemas.schema RETURNING id > > > Then as far as I understand no extra lookup is used to return ID: Th

Re: INSERT ON CONFLICT and RETURNING

2020-08-24 Thread Geoff Winkless
On Sat, 22 Aug 2020 at 08:16, Konstantin Knizhnik wrote: > It is possible to do something like this: > >with ins as (insert into jsonb_schemas (schema) values (obj_schema) > on conflict(schema) do nothing returning id) select coalesce((select id > from ins),(select id from jsonb_schemas where

Re: 2019-11-14 Press Release Draft

2019-11-14 Thread Geoff Winkless
On Tue, 12 Nov 2019 at 22:17, Jonathan S. Katz wrote: > Attached is a draft of the press release for the update release going > out on 2010-11-14. Please provide feedback, particularly on the > technical accuracy of the statements. Text by the `position()` should probably either be by `

Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'

2019-10-28 Thread Geoff Winkless
On Mon, 28 Oct 2019 at 13:31, Andrew Dunstan wrote: > How about instead of new operators we just provide a nice shorthand way > of saying these? e.g. ARE and AINT :-) Seems to me like this is something that those users who want it can implement for themselves with little to no effort without forc

Re: s/rewinded/rewound/?

2019-08-07 Thread Geoff Winkless
On Wed, 7 Aug 2019 at 16:59, Alvaro Herrera wrote: > He didn't > add a mailing list reference, but this is easy to find at > https://postgr.es/m/20160720180706.gf24...@momjian.us > I lean towards the view that he was using the literal program name as a > verb, rather than trying to decline a verb

Re: Poor plan when using EXISTS in the expression list

2018-10-04 Thread Geoff Winkless
On Thu, 4 Oct 2018 at 13:11, Pierre Ducroquet wrote: > Our developpers ORM (Django's) sadly can not use EXISTS in the where > clauses > without having it in the expression part of the SELECT statement. > I don't know if this will be helpful to you (and I appreciate there's still the underlying P

Re: Code of Conduct plan

2018-09-14 Thread Geoff Winkless
On Fri, 14 Sep 2018, 15:55 James Keener, wrote: > > > Yes. They can. The people who make the majority of the contributions to >> the software can decide what happens, because without them there is no >> software. If you want to spend 20 years of your life >> > > So everyone who moderates this gro

Re: Code of Conduct plan

2018-09-14 Thread Geoff Winkless
On Fri, 14 Sep 2018 at 15:10, James Keener wrote: > I understand the concern, however, if you look at how attacks happen > >> it is frequently through other sites. Specifically under/poorly >> moderated sites. For specific examples, people who have issues with >> people on Quora will frequently g

Re: NetBSD vs libxml2

2018-08-14 Thread Geoff Winkless
My opinion (if it's worth anything) is that a binary should not specify search paths for libraries other than those explicitly provided with it as part of its own package. The environment should handle shared library paths, using $LD_PATH or ldconfig or whatever. If a binary has to specify where i

Re: Have an encrypted pgpass file

2018-08-02 Thread Geoff Winkless
On Thu, 2 Aug 2018 at 10:41, I wrote: > Perhaps you could make your auditors happier by restricting that user's > permissions to only run a defined function, and make that function do the > work that the automation script wants? So even if the attacker can access > the password he will still only

Re: Have an encrypted pgpass file

2018-08-02 Thread Geoff Winkless
On Tue, 24 Jul 2018 at 11:25, Marco van Eck wrote: > Indeed having unencrypted password lying (.pgpass or PGPASSWORD or -W) > around is making my auditors unhappy, > With the greatest of respect, perhaps you need to get auditors who understand crypto better.​ ​Having a user that has the minimal

Re: late binding of shared libs for C functions

2018-06-12 Thread Geoff Winkless
On Tue, 12 Jun 2018 at 15:44, Christian Ullrich wrote: > > I did wonder about "NO CHECK" but wasn't sure if having two words > > would make the parser change more complex. > > DEFERRED? That's a good shout. I wouldn't mind either of those choices. So can I assume at least that no-one has an obje

Re: late binding of shared libs for C functions

2018-06-12 Thread Geoff Winkless
On Tue, 12 Jun 2018 at 13:41, Andrew Dunstan wrote: > On 06/12/2018 06:48 AM, Geoff Winkless wrote: > > +| AS 'obj_file', 'link_symbol' [UNBOUNDED] > > (I know UNBOUNDED isn't quite the word - BINDLATE would be better - > > but I figured I

late binding of shared libs for C functions

2018-06-12 Thread Geoff Winkless
Hi All Is it possible to use CREATE FUNCTION to link a shared library that doesn't yet exist? I don't think it is, but I might be missing something. If not, would it be something that people would be open to a patch for? I'm thinking of e.g. CREATE [ OR REPLACE ] FUNCTION name ( [ [ argmode

Re: Is a modern build system acceptable for older platforms

2018-05-30 Thread Geoff Winkless
On Wed, 30 May 2018 at 00:51, Yuriy Zhuravlev wrote: > You are totally wrong, I didn't it, especial called somebody "old". > ​Then I apologise for misunderstanding your intention. Language/culture barrier perhaps? Geoff >

Re: Is a modern build system acceptable for older platforms

2018-05-29 Thread Geoff Winkless
On Tue, 29 May 2018 at 11:42, Yuriy Zhuravlev wrote: > Is it worth spending thousands of person-hours converting what we have >> into something different that happens to be de rigeur, and (especially) >> using up many hours of our precious core developer time while they learn >> the new methods

Re: Is a modern build system acceptable for older platforms

2018-05-29 Thread Geoff Winkless
On Mon, 28 May 2018 at 03:30, Yuriy Zhuravlev wrote: > I suppose I can make summary after reading all this: > 1. Any change in the development process will be possible if it will be > convenient for each key developers personally only. (development process > include build system) > 2. Currently,

Re: Is a modern build system acceptable for older platforms

2018-05-02 Thread Geoff Winkless
On Wed, 2 May 2018 at 00:57, Yuriy Zhuravlev wrote: > Hello Geoff! > > About cmake: > 1. You can still use the binary build for your system. > 2. You can still build Postgres from source and with old gcc, you need > only install cmake (it's very easy) Only most modern versions of CMake > depend

Re: Is a modern build system acceptable for older platforms

2018-05-01 Thread Geoff Winkless
I'd like to add my 2c that, as a user who has to support postgres running on some fairly old systems, changing to a modern build mechanism (with all the resultant dependency hell that it would likely introduce) would be likely to cause me much grief. At the moment I can still log in to the old RH

Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS

2018-04-09 Thread Geoff Winkless
On 9 April 2018 at 11:50, Anthony Iliopoulos wrote: > What you seem to be asking for is the capability of dropping > buffers over the (kernel) fence and idemnifying the application > from any further responsibility, i.e. a hard assurance > that either the kernel will persist the pages or it will

Re: proposal: alternative psql commands quit and exit

2018-01-24 Thread Geoff Winkless
On 24 January 2018 at 13:58, Alvaro Herrera wrote: > But there's a simple solution to that: make it two messages, one when > inside quotes ("Use Control-C to clear the input buffer, then \q to > quit") and one outside (current wording). Wasn't this already proposed > elsewhere in the thread? I d

Re: proposal: alternative psql commands quit and exit

2018-01-17 Thread Geoff Winkless
On 17 January 2018 at 15:00, I wrote: > Ctrl-C quits immediately for me no matter what input stage I'm at in > Windows' psql. Ctrl-Z (DOS EOF) only quits after enter is pressed and > only at beginning-of-line, so I'd say suggesting the user uses Ctrl-C > in windows makes sense. ^D doesn't appear to

Re: proposal: alternative psql commands quit and exit

2018-01-17 Thread Geoff Winkless
On 17 Jan 2018 20:12, "Robert Haas" wrote: On Wed, Jan 17, 2018 at 10:00 AM, Geoff Winkless wrote: > On 17 January 2018 at 14:50, Tom Lane wrote: >> (I'm still not very sure which of ^C and ^D have Windows equivalents.) > > Ctrl-C quits immediately for me no mat

Re: proposal: alternative psql commands quit and exit

2018-01-17 Thread Geoff Winkless
On 17 January 2018 at 14:50, Tom Lane wrote: > (I'm still not very sure which of ^C and ^D have Windows equivalents.) Ctrl-C quits immediately for me no matter what input stage I'm at in Windows' psql. Ctrl-Z (DOS EOF) only quits after enter is pressed and only at beginning-of-line, so I'd say su

Re: proposal: alternative psql commands quit and exit

2018-01-17 Thread Geoff Winkless
On 17 January 2018 at 14:17, Chapman Flack wrote: > Well, the usual use of SIGQUIT is to abort a process while generating > a core dump so it can be post-mortem debugged, and the abort is immediate > without any exit hooks in the process having a chance to execute, so > maybe it isn't a habit we w

Re: proposal: alternative psql commands quit and exit

2018-01-17 Thread Geoff Winkless
On 16 January 2018 at 17:20, Robert Haas wrote: > (1) I doubt that we want to > override the user's terminal settings and (2) it won't work on > non-readline builds. I'm inclined to agree with (1). (2) is something that could be worked around with (relatively) small effort, and in theory we could

Re: proposal: alternative psql commands quit and exit

2018-01-16 Thread Geoff Winkless
On 15 January 2018 at 17:53, Tom Lane wrote: > Geoff Winkless writes: >> At this point it depends quite how far down the rabbit-hole you want >> to go to stop people googling "how do I exit psql", I suppose :p > > Well, I concur with Robert's comment upthre

Re: proposal: alternative psql commands quit and exit

2018-01-15 Thread Geoff Winkless
On 15 January 2018 at 17:03, Tom Lane wrote: > Geoff Winkless writes: >> And while trying to find the EOF setting in libreadline might get >> messy, you're already assuming that ctrl-C hasn't been knobbled using >> stty intr. Unless you want to go searching for t

Re: proposal: alternative psql commands quit and exit

2018-01-15 Thread Geoff Winkless
On 15 January 2018 at 16:56, David Fetter wrote: > On Mon, Jan 15, 2018 at 04:53:27PM +0000, Geoff Winkless wrote: >> And while trying to find the EOF setting in libreadline might get >> messy, you're already assuming that ctrl-C hasn't been knobbled >> using s

Re: proposal: alternative psql commands quit and exit

2018-01-15 Thread Geoff Winkless
On 15 January 2018 at 16:48, Tom Lane wrote: > Geoff Winkless writes: >> Perhaps different messages on different OSes? :) > > It's worse than that: the EOF key is configurable. In principle we > could look into the tty settings and print the right thing, but > I

Re: proposal: alternative psql commands quit and exit

2018-01-15 Thread Geoff Winkless
On 15 January 2018 at 16:16, Laurenz Albe wrote: > Geoff Winkless wrote: >> Can we not just say "ctrl-D to quit" instead of \q? Doesn't that work >> everywhere? > > Not on Windows, as far as I know. Well on Windows, Ctrl-C doesn't clear the input

Re: proposal: alternative psql commands quit and exit

2018-01-15 Thread Geoff Winkless
On 15 January 2018 at 16:10, Robert Haas wrote: > > More broadly, I think what is needed here is less C-fu than > English-fu. If we come up with something good, we can make it print > that thing. > Can we not just say "ctrl-D to quit" instead of \q? Doesn't that work everywhere? Geoff

Re: [PROPOSAL] bracketed-paste support for psql

2017-12-15 Thread Geoff Winkless
On 15 December 2017 at 17:13, Peter Eisentraut wrote: > You need to put > > set enable-bracketed-paste on > > into ~/.inputrc, then it works. Hmm, looks like that requires a newer version of readline (v7) than I have here. Oh well, if support is already there (albeit unavailable) then I'll leave

[PROPOSAL] bracketed-paste support for psql

2017-12-15 Thread Geoff Winkless
Hi It occurred to me the other day while people were talking about pasting blocks of text creating problems, especially with tabs, that xterm bracketed-paste support (also works in at least putty and probably others) that would block curses handling and just paste as-is would be a useful (and I'm

Re: proposal: alternative psql commands quit and exit

2017-12-12 Thread Geoff Winkless
On 12 December 2017 at 18:32, Chapman Flack wrote: > It seems to me that this is very close to the Robert Haas suggestion > already discussed upthread, except that suggestion only prints the > hint message when you might need it, which I'd find less intrusive. Well "close" yes, but I like "simple

Re: proposal: alternative psql commands quit and exit

2017-12-12 Thread Geoff Winkless
On 12 December 2017 at 16:36, Arthur Nascimento wrote: > Nano keeps a cheatsheet of commands on the bottom; and it's regarded > as a fairly good editor for newcomers. Some shells have a right-hand > side status bar. I quite like this idea, although I would rather a line printed after each command

Re: proposal: alternative psql commands quit and exit

2017-12-12 Thread Geoff Winkless
On 12 December 2017 at 16:39, Everaldo Canuto wrote: > On Tue, Dec 12, 2017 at 1:02 PM, Geoff Winkless wrote: >> There is also stackexchange question with 51000 views that asks how to >> start the postgresql client. Should we rename psql to mysql to help >> new users too? &

Re: proposal: alternative psql commands quit and exit

2017-12-12 Thread Geoff Winkless
I wouldn't exactly say -1 but it's a "meh" from me. On 8 December 2017 at 13:57, Daniel Vérité" wrote: > "How to exit from PostgreSQL command line utility: psql" > > now at 430k views and 1368 upvotes. There is also stackexchange question with 51000 views that asks how to start the postgresql cl

Re: pspg - psql pager

2017-11-15 Thread Geoff Winkless
On 15 November 2017 at 09:41, Pavel Stehule wrote: > Hi > > I finished new pager, that can be interesting for postgresql expert users. > > It demonstrate some possibilities of TUI and I hope it shows some possible > directions of future possibilities of psql. > > It is available as rpm from our r

Re: Migration to PGLister - After

2017-11-13 Thread Geoff Winkless
On 13 November 2017 at 17:10, Alvaro Herrera wrote: > Geoff Winkless wrote: >> The removal of the [HACKERS] (etc) header will be frustrating for me: I do >> not sort mailing lists into folders (I simply scan the "Forums" autofilter >> in gmail) and have no wish t

Re: Migration to PGLister - After

2017-11-13 Thread Geoff Winkless
The removal of the [HACKERS] (etc) header will be frustrating for me: I do not sort mailing lists into folders (I simply scan the "Forums" autofilter in gmail) and have no wish to do so, and there is no way to make such a machine-readable header visible in gmail. Perhaps those users who wish to us