Re: Syntax error needs explanation [RESOLVED]

2025-07-14 Thread David G. Johnston
On Monday, July 14, 2025, Laurenz Albe wrote: > On Mon, 2025-07-14 at 12:19 -0700, Rich Shepard wrote: > > On Mon, 14 Jul 2025, David G. Johnston wrote: > > > > > The error indicates your script file is at least 127 lines long and you > > > are showing like

Re: Syntax error needs explanation

2025-07-14 Thread David G. Johnston
On Mon, Jul 14, 2025 at 12:59 PM Rich Shepard wrote: > > The current version of the script: > > select c.company_nbr, c.company_name, c.industry > from companies as c > where exists ( >select e.company_nbr >from enforcement as e >) > group by c.industry > order by c.industry; > > And

Re: Performance of JSON type in postgres

2025-07-14 Thread David G. Johnston
On Mon, Jul 14, 2025 at 12:54 PM Adrian Klaver wrote: > On 7/14/25 12:51, veem v wrote: > > So I want to > > understand the experts' opinion on this which I believe will be > > crucial during design itself. > > It is spelled out here: > > https://www.postgresql.org/docs/current/datatype-json.htm

Re: Syntax error needs explanation

2025-07-14 Thread David G. Johnston
On Mon, Jul 14, 2025 at 12:45 PM Adrian Klaver wrote: > > > > I mistyped the script's extension as .txt rather than .sql. > > That does not matter, that is more for user convenience in figuring out > what the files are for. > > I think all that is being said is the error was a simple typo, choosi

Re: Syntax error needs explanation

2025-07-14 Thread David G. Johnston
On Mon, Jul 14, 2025 at 12:12 PM Rich Shepard wrote: > I have the following script: > > select c.company_nbr, c.company_name, i.industry, > from companies as c, industry as i, enforcement as e > where exists ( >select c.company_nbr, count(e.action_date), sum(e.penalty_amt) >from e.enforce

Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS)

2025-07-14 Thread David G. Johnston
On Mon, Jul 14, 2025 at 12:02 PM Benjamin Wang wrote: > I am not sure whether PostgreSQL depends on system call `fsyncdata` to > sync data to disk. > https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-WAL-SYNC-METHOD David J.

Re: having temp_tablespaces on less reliable storage

2025-07-10 Thread David G. Johnston
On Thu, Jul 10, 2025 at 10:58 AM Dimitrios Apostolou wrote: > Can't find any related documentation, but I expect loss of "temp" space is > of minor importance. > You might want to try finding some old discussions about why putting temp tablespace on a RAM-drive is not a supported configuration.

Re: Password Encryption and Connection Issues

2025-07-09 Thread David G. Johnston
On Wed, Jul 9, 2025 at 8:09 AM Ron Johnson wrote: > That requires setting the password to null and then recreating the > password, no? > You might want to verify that claim, and suggest a doc patch or bug fix if you find it to be true - I sure don't see anything that remotely suggests this. Dav

Re: Password Encryption and Connection Issues

2025-07-09 Thread David G. Johnston
On Wed, Jul 9, 2025 at 6:57 AM Alpaslan AKDAĞ wrote: > >1. In such a case, what would be the recommended approach or best >practice to follow during upgrades in order to avoid this kind of issue? > > This is all described quite clearly in the documentation, including the upgrade procedure

Re: pg_upgrade: can I use same binary for old & new?

2025-07-05 Thread David G. Johnston
On Sat, Jul 5, 2025 at 9:52 AM Pierre Fortin wrote: > If new pg_upgrade is the only binary, will both -b and -B default to it? > Maybe at minimum I may need to specify: > $ pg_upgrade -b /usr/bin -d data15 -D data17 -k > > pgsql/pgsql-18/bin > ./pg_ctl -D /var/pgsql/postgres-17 start waiting for

Re: Postgresql support for Windows Server 2025

2025-07-02 Thread David G. Johnston
On Wednesday, July 2, 2025, Gaurav Aradhya wrote: > > Can you please let me know when Postgresql 17.x shall be supported for > Windows Server 2025? Greatly appreciated your feedback. > Impossible to guess when someone may choose to set up a build farm member running that OS. David J.

Re: PLPGSQL - store fetched records in array of record

2025-07-02 Thread David G. Johnston
On Wednesday, July 2, 2025, Durumdara wrote: > > > Is there any way to avoid this? To use a "simple untyped record" in an > array without "dependencies"? > Use jsonb David J.

Re: Figure out nullability of query parameters

2025-06-27 Thread David G. Johnston
On Friday, June 27, 2025, Giacomo Cavalieri wrote: > > It would be really handy to know that `$1` is being used as a non nullable > value, while `$2` could actually be null. Can this already be achieve > today, or would there be a way to surface this kind of information for > query parameters in

