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

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

2025-02-17 Thread David G. Johnston
needs is a pointer to represent the future data, not the data itself. And PERFORM will never resolve that pointer by itself - so as Tom said your query would need to force pointer resolution by computing on the data. David J.

Re: Clarification on Role Access Rights to Table Indexes

2025-02-17 Thread David G. Johnston
his is our contrib module so this seems like the expected place to ask such a question. It’s neither a bug nor a topic for -hackers. FTR, Robert Haas is the author from 2013. Not sure he monitors -general though. David J.

Clarification on Role Access Rights to Table Indexes

2025-02-17 Thread David G. Johnston
s the pg_prewarm call fail [1] in the above scenario? > > [1] https://github.com/postgres/postgres/blob/master/contrib > /pg_prewarm/pg_prewarm.c#L108-L110 > It fails because AFAICS there is no way for it to work on an index, only tables. David J.

Re: Bash profile

2025-02-15 Thread David G. Johnston
st doesn't make sense as stated. David J.

Re: PG-15.6: timeout parameters erroring out

2025-02-09 Thread David G. Johnston
f space I mentioned earlier, in the config text literal, is fine. David J.

Re: PG-15.6: timeout parameters erroring out

2025-02-09 Thread David Rowley
nstants [2] require single quotes or the dollar quoting format and 5min isn't a valid number. David [1] https://www.postgresql.org/docs/17/sql-set.html [2] https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS

Re: PG-15.6: timeout parameters erroring out

2025-02-09 Thread David G. Johnston
SET > idle_in_transaction_session_timeout = 1min > 2025-02-10 04:17:19.845 GMT [2467575] ERROR: trailing junk after numeric > literal at or near "1m" at character 43 > 2025-02-10 04:17:19.845 GMT [2467575] STATEMENT: SET > idle_in_transaction_session_timeout = 1min > ... > David J.

Re: Lookup tables

2025-02-04 Thread David G. Johnston
ey is the usage side. David J.

Re: Understanding ALTER DEFAULT PRIVILEGES Behavior in PostgreSQL

2025-02-04 Thread David G. Johnston
to reverse the effects of a previous per-schema GRANT. David J.

Re: Lookup tables

2025-02-04 Thread David G. Johnston
ith the correct matching values showing up in the UI? David J.

Re: Lookup tables

2025-02-04 Thread David G. Johnston
e business should probably be considered part of its primary key - they don't announce "under new ownership/management" just for fun - the new owner wants to keep the brand recognition but discard historical opinions that are likely no longer true. David J.

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
ve values for some purpose. Kinda like an enum. But having the label serve as the unique value is reasonable - we only add surrogates for optimization. David J.

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

Re: Lookup tables

2025-02-04 Thread David G. Johnston
nd is a smaller value. Lots of alter tables and update queries. David J.

Re: Using psql's \prompt command

2025-01-30 Thread David G. Johnston
On Thu, Jan 30, 2025 at 3:46 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, Jan 30, 2025 at 3:44 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> On Thu, Jan 30, 2025 at 3:38 PM Rich Shepard >> wrote: >> >

Re: Using psql's \prompt command

2025-01-30 Thread David G. Johnston
On Thu, Jan 30, 2025 at 3:44 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, Jan 30, 2025 at 3:38 PM Rich Shepard > wrote: > >> On Thu, 30 Jan 2025, Rich Shepard wrote: >> >> > Thank you. I'll look into using the \set command. >>

Re: Using psql's \prompt command

2025-01-30 Thread David G. Johnston
; Please point me to a reference where I can learn how to get the user input > string into the script. > That is what \prompt is for. You have the correct meta-command, you were capturing user input just fine. Read about how to use variables in queries for the part you are missing. David J.

Re: Using psql's \prompt command

2025-01-30 Thread David G. Johnston
On Thursday, January 30, 2025, Rich Shepard wrote: > > > What's the correct syntax for the \prompt? > Prompt isn’t your issue. Prompt stores the value into a variable. Read how to reference variables in a psql script. David J.

Re: Meaning of + symbol at end of column string

2025-01-22 Thread David G. Johnston
hat does that + symbol mean in this context? > The value has a line break break character sequence at that point (I forget if it has any awareness of CR and CRLF differences…) David J.

Re: Automatic deletion of orphaned rows

2025-01-22 Thread David G. Johnston
nce. > The description was correct even though using probably imprecise terminology. The basic goal is to delete childless parents. David J.

concatenating hstores in a group by?

2025-01-19 Thread David G. Johnston
On Friday, January 17, 2025, Brent Wood wrote: > > I want to concatenate the hstores, > > There are no hstore aggregate functions. You’ll want to convert them to,json first then use the json_objectagg aggregate function. David J.

Re: About PostgreSQL Query Plan

2025-01-14 Thread David Rowley
;. We maybe could do a bit more work to initialise those more lazily as we do for INSERT statements, but I'd be surprised if it was a problem for 64 partitions, especially so for an update statement that might be touching 3 months of data. Nothing about these existing in the "Update on" portion of the EXPLAIN output means that that partition will be scanned by the UPDATE statement, rest assured. David

  1   2   3   4   5   6   7   8   9   10   >