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
exists ( select from enforcement as e where e.company_nbr = c.company_nbr ) group by c.industry; David J.

Re: Performance of JSON type in postgres

2025-07-14 Thread David G. Johnston
w.postgresql.org/docs/current/datatype-json.html > > I've taken to heart the main takeaway from that page: "In general, most applications should prefer to store JSON data as jsonb, unless there are quite specialized needs, such as legacy assumptions about ordering of object keys." David J.

Re: Syntax error needs explanation

2025-07-14 Thread David G. Johnston
d is the error was a simple typo, choosing the wrong file to execute. Not reading the error message was the real issue, not a failure to understand how psql scripting works. David J.

Re: Syntax error needs explanation

2025-07-14 Thread David G. Johnston
uot; > LINE 1: company_nbr | company_name > ^ > and I'm not seeing the error. What am I missing? > The error indicates your script file is at least 127 lines long and you are showing like 9...also do you usually name your script files with a .txt extension? David J.

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
supported configuration. David J.

Re: Password Encryption and Connection Issues

2025-07-09 Thread David G. Johnston
suggests this. David J.

Re: Password Encryption and Connection Issues

2025-07-09 Thread David G. Johnston
e, hopefully you can just change all passwords to use scram and move on. David J.

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

2025-07-05 Thread David G. Johnston
ol file appears to be corrupt David J.

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
form you’ve shown here is part of that. Not sure we’d turn it down but someone will need to step up and scratch their own itch in all likelihood (the request for similar functionality in the result comes up too). David J.

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

2025-06-26 Thread David G. Johnston
ng away data you may be experimenting with during a point-in-time recovery. David J.

Re: Convert JSON value back to postgres representation

2025-06-19 Thread David G. Johnston
gap for arrays. Scalars you can just cast and composites have these functions. But no simple/direct way to go from json array to sql array is presently implemented. Though since 17 json_query can apparently do it. select pg_typeof( json_query('[1,2,3]'::jsonb, '$' returning integer[]) ) -> integer[] David J.

Re: Retrieving current date

2025-06-18 Thread David G. Johnston
act how pgAdmin behaves but it is how you tell the server where you are. Strongly advise using the full formal name and not an abbreviation or offset. David J.

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

2025-06-16 Thread David G. Johnston
to be the value for max_connections. It is not clear to me > what "... connection limit of 30% of the max_connections setting" is > referring to? > See "alter database ... set" David J.

Re: pg_upgradecluster version 10 to 16 question

2025-06-11 Thread David G. Johnston
hat PG10 was obsolete when 24.04 came out this isn’t a shock to me. David J.

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: Sudden increase in n_dead_tup with no corresponding insert/update/delete

2025-06-03 Thread David Rowley
e that ran. Analyze will try to estimate the live and dead rows, but since analyze only samples some blocks, it may come up with something that's not too accurate if the blocks it happened to sample don't contain similar percentages of dead rows than the entire table. See [1]. Dav

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: Feature-Request: Performance-Optimization when using limit in combination with order by on querys using union

2025-05-08 Thread David Rowley
.918.41" part that you're seeing in the EXPLAIN output. You could try adding an index that suits all your equality WHERE clause filters, or some subset of them and put the date column as the final indexed column and see what happens. David

Re: an error message that I don't understand

2025-05-02 Thread David G. Johnston
ndex is corrupted". > I have no idea what is going on or how to deal with it and will be > grateful for advice > > > You will need to rebuild the index. If you've recently performed an OS upgrade you may also wish to update most/all indexes to fix possible collations issues. David J.

Re: SQL ERROR subquery uses ungrouped column in PostgreSQL

2025-04-30 Thread David Rowley
normal? How can I simply resolve the problem? Calculate the dat column in a subquery in the outer-level query. Something like: FROM (select *,to_char(dat, 'MM') as strdat from table1) table1 JOIN table2 USING (num_poste) then use strdat in all the places you're currently using to_char(dat, 'MM') David

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-29 Thread David Rowley
to force everyone to rewrite their RETURNING statements when upgrading to v18. The moral of that story is, UPDATE isn't exactly consistent already about when it requires column qualifications. Maybe it's weird to insist that users qualify columns with their ON CONFLICT UPDATE SET when RETURNING is happy to assume you must have meant NEW. David

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread David G. Johnston
ocabulary word "jovial" if that word is not already in the dictionary, or if it is already in the dictionary, it increments the counter. The "count+1" expression could also be written as "vocabulary.count". PostgreSQL requires the second form, but SQLite accepts either.” https://sqlite.org/lang_upsert.html David J.