Re: Question about different behaviour in pg_wal when archive_mode is set on or off

2025-06-26 Thread David G. Johnston
On Thursday, June 26, 2025, Arpad Kiss A wrote: > Can someone explain why the difference in behavior? Does postgres only use > the seqno only to differentiate the wal files here? Why does postgres not > rotate out files in the former case? > Seems like it is being helpful not throwing away data

Re: Convert JSON value back to postgres representation

2025-06-19 Thread David G. Johnston
On Thursday, June 19, 2025, Laurenz Albe wrote: > On Thu, 2025-06-19 at 23:05 +0200, Phillip Diffley wrote: > > Postgres has a to_jsonb function that will convert a value into its > jsonb representation. > > I am now trying to turn a json value back into its postgres type. I was > hoping there wo

Re: Retrieving current date

2025-06-18 Thread David G. Johnston
On Wednesday, June 18, 2025, sivapostg...@yahoo.com wrote: > > > How to change the setting(s), if any, to retrieve the current date and > time in IST? > https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-TIMEZONES Not totally sure if that will or won’t impact how pgAdmin be

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread David G. Johnston
On Mon, Jun 16, 2025, 10:21 Adrian Klaver wrote: > On 6/16/25 09:29, adolfo flores wrote: > > Hello Team, > > > > I hope you can help me with an issue we're experiencing. We have an app > > running on Kubernetes that opens a huge number of connections within a > > couple of seconds. > > > > The d

Re: pg_upgradecluster version 10 to 16 question

2025-06-11 Thread David G. Johnston
On Wednesday, June 11, 2025, Bruce Momjian wrote: > On Wed, Jun 11, 2025 at 11:59:24AM -0700, Jim Cunning wrote: > > I configured the PGDG repository and tried to install postgresql-10 on my > > kubuntu 24.04 LTS desktop system, but apt refused to install it because > of > > unsatisfied dependenc

Re: pg_upgradecluster version 10 to 16 question

2025-06-10 Thread David G. Johnston
On Tue, Jun 10, 2025 at 1:01 PM Jim Cunning wrote: > I obviously no longer have a running version 10 server, > You will need to correct this lack if you want to make use of version 10 data files. David J.

Re: get speed help

2025-05-19 Thread David G. Johnston
On Monday, May 19, 2025, Dias Thomas wrote: > Hello all, > Could i get a help, postgres 1 billion records indexed table, search > speed in a normal machine, no parallel processing ... for a knowledge ?? > https://wiki.postgresql.org/wiki/Slow_Query_Questions David J.

Re: an error message that I don't understand

2025-05-02 Thread David G. Johnston
On Fri, May 2, 2025 at 1:25 PM Martin Mueller < martinmuel...@northwestern.edu> wrote: > > table tid from new index tuple (32586,21) overlaps with invalid duplicate > tuple at offset 120 of block 4398 in index "aacorrections_tcpreading_idx" > Read that as "your index is corrupted". > I have no

Re: Upsert error "column reference is ambiguous"

2025-04-29 Thread David G. Johnston
On Tuesday, April 29, 2025, Tim Starling wrote: > > > This is a public interface and there may be callers in code that I don't > have access to. > You might help your cause by sharing examples of how client code uses your driver to perform upsert that runs into this limitation. David J.

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread David G. Johnston
On Monday, April 28, 2025, Tom Lane wrote: > > AFAIK, "ON CONFLICT" is a Postgres-ism. Exactly which constructs > in exactly which other databases are you citing as precedent? > I confirmed the SQLite reference from the original email. “The upsert above inserts the new vocabulary word "jovial"

Re: Upsert error "column reference is ambiguous"

2025-04-27 Thread David G. Johnston
On Sunday, April 27, 2025, Tim Starling wrote: > thus allowing it to DWIM. We intentionally choose (or, in any case have established) a SWYM approach here. Personally I’d be fine with the reduced helpfulness in trying to prevent buggy queries in the interest of being more conforming with the b

How to get the data from the query

2025-04-26 Thread David G. Johnston
On Saturday, April 26, 2025, Igor Korot wrote: > but the size comes out "" (empty) > > What is the value you are expecting? What is the minimal table definition (i.e., a one or few column table) that would produce this expected value? What does psql show if you use it to output the query against

How to properly fix memory leak

2025-04-25 Thread David G. Johnston
On Friday, April 25, 2025, Igor Korot wrote: > > And the error case was handled correctly, right? > Seems like answering that requires knowing what the query is or can be. I also have no idea what idiomatic code looks like. Though, I’d probably use PQresultErrorMessage and check affirmatively

