Re: I slipped up so that no existing role allows connection. Is rescue possible?

2022-09-19 Thread Bryn Llewellyn
> adrian.kla...@aklaver.com wrote: > >> b...@yugabyte.com wrote: >> >>> t...@sss.pgh.pa.us wrote: >>> >>> ... >> >> So nice to find this waiting for me when I got back to the keyboard after a >> late lunch. Thanks, Tom. And thanks to David, too who said much the same. >> I'll note how I spell

Re[4]: CVE-2022-2625

2022-09-19 Thread misha1966 misha1966
Thank you all! Everything worked out! CVE-2022-2625 contains a lot more than it seems...     >Пятница, 16 сентября 2022, 0:19 +09:00 от Tom Lane : >  >=?UTF-8?B?bWlzaGExOTY2IG1pc2hhMTk2Ng==?= < mmisha1...@bk.ru > writes: >> Is there a patch for 9.6 ? >No; that's out of support too. > >You might

Re: I slipped up so that no existing role allows connection. Is rescue possible?

2022-09-19 Thread Adrian Klaver
On 9/19/22 16:15, Bryn Llewellyn wrote: // /t...@sss.pgh.pa.us wrote: / So nice to find this waiting for me when I got back to the keyboard after a late lunch. Thanks, Tom. And thanks to David, too who said much the same. I'll note how I spelled the magic—as a lit

Re: GIST combo index condition chosen for users queries is different from table owner's query

2022-09-19 Thread Tom Lane
Dennis White writes: > Is there something I can do to allow users queries to use the index with a > condition like that used for the table owner's query? It looks like the problem in your badly-optimized query is that there is not an indexable condition being extracted from the ST_INTERSECTS() ca

Re: I slipped up so that no existing role allows connection. Is rescue possible?

2022-09-19 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > >> b...@yugabyte.com writes: >> >> Is rescue possible? Or must I simply remove my cluster and use "pg_ctl" to >> create a new one within my existing PG 14.5 software env? > > Stop the cluster, start a single-user session ("postgres --single"), re-grant > superuser

GIST combo index condition chosen for users queries is different from table owner's query

2022-09-19 Thread Dennis White
My project is using PostgreSQL 12.9 and has a table that gets millions of positions of ships every day. It is partitioned by tier (the importance of position) and sub-partitioned by time. We also use RLS to restrict access to rows in the table. Our problem is the query planner will not let user qu

Re: I slipped up so that no existing role allows connection. Is rescue possible?

2022-09-19 Thread David G. Johnston
On Monday, September 19, 2022, Bryn Llewellyn wrote: > **Summary** > > Is rescue possible? Or must I simply remove my cluster and use "pg_ctl" to > create a new one within my existing PG 14.5 software env? > > Running the postgres executable in single user mode should provide an avenue I believe.

Re: I slipped up so that no existing role allows connection. Is rescue possible?

2022-09-19 Thread Tom Lane
Bryn Llewellyn writes: > Is rescue possible? Or must I simply remove my cluster and use "pg_ctl" to > create a new one within my existing PG 14.5 software env? Stop the cluster, start a single-user session ("postgres --single"), re-grant superuser to the postgres user and/or whatever else you wi

I slipped up so that no existing role allows connection. Is rescue possible?

2022-09-19 Thread Bryn Llewellyn
*Summary* Is rescue possible? Or must I simply remove my cluster and use "pg_ctl" to create a new one within my existing PG 14.5 software env? *Detail* This is a sandbox PostgreSQL 14.5 cluster on my MacBook and it contains nothing of value. I was doing some empirical destructive tests with a

Re: Re: Where's the doc for "array()" — as in "select array(values (17), (42))"

2022-09-19 Thread Tom Lane
Bryn Llewellyn writes: > This works fine: > select length( (select 'dog') ) > But without the doubled parentheses, it causes a syntax error. The parens are required for it to be a valid scalar subquery, as per https://www.postgresql.org/docs/current/sql-expressions.html#SQL-SYNTAX-SCALAR-SUBQUE

Re: Where's the doc for "array()" — as in "select array(values (17), (42))"