Re: Upsert error "column reference is ambiguous"

2025-04-27 Thread David G. Johnston
the broader world. I am curious as to whether we are in strict adherence to the SQL Standard on this point though. Makes deviation a bit tougher to justify. It does seem that project policies would prevent back-patching such a change. David J.

Re: Changing default fillfactor for the whole database

2025-04-26 Thread David Rowley
t's possible that you can use an event trigger [1] that triggers on CREATE TABLE to get what you want here. If the docs don't give you enough information, then maybe [2] will have something you can work with. I've not used them much, so I don't have any recipes for you. David

How to get the data from the query

2025-04-26 Thread David G. Johnston
to output the query against that table? David J.

How to properly fix memory leak

2025-04-25 Thread David G. Johnston
rmatively for the tuples and error cases and have a final else should the status be something unexpected. David J.

Re: How to properly fix memory leak

2025-04-25 Thread David G. Johnston
l PQclear() on every iteration of the loop? > Would make processing more than a single row impossible if you throw away the result after processing one row. David J.

Re: explain

2025-04-24 Thread David Rowley
On Fri, 25 Apr 2025 at 03:06, Laurenz Albe wrote: > > On Fri, 2025-04-25 at 01:41 +1200, David Rowley wrote: > > The 79.3 seconds is the total time spent doing reads for all parallel > > workers. 52.6 seconds is the wall clock time elapsed to execute the > > query. > &g

Re: explain

2025-04-24 Thread David Rowley
; I/O Timings: read=79368.246 write=11.486 > > So, the total execution time is 52655 ms ok > and the total time for i/o is...79368 ms > > how ??? The 79.3 seconds is the total time spent doing reads for all parallel workers. 52.6 seconds is the wall clock time elapsed to execute the query. David

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
If they try and it errors, it doesn’t support it. David J.

Re: Another documentation issue

2025-04-23 Thread David G. Johnston
same can be sad about > https://www.postgresql.org/docs/current/runtime-config- > query.html#GUC-RANDOM-PAGE-COST Costs can’t be negative and no reasonable positive value is going to exceed the data type limit, which is communicated via the data type specification. David J.

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

2025-04-22 Thread David G. Johnston
igm, you can’t remove columns from existence on a per-row basis. David J.

Re: sequence on daily log partitioned table

2025-04-21 Thread David G. Johnston
You can do what you want if you directly insert into the individual partitions, using the partitioned table as a read-only interface. It looks like this: https://dbfiddle.uk/Xc3cUHSO David J.

Re: Clarification on the docs

2025-04-19 Thread David G. Johnston
I don't find that the information is hard to understand so no, I'm not going to spend my time summarizing it in an email. David J.

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
of your databases UUID names and ensure that non-superusers must be told the databases they are allowed to connect to. But feel free to work out a design and add it to the ToDo list for the v4 protocol. The use case seems reasonable and doable (on the basis of the replication protocol works). https://wiki.postgresql.org/wiki/Todo#Wire_Protocol_Changes_.2F_v4_Protocol David J.

Re: Fwd: Identify system databases

2025-04-15 Thread David G. Johnston
n or experience that they are "postgres", "template1" and "template0". Pick whichever of "system" or "convention" or some other word makes you happy to categorize those three databases. Though I suggest "the initdb" databases since neither of the other terms is used anywhere in the documentation. David J.

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
version that just confused the issue. Why point out exclude blobs if you know they are using bytea? David J.

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
P-Gist: fillfactor GIN: fastupdate gin_pending_list_limit BRIN: pages_per_range autosummarize David J.

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
volatility of the used functions and compare them to the volatility of the UDF. David J.

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
unction volatility match the most volatile function you internally call - constant input arguments don’t change this. There is no reason to perform number formatting immutably - function call results involving table data are not memoized. David J.

Re: Capturing both IP address and hostname in the log

2025-04-10 Thread David G. Johnston
olution setup this might impose a non-negligible +performance penalty. This parameter can only be set in the postgresql.conf file or on the server command line. Both the connection logging routine and log_line_prefix %h / %r simply report the "identifier of the host making the connection". David J.

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
y because \df+ does show this information as well, so at least one doesn't have to go write the catalog query themself. David J.

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-09 Thread David G. Johnston
IMMUTABLE. > So, the punishment for lying about the volatility of one's function is to prohibit it from being inlined even in a case where had you been truthful about the volatility it would have been inlined. David J.

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