Re: How to properly fix memory leak

2025-04-25 Thread David G. Johnston
On Friday, April 25, 2025, Igor Korot wrote: > > for( int i = 0; i < PQntuples( res ); i++ ) > { > auto temp1 = m_pimpl->m_myconv.from_bytes( PQgetvalue( > res, i, 1 ) ); > m_tablespaces.push_back( temp1 ); > } // this line gives a leak according to

Re: Another documentation issue

2025-04-23 Thread David G. Johnston
On Wednesday, April 23, 2025, Igor Korot wrote: > > The question is more about the default value... > 0 or 1, determined at server compilation time. You quoted the documentation that says this… David J.

Re: Another documentation issue

2025-04-23 Thread David G. Johnston
On Wednesday, April 23, 2025, Igor Korot wrote: > > How do you handle sch situation from the client POV? > Get the current value. If it’s non-zero the system definitely supports it. If it’s zero it probably doesn’t. But give the user an option to specify a value anyway just in case. If they

Re: Another documentation issue

2025-04-23 Thread David G. Johnston
On Tuesday, April 22, 2025, Igor Korot wrote: > Hi, ALL, > > On the page https://www.postgresql.org/docs/current/runtime-config- > query.html#GUC-SEQ-PAGE-COST > > it is only given the default value of this parameter. > > No min/max values are provided.. > > The same can be sad about > https://ww

Re: Feature Proposal: Column-Level DELETE Operation in SQL

2025-04-22 Thread David G. Johnston
On Monday, April 21, 2025, Abhishek Hatgine wrote:. > > >- > >More intuitive for developers coming from languages or NoSQL systems >where fields can be "deleted" from an object/document. > > Why should this matter to us? We don’t have this paradigm, you can’t remove columns from exist

Re: sequence on daily log partitioned table

2025-04-21 Thread David G. Johnston
On Monday, April 21, 2025, senor wrote: > > I'm mainly interested in understanding how this works or why it can't > Partition routing happens on fully-formed tuples. They thus must be formed initially using only context, like defaults, attached to the partitioned table. You can do what you want

Re: Clarification on the docs

2025-04-19 Thread David G. Johnston
On Sat, Apr 19, 2025 at 4:17 PM Igor Korot wrote: > > Could you indicate the default value for every option here? > >> >> The descriptions clearly indicate the defaults for nearly all of them, and the one exception is a single click away (gin_pending_list_limit). I don't find that the informatio

Re: Error while updating a table

2025-04-19 Thread David G. Johnston
On Sat, Apr 19, 2025 at 6:06 AM sivapostg...@yahoo.com < sivapostg...@yahoo.com> wrote: > By any chance, if I get that statement, what should I do? > Read it. What are the Steps (or documentation) to correct this issue? > > Impossible to say until the statement is read. David J.

Re: Fwd: Identify system databases

2025-04-16 Thread David G. Johnston
On Wed, Apr 16, 2025 at 8:07 AM Dominique Devienne wrote: > On Wed, Apr 16, 2025 at 4:39 PM Tom Lane wrote: > > Laurenz Albe writes: > > > On Wed, 2025-04-16 at 10:09 +0200, Dominique Devienne wrote: > > So in a way, you guys are saying one should never REVOKE CONNECT ON > DATABASE FROM PUBLIC?

Re: Fwd: Identify system databases

2025-04-15 Thread David G. Johnston
On Tue, Apr 15, 2025 at 5:24 PM Adrian Klaver wrote: > > > > By creating the initial three databases the system is more usable due to > > having established conventions. They are conventional databases, not > > system ones. > > The bottom line is the Postgres project has built an infrastructure

Re: Fwd: Identify system databases

2025-04-15 Thread David G. Johnston
On Tue, Apr 15, 2025 at 11:20 AM Adrian Klaver wrote: > On 4/15/25 09:48, David G. Johnston wrote: > > On Tue, Apr 15, 2025 at 9:31 AM Adrian Klaver > <mailto:adrian.kla...@aklaver.com>> wrote: > > > > > > > Agreed. > > > > The

Re: Fwd: Identify system databases

2025-04-15 Thread David G. Johnston
On Tue, Apr 15, 2025 at 9:31 AM Adrian Klaver wrote: > On 4/15/25 09:21, Igor Korot wrote: > > > > > > > Hi, David, > > > > On Tue, Apr 15, 2025 at 9:56 AM David G. Johnston > > mailto:david.g.johns...@gmail.com>> wrote: > > > >

Re: Identify system databases

2025-04-15 Thread David G. Johnston
On Tuesday, April 15, 2025, Igor Korot wrote: > Hi, ALL, > Is there a field in the pg_databases table which indicates that particular > DB is a system one? > What is a system database? David J.