2022-09-19 Thread David G. Johnston
On Mon, Sep 19, 2022 at 9:44 AM Bryn Llewellyn wrote: > > There must be a significant difference between this: > > select 'dog' > That isn't anything in particular (it is a command by itself, it can be a subquery in a FROM clause or the ARRAY() expression. > > and this: > > (select 'dog') >

Re: Where's the doc for "array()" — as in "select array(values (17), (42))"

2022-09-19 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > >> b...@yugabyte.com wrote: >> >> Why is the "array()" constructor not found in "pg_proc"? > > Because it isn't a function. Yeah, it kind of looks like one, but its > argument is a subquery. If SQL had first-class functions and closures, maybe > ARRAY() could be i

Re: Where's the doc for "array()" — as in "select array(values (17), (42))"

2022-09-19 Thread Bryn Llewellyn
> adrian.kla...@aklaver.com wrote: > > b...@yugabyte.com wrote: > >> Thanks. I can't, even now, formulate a search that finds this—unless I know >> that it's a kind of array constructor. (I'll concede, with the benefit of >> hindsight, that I should have thought of that.) I hope that I'll be ab

Re: Suggest using boolean index with (bflag is true) condition for the query with (bflag = true) clause

2022-09-19 Thread Tom Lane
Laurenz Albe writes: > On Sun, 2022-09-18 at 18:24 +0300, Евгений Плискин wrote: >> So why not use this index for this query? > Because the conditions are different: > SELECT NULL = TRUE, NULL IS TRUE; > ?column? │ ?column? > ══╪══ > │ f > (1 row) > The first result

Re: Where's the doc for "array()" — as in "select array(values (17), (42))"

2022-09-19 Thread Adrian Klaver
On 9/18/22 21:20, Bryn Llewellyn wrote: Thanks. I can't, even now, formulate a search that finds this—unless I know that it's a kind of array constructor. (I'll concede, with the benefit of hindsight, that I should have thought of that.) I hope that I'll be able to learn to navigate the PG d

Re: Suggest using boolean index with (bflag is true) condition for the query with (bflag = true) clause

2022-09-19 Thread Laurenz Albe
On Sun, 2022-09-18 at 18:24 +0300, Евгений Плискин wrote: > This is not a bug report but rather a suggestion. > > Suppose database contains an index on a boolean column like this: >   create table1(id int, amount float, best_record boolean); >   create index index1 on table1(best_record) w

Re: What ist the standard setting of FETCH_COUNT?

2022-09-19 Thread Pavel Stehule
Hi po 19. 9. 2022 v 11:10 odesílatel Tiaswin napsal: > What is the standard default setting for fetch_count and where can I > find the current setting? > [pavel@localhost pspg-master]$ psql Assertions: on psql (16devel) Type "help" for help. (2022-09-19 11:11:47) postgres=# \set AUTOCOMMIT = '

What ist the standard setting of FETCH_COUNT?

2022-09-19 Thread Tiaswin
What is the standard default setting for fetch_count and where can I find the current setting? Thanks.

Fwd: Postgresql/Postgis: Trigger for historization/versioning

2022-09-19 Thread celati Laurent
Good evening, I work with Postgresql 13, Postgis (and Qgis 3.22.) My need is to set up within my Postgis database (used for maps production), triggers for automation of data historization/versioning. The idea: For instance within a table 'BOREHOLE' (geometry: points), different updates of the table

Suggest using boolean index with (bflag is true) condition for the query with (bflag = true) clause

2022-09-19 Thread Евгений Плискин
This is not a bug report but rather a suggestion. Suppose database contains an index on a boolean column like this: create table1(id int, amount float, best_record boolean); create index index1 on table1(best_record) where best_record is true; And suppose we issue a query like this:

pg RLS suggestions needed

2022-09-19 Thread Laura Smith
I've got a table with an RLS policy on it: Policies:    POLICY "app_users_policy"       USING ((app_id = CURRENT_USER)) Is there a way I'm not aware of (e.g. via Pl/PGSQL) that would allow "migration" of data from one RLS owner to another ? At the moment, the only option I can think of is for t