2025-04-09 Thread David G. Johnston
>>>>>> > PSQL should not have asked for the password. > Thanks > Danny > Suggests there are environment variables coming into play making non-default choices for you. Namely, making you not use local as the connection method. David J.

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
els if doing this check on large bloated tables is what your existing choices have led to. David J.

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: Querying one partition in a function takes locks on all partitions

2025-04-05 Thread David Rowley
On Sat, 29 Mar 2025 at 06:00, Evgeny Morozov wrote: > > On 23/03/2025 2:35 pm, David Rowley wrote: > >> alter table entity_2 add column new_column text; > > Is this just an example command? You can't add a column to a > > partition directly. > > Yes, it was

Re: Postgres Query Plan using wrong index

2025-04-04 Thread David Rowley
of assuming an even distribution, you use that minimum value to tell you what percentage of the index must be read before a match is found. The stored maximum position value would do the same job for backward index scans. David

Re: Postgres Query Plan using wrong index

2025-04-02 Thread David Rowley
y is positional information of where certain values are within indexes according to an ordered scan of the index. I don't quite know how we'd represent that exactly, but if we knew that a row matching col_a > 4996 wasn't until somewhere near the end of idx_col_a_btree index, then we'd likely not want to use that index for this query. David

Re: Doubt on pg_timezone_names and pg_timezone_abbrevs

2025-03-31 Thread David G. Johnston
pose. There is a way to get a different interpretation for IST to be recognized but I'd have to find it or wait for others to chime in. David J.

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

2025-03-31 Thread David G. Johnston
from the manual because people are bad at predicting the future. Just document what is and don't string people along. We never go back to old releases and say "This was fixed in v17." David J.

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

2025-03-30 Thread David G. Johnston
rnative approach for that use case could be suggested. David J.

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

2025-03-30 Thread David Rowley
g in the relevant spot in [1]. David [1] https://postgr.es/m/CAApHDvogvzANoTOCyXUWgEuPFx1nT6S63aAN0bDRSJ=tagb...@mail.gmail.com

Re: BTREE index: field ordering

2025-03-28 Thread David G. Johnston
alues you are actually going to be filtering on. So low cardinality booleans can be highly selective in usage if you are looking for the rare false in a sea of trues but low selectivity if looking through those trues. David J.

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
without exists #1 returns either an empty set or an , never NULL. Always returning a Boolean seems like a better API choice though; but standardizing on that final transform doesn’t change the base comparison. David J.

Re: Determine server version from psql script

2025-03-23 Thread David G. Johnston
'server_version_num')::int > =14 as v14 > IOW, you can’t use >13 because that will match v13.1 which is 130001 in integer format. David J.

Re: Need help understanding has_function_privilege

2025-03-23 Thread David G. Johnston
not a true group role I suspect inherit/noinherit doesn’t apply. (You also cannot SET to it, nor admin it - not tested.) Losing the execute privilege on every built-in function would be way too annoying. David J.

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

2025-03-23 Thread David Rowley
LAIN ANALYZE. It is possible to determine the number of partitions which were removed during this phase by observing the “Subplans Removed” property in the EXPLAIN output." Perhaps something like. "It's important to note that any partitions removed by the partition pruning done

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
t code" would seem mostly interested in these OIDs and not stuff like the attribute numbers of the columns in pg_type. I get a distinct feel of one file serving multiple use cases. > As for CASHOID and LSNOID, surely those have been deprecated long > enough that we could just remove them? > > I'd probably just leave them. David J.

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

2025-03-20 Thread David G. Johnston
e invested in the outcome you have more motivation than probably anyone else to dive into it and make concrete suggestions for change. All that said, a comment at the top of what is probably the most important section of the header seems warranted. Even if it is just mostly formality. Mentioning the constant-ness of the integers should be part of that. David J.

Re: Need help understanding has_function_privilege

2025-03-20 Thread David G. Johnston
m PUBLIC. You have to revoke a granted privilege. David J.

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

2025-03-15 Thread David G. Johnston
ssumption is that at moderate to high reuse volumes it is quite probable that a generic plan will win or at least be acceptable in 999 in 1000 or more executions, not 4 in 5. David J.