Re: To take backup of Postgresql Database without large objects

2025-04-11 Thread David G. Johnston
On Friday, April 11, 2025, Adrian Klaver wrote: > On 4/11/25 22:06, sivapostg...@yahoo.com wrote: > > Either my command should be wrong or I'm missing something. >> > > This was explained in my post as quoted below. Yeah, the short version. Then you added a long version that just confused the

Re: To take backup of Postgresql Database without large objects

2025-04-11 Thread David G. Johnston
On Friday, April 11, 2025, sivapostg...@yahoo.com wrote: > > > bytea field also included in the backup. > Bytea typed columns are completely separate things than large objects. You cannot exclude individual columns using pg_dump. David J.

Re: Clarification on the docs

2025-04-11 Thread David G. Johnston
On Friday, April 11, 2025, Igor Korot wrote: > Hi, David, > > On Fri, Apr 11, 2025 at 9:04 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Fri, Apr 11, 2025 at 6:49 PM Igor Korot wrote: >> >>> Hi, ALL, >>> On the http

Re: Clarification on the docs

2025-04-11 Thread David G. Johnston
On Fri, Apr 11, 2025 at 6:49 PM Igor Korot wrote: > Hi, ALL, > On the > https://www.postgresql.org/docs/17/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS > its said: > > [quote] > The optional WITH clause specifies storage parameters for the index. > Each index method has its own set of

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
On Thursday, April 10, 2025, Tom Lane wrote: > Merlin Moncure writes: > > I guess the real problems here are lack of feedback on a number of > fronts: > > *) the server knows the function is not immutable but lets you create it > > anyway, even though it can have negative downstream consequences

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
On Wednesday, April 9, 2025, Olleg Samoylov wrote: > > On 10.04.2025 01:08, Tom Lane wrote: > >> Yeah. The assumption is that you had a reason for marking the >> function IMMUTABLE and you want the planner to treat it that way >> even if it isn't really. (There are valid use-cases for that, for

Re: Capturing both IP address and hostname in the log

2025-04-10 Thread David G. Johnston
On Thu, Apr 10, 2025 at 5:22 AM Tefft, Michael J wrote: > The documentation for log_hostname says: > > log_hostname (boolean) > > By default, connection log messages only show the IP address of the > connecting host. Turning this parameter on causes logging of the host name > as well. Note that d

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
On Thu, Apr 10, 2025 at 8:49 AM Nico Williams wrote: > On Wed, Apr 09, 2025 at 02:43:11PM -0700, Adrian Klaver wrote: > > On 4/9/25 14:21, Nico Williams wrote: > > > That to_char is not immutable is not documented though. Though it's > > > clear when looking at the docs for the `jsonb_.*_tz()` f

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-09 Thread David G. Johnston
On Wed, Apr 9, 2025 at 1:50 PM Laurenz Albe wrote: > If you use EXPLAIN (VERBOSE), you will see that the function gets inlined > in the fast case. > > That saves the overhead of a function call. > > The IMMUTABLE function cannot be inlined because to_char() is not > IMMUTABLE. > So, the punishme

Re: [EXTERNAL] Re: Cannot connect local with ttrust (pg_upgrade assumes it)

2025-04-09 Thread David G. Johnston
On Wed, Apr 9, 2025, 12:21 Abraham, Danny wrote: > Thanks again. > Here is the example: > > dba-tlv-x6y64k% cat pg_hba.conf > # TYPE DATABASEUSERCIDR-ADDRESS METHOD > local all all trust > hostall all 0.0.0

Re: Cannot connect local with ttrust (pg_upgrade assumes it)

2025-04-09 Thread David G. Johnston
On Wed, Apr 9, 2025 at 9:20 AM Abraham, Danny wrote: > Fail > Failures include messages indicating why. You should always share such messages. Showing the command that produced the failure is also advised. David J.

Re: Best way to check if a table is empty

2025-04-05 Thread David G. Johnston
On Sunday, March 23, 2025, Marcelo Fernandes wrote: > Hi folks, > > I came up with three strategies to verify whether a table is empty. 3 is strictly terrible worse to answer “is live row count > 0”. Using an index likely serves no/negative benefit since it contains no tuple liveness informati

Re: After upgrading libpq, the same function(PQftype) call returns a different OID

2025-04-05 Thread David G. Johnston
On Thu, Mar 20, 2025 at 2:56 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Thu, Mar 20, 2025 at 11:54 AM Tom Lane wrote: > >> I think it's a mistake to suppose that pg_type_d.h is the only > >> place where there's a risk of confusi

Re: Best way to check if a table is empty

2025-04-05 Thread David G. Johnston
On Sunday, March 23, 2025, David G. Johnston wrote: > > Maybe IOS helps though I do wonder whether a sequential scan skips over > known all-dead pages making that relative benefit go away. > Well, no, since it tracks known visible, not known non-visible, though for something like a

Re: Doubt on pg_timezone_names and pg_timezone_abbrevs

2025-03-31 Thread David G. Johnston
On Mon, Mar 31, 2025 at 8:39 PM Jayadevan M wrote: > Hello PG members, > I used 'IST' in a query like this - * (timestamp_hour) at time zone > 'IST' time_ist *and did not get the expected output - timestamp in Indian > Standard Time. So I queried the 2 views that provide timezone info and did >

Re: Querying one partition in a function takes locks on all partitions

2025-03-31 Thread David G. Johnston
On Mon, Mar 31, 2025 at 9:42 AM Renan Alves Fonseca wrote: > I'm not sure if we should mention the fix or if we should mention a > workaround... > Workarounds are ok but my observation is that "this may change in the future" comments are pointless and should be stricken from the manual because p

Re: SQL Server's WITH (NOLOCK) equivalent in PostgreSQL?

2025-03-30 Thread David G. Johnston
On Sunday, March 30, 2025, 이현진 wrote: > > Since PostgreSQL uses MVCC, I'm wondering what the best practice is for > non-blocking reads, > and whether there's an equivalent to dirty reads or READ UNCOMMITTED. > https://www.postgresql.org/docs/current/transaction-iso.html We are unable to impleme

Re: BTREE index: field ordering

2025-03-28 Thread David G. Johnston
On Fri, Mar 28, 2025 at 9:24 AM Ron Johnson wrote: > > "at least for WHERE conditions that are selective" confuses me. Aren't > _all_ WHERE clauses selective? > > >From earlier in the email, selectivity is a scale, the wording here implies "has a meaningful selectivity". "Fundamentally yes, but

Re: BTREE index: field ordering

2025-03-28 Thread David G. Johnston
On Fri, Mar 28, 2025 at 10:02 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > Selectivity is evaluating cardinality with an eye on the frequency of > the values you are actually going to be filtering on. So low cardinality > booleans can be highly selective in u

Re: Determine server version from psql script

2025-03-24 Thread David G. Johnston
On Sunday, March 23, 2025, Igor Korot wrote: > > 2. Is there a way to do CREATE TRIGGER IF NOT EXIST for the earlier > version? > No. You have to drop the trigger if it does exist and then create the new one. David J.

Re: Determine server version from psql script

2025-03-23 Thread David G. Johnston
On Sunday, March 23, 2025, David G. Johnston wrote: > On Sunday, March 23, 2025, Igor Korot wrote: > >> >> 2. Is there a way to do CREATE TRIGGER IF NOT EXIST for the earlier >> version? >> > > No. You have to drop the trigger if it does exist and then cr

Re: Determine server version from psql script

2025-03-23 Thread David G. Johnston
On Sunday, March 23, 2025, Igor Korot wrote: > > CREATE TRIGGER playersinleague_insert AFTER INSERT ON playersinleague > WHEN new.current_rank IS NULL > > When the syntax shows parentheses you are required to write them. [ WHEN ( *condition* ) ] David J.

Re: Best way to check if a table is empty