Re: Query optimization

2025-03-13 Thread David G. Johnston
'BOX'::text) AND (competitionid = 'U-1998'::text) AND (eventid = >>> 'U-523596'::text)) >>> Heap Fetches: 1 >>> Planning Time: 0.084 ms >>> Execution Time: 0.043 ms >>> >> >> >> To return one row takes 43ms is not optimal >> > You are off by a factor of 1000 in your claimed performance. It’s 0.043ms David J.

Re: Creating files with testdata

2025-03-11 Thread David G. Johnston
wn IDs as part of the test data specification. David J.

Re: exclusion constraint question

2025-03-08 Thread David G. Johnston
null); > > Any suggestions would be appreciated. > > Using "equals" or "not equals" when one of the inputs can be null is not usually what you want to do. The comparison evaluates to NULL which the constraint allows. David J.

Re: Messages o Terminal

2025-03-04 Thread David G. Johnston
rent/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT See: client_min_messages David J.

Re: Error on the query

2025-03-04 Thread David G. Johnston
EN CREATE UNIQUE INDEX > \"abcatc_x\" ON \"abcatcol\"(\"abc_tnam\" ASC, \"abc_ownr\" ASC, > \"abc_cnam\" ASC); END IF; END;" ); > [/code] > > What am I missing? > “ ERROR: unterminated dollar-quoted string at or near‘ The terminator for your dollar-quoted string. David J.

Re: Review my steps for rollback to restore point

2025-03-04 Thread David G. Johnston
logical images of the database so applying WAL on top of pg_restore is technically invalid - but it does effective convey the idea. It’s like saying pg_dump and pg_basebackup are similar. Sure, in some ways that is true - but the logical vs. physical distinction cannot be ignored fully. David J.

Re: Review my steps for rollback to restore point

2025-03-04 Thread David G. Johnston
t is only possible of you’ve backed up the data files at some point in the past and use that backup. 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: > > 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
tputs from the above three commands in your response. > > See this issue for why this is different now. https://github.com/sraoss/pg_ivm/pull/116 Then deal with the fact it is no longer installed to pg_control but instead pgivm. With usual schema qualifications or search_path techniques. David J.

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

2025-03-01 Thread David G. Johnston
e feature isn't driving its development the odds of it getting worked on is fairly low. David J.

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

2025-02-25 Thread David G. Johnston
s you have no way to know what the caller has specified as the return data type in order to write the inner generic function call correctly. Maybe you can convert the record result to jsonb and return that? David J.

Re: Deleting idle connections

2025-02-24 Thread David G. Johnston
source; or use something like pgbouncer. David J.

Re: Default Value Retention After Dropping Default

2025-02-24 Thread David G. Johnston
lumn, for all existing rows, when it was executed. While the value of the substitute is equal to the non-volatile default specified for the column it is an independent thing. Subsequently dropping or changing the default does not impact this substitute value. There is no way to impact the substitute value via SQL that I know of. David J.

Re: DROP ROLE as SUPERUSER

2025-02-21 Thread David G. Johnston
nything in this case. > So I don't see how these recommendations are relevant to this particular > case. --DD > >From “drop owned”: Any privileges granted to the given roles on objects in the current database or on shared objects (databases, tablespaces, configuration parameters) will also be revoked. So, the command does more than the name suggests. David J.

Re: DROP ROLE as SUPERUSER

2025-02-20 Thread David G. Johnston
le. Does the combination of reassign and drop owned not fulfill the requirements? https://www.postgresql.org/docs/current/role-removal.html Also, you had to know the role you wanted to drop so you already figured out the grantor. David J.

Re: DROP ROLE as SUPERUSER

2025-02-20 Thread David G. Johnston
n. Why isn't it? > This has nothing to do with power/permissions. It is about not specifying “granted by” in your SQL command and thus failing to fully and correctly specify the single permission you want to revoke. David J.

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: How to select avg(select max(something) from ...)

2025-02-18 Thread David Rowley
gt; > It doesn't like that reference to "d.dvm_id) in that subquery. You could use LATERAL before the subquery in the FROM clause, or you could adjust the subquery by removing the "where dvm_id=d.dvm_id" replacing it with GROUP BY dvm_id and adding that column to the SELECT list and include that in the join condition between the tables. David

  1   2   3   4   5   6   7   8   9   10   >