2025-03-23 Thread David G. Johnston
On Sunday, March 23, 2025, Christophe Pettus wrote: > > (And to be pedantic, #1 returns TRUE / FALSE while #2 returns / > NULL, so they aren't exactly equivalent. If you are able to handle / > NULL, you don't need the EXISTS clause.) > Leaving the limit in place, without exists #1 returns eit

Re: Determine server version from psql script

2025-03-23 Thread David G. Johnston
On Sunday, March 23, 2025, Pavel Stehule wrote: > Hi > > ne 23. 3. 2025 v 19:31 odesílatel Igor Korot napsal: > >> Hi, >> >> [code] >> SELECT current_setting('server_version_num')::int > 13 as v13 >> > > SELECT current_setting('server_version_num')::int > =14 as v14 > IOW, you can’t us

Re: Need help understanding has_function_privilege

2025-03-23 Thread David G. Johnston
On Friday, March 21, 2025, Cosimo Simeone wrote: > Hi, and thanks (both of you!) > Shouldn't the > create role my_user NOINHERIT; > avoid this? And since not, why? :-) > > We might need to improve documentation surrounding the public pseudo-role a bit. Since it’s not a true group role I suspect

Re: Determine server version from psql script

2025-03-22 Thread David G. Johnston
On Saturday, March 22, 2025, Igor Korot wrote: > > >> Is it actually running in psql? >> > > Yes, i run "psql - d draft -a -f > Then read the psql docs. Your version has \if and you’ll find server version listed as the available client variables. David J.

Re: After upgrading libpq, the same function(PQftype) call returns a different OID

2025-03-20 Thread David G. Johnston
On Thu, Mar 20, 2025 at 11:54 AM Tom Lane wrote: > =?utf-8?Q?=C3=81lvaro?= Herrera writes: > > That said, we could add a comment that makes this more obvious: > > ... > > This looks a tad redundant in pg_type.h itself, but makes the generated > > pg_type_d.h file more obvious: > > I think it's a

Re: After upgrading libpq, the same function(PQftype) call returns a different OID

2025-03-20 Thread David G. Johnston
On Thu, Mar 20, 2025 at 8:42 AM Sebastien Flaesch wrote: > > */** > * * Backwards compatibility for ancient random spellings of pg_type OID > macros.* > * * Don't use these names in new code.* > * */* > #define CASHOID MONEYOID > #define LSNOID PG_LSNOID > > #define BOOLOID 16 > #define BYTEAOID

Re: Need help understanding has_function_privilege

2025-03-20 Thread David G. Johnston
On Wednesday, March 19, 2025, Cosimo Simeone wrote: > > > true? > Well... Ok, "whatever"... I revoke it: > =# revoke execute on function my_schema.my_func(text) from my_user; > REVOKE > Roles can inherit privileges. my_user is inheriting its execute privilege from PUBLIC. You have to revoke a g

Re: The logic behind comparing generic vs. custom plan costs

2025-03-15 Thread David G. Johnston
On Sat, Mar 15, 2025 at 10:42 AM Justin Blank wrote: > My idea had been that even if the custom plans average higher cost > than the generic plan, it is still worth considering custom plans. If > 1 time in 5, the custom plan is 10% of the cost of the generic plan, > it doesn't matter if the avera

Re: Query optimization

2025-03-13 Thread David G. Johnston
On Thursday, March 13, 2025, Durgamahesh Manne wrote: > > > > > >

Re: Creating files with testdata

2025-03-11 Thread David G. Johnston
On Mon, Mar 10, 2025 at 12:17 PM H wrote: > There are tables referencing each other using randomly generated IDs, ie. > those IDs are not known until after the parent table row is inserted. > I just reserve half of the number space of bigint, the negatives, for test data and assign known IDs as

Re: exclusion constraint question

2025-03-08 Thread David G. Johnston
On Sat, Mar 8, 2025 at 12:01 PM Rhys A.D. Stewart wrote: > > CHECK (l_mug_id <> c_mug_id AND l_mug_id <> r_mug_id AND c_mug_id > <> r_mug_id), > EXCLUDE USING gist (l_mug_id WITH <>, c_mug_id WITH <>, r_mug_id > WITH <>) -- Not working as expected (or my expectations are wrong). > ); > >

Re: Messages o Terminal

2025-03-04 Thread David G. Johnston
On Tue, Mar 4, 2025 at 6:07 PM Igor Korot wrote: > [quote] > NOTICE: relation "abcatcol" already exists, skipping > [/quote] > > Is there any way to suppress this NOTICE message? > > Specifically, no. Any notice message, yes. https://www.postgresql.org/docs/current/runtime-config-client.html#RU

Re: Error on the query

2025-03-04 Thread David G. Johnston
On Tuesday, March 4, 2025, Igor Korot wrote: > > [code] > queries.push_back( L"DO $$ BEGIN IF NOT EXISTS( SELECT 1 FROM > pg_class c, pg_namespace n WHERE n.oid = c.relnamespace AND c.relname > = \'abcatc_x\' AND n.nspname = \'public\' ) THEN CREATE UNIQUE INDEX > \"abcatc_x\" ON \"abcatco

Re: Review my steps for rollback to restore point

2025-03-04 Thread David G. Johnston
On Tuesday, March 4, 2025, chandan Kumar wrote: > Thank you for your time and clarification. > Does PITR recreate database internally ? can i say it is not the same as > pg_restore or it is same as pg_restore plus applying WAL on top of it. I > am asking because can we revern DDL operations wi

Re: Review my steps for rollback to restore point

2025-03-04 Thread David G. Johnston
On Tuesday, March 4, 2025, chandan Kumar wrote: > Thank you for your answer. I want to clarify one more doubt. Can PITR be > achieved without applying Base Backup > The point-in-time you choose must be in the future relative to whatever data files you are applying WAL on top of. That is only

Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread David G. Johnston
On Saturday, March 1, 2025, Krishnakant Mane wrote: > > Can you tell me how exactly should the syntax be? > https://www.postgresql.org/docs/current/ddl-schemas.html > Is my function definition wrong? > It isn’t a function definition, it is a function call. David J.

Re: create_immv issue on aws Ubuntu even after create extention

2025-03-01 Thread David G. Johnston
On Saturday, March 1, 2025, Krishnakant Mane wrote: > > pg_ivm | 1.10 | pg_catalog > > plpgsql | 1.0 | pg_catalog. > > > 2) show search_path; > "$user" public. > 3) \df *.create_immv > pgivm | create_immv | bigint | text, text | func. > Provide the outputs from the above three commands in your re

Re: Please implement a catch-all error handler per row, for COPY

2025-03-01 Thread David G. Johnston
On Sat, Mar 1, 2025 at 9:20 AM Tom Lane wrote: > me nefcanto writes: > > Can you please provide a row-level catch-all handler for the copy > command? > > Very unlikely to happen. COPY is not intended as a general purpose > ETL mechanism, and we don't want to load it down with features that > wo

Re: How to return seto records from seof record function?

2025-02-25 Thread David G. Johnston
On Tuesday, February 25, 2025, Олег Самойлов wrote: > Postgresql 17.2 > > How to return seto records from seof record function? I tried > pg_background extension: > > > *CREATE* *OR* *REPLACE* *FUNCTION* public.autonomous (p_script *text*) > > *RETURNS* *SETOF* record > > *LANGUAGE* plpgsql > > *

Re: Deleting idle connections

2025-02-24 Thread David G. Johnston
On Mon, Feb 24, 2025 at 3:50 PM Yongye Serkfem wrote: > > I am having a series of idle connections and unable to delete them with a > single command. Any help in realizing this would be greatly appreciated. > > "deleting" really isn't the word used to describe this, terminate, kill, or disconnect

Re: Default Value Retention After Dropping Default

2025-02-24 Thread David G. Johnston
On Mon, Feb 24, 2025 at 9:37 AM Adrian Klaver wrote: > On 2/24/25 03:50, Laurenz Albe wrote: > > On Mon, 2025-02-24 at 20:56 +1300, Marcelo Fernandes wrote: > >> I am experiencing an interesting behavior in PostgreSQL and would like > to seek > >> some clarification. > > > >> > >> Can anyone expl

Re: DROP ROLE as SUPERUSER

2025-02-21 Thread David G. Johnston
On Friday, February 21, 2025, Dominique Devienne wrote: > On Fri, Feb 21, 2025 at 3:33 PM Tom Lane wrote: > >> Dominique Devienne writes: >> > The point I'm trying to make, is that "hunting down" grantor(s) to >> connect >> > to DB(s) to be able to "force drop" a ROLE is a PITA. And I really wi

Re: DROP ROLE as SUPERUSER

2025-02-20 Thread David G. Johnston
On Thu, Feb 20, 2025 at 9:21 AM Dominique Devienne wrote: > But that's not much better. It's basically like the SET ROLE to the > GRANTOR I did. > I guess what I want is GRANTED BY ANYONE! And not have to figure out > GRANTOR(s). > Your stated use case is dropping a role. Does the combination o

Re: DROP ROLE as SUPERUSER

2025-02-20 Thread David G. Johnston
On Thursday, February 20, 2025, Dominique Devienne wrote: > Hi. Today I was surprised that REVOKE ALL ON DATABASE FROM ROLE silently > did nothing, even with CASCADE, when I was running it as SUPERUSER, > preventing DROP'ing the ROLE. I had to manually SET ROLE to the GRANTOR, do > the REVOKE, wh

Re: DROP ROLE as SUPERUSER

2025-02-20 Thread David G. Johnston
On Thu, Feb 20, 2025 at 9:05 AM Tom Lane wrote: > "David G. Johnston" writes: > > On Thursday, February 20, 2025, Dominique Devienne > > wrote: > >> Hi. Today I was surprised that REVOKE ALL ON DATABASE FROM ROLE silently > >> did nothing, even with

Re: DROP ROLE as SUPERUSER

2025-02-20 Thread David G. Johnston
On Thursday, February 20, 2025, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thursday, February 20, 2025, Dominique Devienne > wrote: > >> Hi. Today I was surprised that REVOKE ALL ON DATABASE FROM ROLE silently >> did nothing, even with CASCADE, when I

Re: Loading the latest N rows into the cache seems way too fast.

2025-02-17 Thread David G. Johnston
On Mon, Feb 17, 2025 at 2:41 PM Ron Johnson wrote: > On Mon, Feb 17, 2025 at 4:36 PM Tom Lane wrote: > >> Ron Johnson writes: >> > The bigint "id" column in "mytbl" is populated from a sequence, and so >> is >> > monotonically increasing: the newest records will have the biggest id >> > values.

Re: Clarification on Role Access Rights to Table Indexes

2025-02-17 Thread David G. Johnston
On Monday, February 17, 2025, Tom Lane wrote: > Ayush Vatsa writes: > > postgres=> SELECT pg_prewarm('pg_class_oid_index'); > > ERROR: permission denied for index pg_class_oid_index > > You'd really have to take that up with the author of pg_prewarm. This is our contrib module so this seems l

Clarification on Role Access Rights to Table Indexes

2025-02-17 Thread David G. Johnston
On Monday, February 17, 2025, Ayush Vatsa wrote: > postgres=# CREATE ROLE alpha; > > CREATE ROLE > postgres=# GRANT SELECT ON pg_class TO alpha; > This is pointless, everyone (i.e. the PUBLIC pseudo-role) can already read pg_class. 1. Can a role have access rights to a table without having acces

Re: Bash profile

2025-02-15 Thread David G. Johnston
On Sat, Feb 15, 2025 at 12:01 PM Yongye Serkfem wrote: > > I would appreciate any assistance with configuring the bash profile to run > two different postgresql versions. Specifically V12.7 and 15.7 > > Can you provide more detail on what you are trying to do, and why? Your request doesn't make

Re: PG-15.6: timeout parameters erroring out

2025-02-09 Thread David G. Johnston
On Sunday, February 9, 2025, Tom Lane wrote: > Mukesh Tanuku writes: > > We unabled the postgres timeout parameters in the postgresql.conf file > > > *idle_in_transaction_session_timeout = '1min'idle_session_timeout = > '5min'* > Did you actually run them together on one line like that? > I th

Re: PG-15.6: timeout parameters erroring out

2025-02-09 Thread David G. Johnston
On Sunday, February 9, 2025, Mukesh Tanuku wrote: > > > > *idle_in_transaction_session_timeout = '1min'idle_session_timeout = '5min'* > I suspect our docs may need an update. They say you may include white space before the unit; it probably needs to be changed to “must”. I believe we’ve recentl

Re: Lookup tables

2025-02-04 Thread David G. Johnston
On Tuesday, February 4, 2025, Rich Shepard wrote: > > I want to replace the old lookup table (with no FK) with this one. > Is the use of FK here intentional or a typo? Because everything written so far leads me to believe it should be PK. Pri,are key is the unique side, Foreign key is the usag

Re: Understanding ALTER DEFAULT PRIVILEGES Behavior in PostgreSQL

2025-02-04 Thread David G. Johnston
On Tuesday, February 4, 2025, Ayush Vatsa wrote: > > postgres=# ALTER DEFAULT PRIVILEGES IN SCHEMA my_schema REVOKE EXECUTE ON > FUNCTIONS FROM PUBLIC; > ALTER DEFAULT PRIVILEGES > As the documentation explains: Default privileges that are specified per-schema are added to whatever the global de

Re: Lookup tables

2025-02-04 Thread David G. Johnston
On Tuesday, February 4, 2025, Michał Kłeczek wrote: > > > On 4 Feb 2025, at 18:27, Thiemo Kellner > wrote: > > > >  Unless the lookup table is actually a check constraint one can use to > populate dropdown boxes in an interface. > > That is even worse because it ceases being transactional and u

Re: Lookup tables

2025-02-04 Thread David G. Johnston
On Tue, Feb 4, 2025 at 9:31 AM Michał Kłeczek wrote: > > > > On 4 Feb 2025, at 15:27, Rich Shepard wrote: > > > > Should lookup tables have a numeric FK column as well as the description > column? > > > > If so, how should I add an FK to the two lookup tables in my database? > > I’ve read the wh

Re: Lookup tables

2025-02-04 Thread David G. Johnston
On Tuesday, February 4, 2025, Rich Shepard wrote: > On Tue, 4 Feb 2025, David G. Johnston wrote: > > The point of a lookup table is to provide a unique list of authoritative >> values for some purpose. Kinda like an enum. But having the label serve as >> the unique value is

Re: Lookup tables

2025-02-04 Thread David G. Johnston
On Tuesday, February 4, 2025, Ron Johnson wrote: > On Tue, Feb 4, 2025 at 9:28 AM Rich Shepard > wrote: > >> Should lookup tables have a numeric FK column as well as the description >> column? >> > > Does your lookup table just have one column? (That's what your question > seems to imply, but t

Re: Lookup tables

2025-02-04 Thread David G. Johnston
On Tuesday, February 4, 2025, Ron Johnson wrote: > On Tue, Feb 4, 2025 at 9:41 AM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Tuesday, February 4, 2025, Rich Shepard >> wrote: >> >>> Should lookup tables have a numeric FK co

  1   2   3   4   5   6   7   8   9   10   >