Re: Copy Bulk Ignore Duplicated

2019-06-18 Thread Peter J. Holzer
ot;c.h" before line 17 of pg_bulkload.c. But ultimately you should report this incompatibility to the author(s) of pg_bulkload. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated

Re: Row data is reflected in DETAIL message when constraints fail on insert/update

2019-06-22 Thread Peter J. Holzer
se that data? Nope. The client application should show it to the user or log it somewhere where an authorized person can find it. "Something didn't work, please ask your system administrator" is not an adequate error message if the system administrator has no way to ge

Re: Row data is reflected in DETAIL message when constraints fail on insert/update

2019-06-22 Thread Peter J. Holzer
On 2019-06-22 19:09:41 +0200, Karsten Hilbert wrote: > On Sat, Jun 22, 2019 at 06:40:10PM +0200, Peter J. Holzer wrote: > > > How is it useful in a normally configured database to return row data in > > > error messages? > > > > This is extremely useful. It tell

Re: DBD::Pg (version 3.16.3) returns EMPTY char columns as 'undef'

2023-04-25 Thread Peter J. Holzer
'id' => 2, 't' => ' ' }, { 't' => ' ', 'id' => 3 }, { 't' => 'a',

Re: libpq and multi-threading

2023-05-02 Thread Peter J. Holzer
you are talking about threads and not processes? In the OSs I am familiar with, threads (of the same process) share a common address space. You don't need explicit shared memory and there is no such thing as "parent memory" (there is thread-local storage, but that's more a compiler/libr

Re: libpq and multi-threading

2023-05-03 Thread Peter J. Holzer
exactly. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Death postgres

2023-05-06 Thread Peter J. Holzer
limits the space a process may use on disk while the OOM killer gets activated when the system runs out of RAM. So these seem to be unrelated. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |

Re: Death postgres

2023-05-10 Thread Peter J. Holzer
occurs 1 million times in both table_a and table_b, the join will create 1 trillion rows for that value alone. That doesn't explain the crash or the disk usage, but it would explain the crazy cost (and would probably be a hint that this query is unlikely to finish in any reasonable time).

Re: Death postgres

2023-05-10 Thread Peter J. Holzer
On 2023-05-10 22:52:47 +0200, Marc Millas wrote: > On Wed, May 10, 2023 at 7:24 PM Peter J. Holzer wrote: > > On 2023-05-10 16:35:04 +0200, Marc Millas wrote: > >  Unique  (cost=72377463163.02..201012533981.80 rows=1021522829864 width= > 97) > >  

Re: Death postgres

2023-05-11 Thread Peter J. Holzer
?? > (I know, 14.8 is up...) Maybe the older version of postgres didn't use as many workers for that query (or maybe not parallelize it at all)? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |

Re: Death postgres

2023-05-12 Thread Peter J. Holzer
On 2023-05-12 17:41:37 +0200, Marc Millas wrote: > On Fri, May 12, 2023 at 8:31 AM Peter J. Holzer wrote: > My guess is that the amount of parallelism is the problem. > > work_mem is a per-node limit. Even a single process can use a multiple of > work_mem if the query

Re: Is there a good way to handle sum types (or tagged unions) in PostgreSQL?

2023-05-19 Thread Peter J. Holzer
u can probably centralize that somewhere and the rest of your code will be blissfully unaware. (Of course you can stuff those values in a single column of JSONB type. But I don't think this is better.) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Modeling combinations (options and dependencies)

2023-05-19 Thread Peter J. Holzer
ation. (Although I wonder how fast that validation is: That also looks like it could potentially have exponential runtime) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: 15 pg_upgrade with -j

2023-05-23 Thread Peter J. Holzer
oes any file system allow this?) this would at best spread the updates across two LUNs (the inodes would presumable stay on the source LUN and the target directory would be on the target LUN). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: 15 pg_upgrade with -j

2023-05-23 Thread Peter J. Holzer
On 2023-05-23 13:17:24 -0500, Ron wrote: > On 5/23/23 12:19, Peter J. Holzer wrote: > > On 2023-05-22 21:10:48 -0500, Ron wrote: > > > On 5/22/23 18:42, Tom Lane wrote: > > > > It looks like the as

Re: Maintaining accents with "COPY" ?

2023-05-25 Thread Peter J. Holzer
PostgreSQL server, not the client) produces UTF-8, but the program consuming it expects an 8-bit character set (typically windows-1252). See if oyu can tell that program that the file is in UTF-8. > How can I preserve accents ? They probably already are preserved. hp -- _

Re: Having issue with SSL.

2023-05-26 Thread Peter J. Holzer
27;t happen (it can happen if the SSL library on your server is much older than that on your client or vice versa). Can you use wireshark (or something similar) to record the session and see where in the protocol they give up? hp -- _ | Peter J. Holzer| Story must make more

Re: DB migration : Sybase to Postgres

2023-05-26 Thread Peter J. Holzer
ERROR: insert or update on table "detail" violates foreign key constraint "detail_master_fkey" DETAIL: Key (master)=(3) is not present in table "master". (You can also reenable the constraint explicitely before the end of a transaction with SET CONSTRAINTS .

Re: Question: Multiple pg clusters on one server can be reached with the standard port.

2023-06-19 Thread Peter J. Holzer
he database (not DNS) name for routing. I seem to remember that nginx has a plugin architecture for protocols so it might make sense to write that as an nginx plugin instead of a standalone server, but that's really a judgement call the programmer has to make. Another poss

Re: Question: Multiple pg clusters on one server can be reached with the standard port.

2023-06-19 Thread Peter J. Holzer
On 2023-06-19 07:49:49 -0500, Ron wrote: > On 6/19/23 05:33, Peter J. Holzer wrote: > > As Francisco already pointed out, this can't work with nginx either. The > > client resolves the alias and the TCP packets only contain the IP > > address, not the alias which was us

Re: Question: Multiple pg clusters on one server can be reached with the standard port.

2023-06-20 Thread Peter J. Holzer
On 2023-06-19 16:09:34 -0500, Ron wrote: > On 6/19/23 12:15, Peter J. Holzer wrote: > On 2023-06-19 07:49:49 -0500, Ron wrote: > On 6/19/23 05:33, Peter J. Holzer wrote: > So (again, as Francisco already wrote) the best way is probably > to write >

Re: Question: Multiple pg clusters on one server can be reached with the standard port.

2023-06-20 Thread Peter J. Holzer
On 2023-06-20 10:10:47 -0500, Ron wrote: > On 6/20/23 09:54, Peter J. Holzer wrote: > > On 2023-06-19 16:09:34 -0500, Ron wrote: > > > On 6/19/23 12:15, Peter J. Holzer wrote: > > > On 2023-06-19 07:49:49 -0500, Ron wrote: > > > On

Re: How to add function schema in search_path in option definitio

2023-07-09 Thread Peter J. Holzer
create function my_schema.foo (...) returns ... set search_path to my_schema, public as $$ ... $$; You could also do something like: set search_path to my_schema, public; create function foo (...) returns ... set search_path from current as $$ ... $$;

Re: Fwd: error in the example given for numeric data types

2023-07-15 Thread Peter J. Holzer
t would need a fourth digit and also not 0.000123 --123456 as not the rightmost digit is now six places right of the decimal point. Mathematically you store an integer with 3 digits and multiply it with 10^-5 to get the value. hp -- _ | Peter J. Holzer| Story must mak

Re: How to improve the performance of my SQL query?

2023-07-20 Thread Peter J. Holzer
hen I take the following sql statement, the index works fine and the query is > fast. > > > select COUNT(ET_CD) > from TBL_SHA > WHERE MS_CD = '009' > AND ETRYS = '01' What's the plan for that query? hp -- _ | Peter J. Holzer| S

Re: Effects of dropping a large table

2023-07-23 Thread Peter J. Holzer
t? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Effects of dropping a large table

2023-07-23 Thread Peter J. Holzer
empty table" you meant DROPing it. (Performing a «DELETE FROM t» just after a «TRUNCATE t» would obviously be pointless). So let me rephrase the question: What's the advantage of TRUNCATE t DROP t over just DROP t hp -- _ | Peter J. Holzer

Re: How to improve the performance of my SQL query?

2023-07-29 Thread Peter J. Holzer
dex scan (the number of matching rows is about 10% of the total table size which is a lot), but why would it prefer a less specific index to a more specific one? Can you get Postgres to use that index at all? Find a combination of ms_cd and etrys which doesn't cover millions of rows and try that

Re: Upgrading

2023-07-30 Thread Peter J. Holzer
pg_restore may be the easiest way. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: How to set default privilege for new users to have no access to other databases?

2023-08-12 Thread Peter J. Holzer
e a script to set up a database. Adding one or more REVOKE and/or GRANT statements to such a script would seem to be a rather obvious way to do it. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |

Re: Converting sql anywhere to postgres

2023-08-15 Thread Peter J. Holzer
AULT in VALUES(...) for ages) but I never thought of it. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"

Re: PG minor version in data directory?

2023-08-19 Thread Peter J. Holzer
postgres: % /usr/lib/postgresql/14/bin/postgres --version postgres (PostgreSQL) 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Loops and Case Statements Involving Dates

2023-08-21 Thread Peter J. Holzer
MAX("CALDAY"). * The CASE can be eliminated and replaced by GREATEST(CEIL(EXTRACT(DAY FROM (MaxDate + INTERVAL '1 day')::timestamp - (NOW() - INTERVAL '1 day')::timestamp) / 30), 1) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Peter J. Holzer
#x27; Are these outputs from the same run? I notice that the output from the program switches after 5 queries from "-1" to "-1-0", but the logged query name switches after 4 queries from "" to "S_1". hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Peter J. Holzer
to string conversion (Java's Float.toString()?). That could also produce "-1" or "-1E0" or any other equivalent representation. The author of that routine decided in include ".0" in the output, possibly to signify that it's a floating point val

Re: Restoring default privileges on objects

2023-08-30 Thread Peter J. Holzer
nd NULL visually and might be surprised if that doesn't work everywhere, while people who don't \pset null know that '' and NULL are visually indistinguishable and that they may need some other way to distinguish them if the difference matters. So +1 for m

Re: PSQL = Yes ... JDBC = no ??

2023-09-03 Thread Peter J. Holzer
result is empty: execute CREATE DATABASE jme_test_database' hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | c

Re: postgreSQL UPPER Method is converting the character "µ" into "M"

2023-09-09 Thread Peter J. Holzer
ppercasing MICRO SIGN doesn't make much sense, but that was the decision that either the libc maintainers ore the Unicode committee made. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |

Re: postgreSQL UPPER Method is converting the character "µ" into "M"

2023-09-09 Thread Peter J. Holzer
27;s a micro sign, not a mu. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Upgrade problem

2023-09-12 Thread Peter J. Holzer
strange, Is it normal that old binaries and libraries are moved into a directory named after the old version (I assume "mga8" is short for Mageia version 8") or is this something you have done? In any case, /mga8/usr/lib64 would not normally be on the library search path, Have you som

Re: Is data import from Oracle table to Postgres table in Ora2pg consecutive or random?

2023-09-12 Thread Peter J. Holzer
om order. I think the rowid is in ascending order (but I can't test that at the moment) so you may be able to use the rowid in your where clause. > - Or can we add additional parameters to the ora2pg.conf file to control this > process and ensure that the data is imported sequentially

Re: Ensuring Rifferential Integrity

2023-09-17 Thread Peter J. Holzer
quot; AS B > > WHERE A."ZTBR_TransactionCode" = B."Primary_ZTBR_TransactionCode";” Isn't that basically the same as UPDATE system."IMETA_ZTRB_MP$F_ZTBR_TA_BW" SET "Master_BRACS_Secondary_Key" = "ZTBR_TransactionCode"; ? hp

Re: Peer authentication failed ???

2023-10-03 Thread Peter J. Holzer
for your users, then you don't need a password.) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Multiple inserts with two levels of foreign keys

2023-10-08 Thread Peter J. Holzer
val('farms_id_seq') ) Then you can just COPY the data into these tables and it will give a nice mapping from old to new ids which you can use in subsequent inserts. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h.

Re: How can I accurately infer the output of a SELECT statement FROM a table with floating-point data type?

2023-10-21 Thread Peter J. Holzer
aren't necessary. But 12345.12 would be rounded to 12345+123/1024 = 12345.1201171875. That's different, so 7 digits are not enough in this case. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |

Re: Very newbie question

2023-10-26 Thread Peter J. Holzer
you think this would break with missing sequence numbers? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Disk wait problem...

2023-10-26 Thread Peter J. Holzer
fore the above finished, I issued this command on another konsole... > > > > $ while true; do ls -l > /tmp/ll; date; done This is unlikely to generate noticeable disk waits. The current directory will be in the cache after the first ls and the writes happen asynchroneously. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Very newbie question

2023-10-26 Thread Peter J. Holzer
On 2023-10-26 11:56:56 +0200, Olivier Gautherot wrote: > El jue, 26 oct 2023 11:15, Peter J. Holzer escribió: > On 2023-10-25 17:48:46 +0200, Olivier Gautherot wrote: > > El mié, 25 oct 2023 16:58, Олег Самойлов escribió: > >     Okey, I see no one was be able to

Re: Disk wait problem... may not be hardware...

2023-10-27 Thread Peter J. Holzer
be different, of course. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: pg_checksums?

2023-10-28 Thread Peter J. Holzer
d then do the other one? I don't think so. AFAIK Replication keeps the data files in sync on a bit-for-bit level and turning on checksums changes the data layout. Running a cluster where one node has checksums and the other doesn't would result in a complete mess. hp -- _ |

Re: pg_checksums?

2023-10-29 Thread Peter J. Holzer
On 2023-10-29 10:11:07 +0100, Paul Förster wrote: > On Oct 29, 2023, at 02:43, Peter J. Holzer wrote: > > I don't think so. AFAIK Replication keeps the data files in sync on a > > bit-for-bit level and turning on checksums changes the data layout. > > Running a

Re: Disk wait problem... may not be hardware...

2023-10-29 Thread Peter J. Holzer
On 2023-10-27 19:46:09 -0400, p...@pfortin.com wrote: > On Fri, 27 Oct 2023 19:07:11 +0200 Peter J. Holzer wrote: > >Have you looked at the query plans as I recommended? (You might also > >want to enable track_io_timing to get extra information, but comparing > >just the qu

Re: [SOLVED?] Re: Disk wait problem... not hardware...

2023-10-29 Thread Peter J. Holzer
the real row count? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: pg_checksums?

2023-10-29 Thread Peter J. Holzer
On 2023-10-29 16:15:37 +0100, Paul Förster wrote: > On Oct 29, 2023, at 11:49, Peter J. Holzer wrote: > > It *might* work if there are zero writes on the primary during the > > downtime of the replica (because those writes couldn't be replicated), > > but that seems h

Re: [SOLVED?] Re: Disk wait problem... not hardware...

2023-10-30 Thread Peter J. Holzer
On 2023-10-29 12:45:08 -0400, p...@pfortin.com wrote: > On Sun, 29 Oct 2023 16:16:05 +0100 Peter J. Holzer wrote: > >However, the table statistics contain an estimate for the number of > >rows: > > > >hjp=> select schemaname, relname, n_live_tup from pg_stat_u

Re: pg_checksums?

2023-10-30 Thread Peter J. Holzer
> - Start the previous primary to be a standby of the node you failed > over to. I stand corrected. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative wri

Re: pg_checksums?

2023-10-30 Thread Peter J. Holzer
l corrupt the replica. > > Trying it would tell you something. > > > That's why I asked if I need to perform a patronictl reinit. > > Best to ask Percona. Why Percona? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |

Re: Postgres limitation in user management

2023-11-04 Thread Peter J. Holzer
y ALTER TABLE > to perform any troubleshooting in the database. This seems strange to me. What kind of troubleshooting requires to ability to ALTER TABLE but not to do DML? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Postgres limitation in user management

2023-11-04 Thread Peter J. Holzer
a in-house IT, who are not DBA's and have > no access to data. This doesn't answer the question why ALTER TABLE privilege would be required. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |

Re: Can user specification of a column value be required when querying a view ?

2023-11-24 Thread Peter J. Holzer
be accessed in a single query. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Can user specification of a column value be required when querying a view ?

2023-11-25 Thread Peter J. Holzer
On 2023-11-24 13:06:45 -0500, Ron Johnson wrote: > On Fri, Nov 24, 2023 at 1:01 PM Peter J. Holzer wrote: > On 2023-11-20 22:03:06 -0500, Ron Johnson wrote: > > Or row level security. > > Does that help here? AIUI row level security can be used to limit access >

Re: Can user specification of a column value be required when querying a view ?

2023-11-25 Thread Peter J. Holzer
On 2023-11-25 10:49:56 -0500, Ron Johnson wrote: > On Sat, Nov 25, 2023 at 4:49 AM Peter J. Holzer wrote: > On 2023-11-24 13:06:45 -0500, Ron Johnson wrote: > > On Fri, Nov 24, 2023 at 1:01 PM Peter J. Holzer > wrote: > >     On 2023-11-20 22:03:06 -05

Re: replication primary writting infinite number of WAL files

2023-11-26 Thread Peter J. Holzer
ng. If the database writes 1.5 GB/s of WALs and max_wal_size is the default of 1GB, shouldn't there be a checkpoint about every 0.7 seconds instead of just every 22 seconds? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | |

Re: pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-26 Thread Peter J. Holzer
t just IP addresses. So now that you have IP addresses again, are there any for which a reverse lookup doesn't work? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Store PDF files in PostgreDB

2023-12-08 Thread Peter J. Holzer
may not be fast enough. Another measure of "efficiency" might be how easy it is to use. Here, bytea fields are very nice: They act just like varchar fields, no special functions necessary. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Read write performance check

2023-12-19 Thread Peter J. Holzer
ot be very indicative of real performance. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: How to generate random bigint

2023-12-21 Thread Peter J. Holzer
e calls to random()) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Help understanding server-side logging (and more...)

2023-12-21 Thread Peter J. Holzer
ens, one can connect to the DB from a shell (that > cluster has a single DB) w/o issues, and run queries just fine If you do that, do you see the "hanging" queries in pg_stat_activity? If so, what are they waiting for? hp -- _ | Peter J. Holzer| Story must mak

Re: Building Extension on Linux fails with relocation error

2023-12-22 Thread Peter J. Holzer
uild completes successfully when the .a file is > > smaller* (around 100 MB). > > Pure luck I suspect. I seem to remember a 256MB limit for position independent code on x86. The current man-page for GCC doesn't mention such a limit, though, so I may be mistaken. hp -- _

Re: Changing a schema's name with function1 calling function2

2023-12-24 Thread Peter J. Holzer
ration scripts but of course that assumes that you have such scripts. If you are doing your deployments manually (especially by cloning a template as described by Wilma) I can see how that feature would make things easier and/or reduce the risk of errors. hp -- _ | Peter J. Holzer

Re: Changing a schema's name with function1 calling function2

2023-12-25 Thread Peter J. Holzer
On 2023-12-24 14:27:19 -0800, Adrian Klaver wrote: > On 12/24/23 13:43, Peter J. Holzer wrote: > > I think you misunderstood Wilma. What she is asking for is a "keyword" > > or "magic variable" (or whatever you want to call it) which you can > > specify in

Re: How to do faster DML

2024-02-03 Thread Peter J. Holzer
tructure large enough to hold a count for each individual id. But at least then you'll have a much smaller table to use for further cleanup. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |

Re: How to do faster DML

2024-02-04 Thread Peter J. Holzer
use a chunk size which just fits inside work_mem is faster. Of course finding that sweet spot takes experimentation, hence time, and it may make little sense to experiment for 20 hours just to save 40 minutes. hp -- _ | Peter J. Holzer| Story must make more sense than real

Re: How to do faster DML

2024-02-10 Thread Peter J. Holzer
haracter) suggests that accessing column 100 takes about 4 or 5 times as long as column 1, and the access times for the coiumns between are pretty linear. So there's a bit of a tradeoff between minimizing alignment overhead and arranging columns for fastest access. hp --

Re: How to do faster DML

2024-02-11 Thread Peter J. Holzer
On 2024-02-11 13:25:10 +0530, veem v wrote: > On Sun, 11 Feb 2024 at 05:55, Peter J. Holzer wrote: > Yes. Numbers in Oracle are variable length, so most Oracle tables > wouldn't contain many fixed length columns. In PostgreSQL must numeric > types are fixed lengt

Re: How to do faster DML

2024-02-11 Thread Peter J. Holzer
On 2024-02-11 22:23:58 +0530, veem v wrote: > On Sun, 11 Feb 2024 at 19:02, Peter J. Holzer wrote: > > > Similarly for Number/Numeric data type. > > Number in Oracle and numeric in PostgreSQL are variable length types. > But in PostgreSQL you also have a lot of

Re: How to do faster DML

2024-02-11 Thread Peter J. Holzer
is enough free space in the same page and you can do a HOT update, but that's quite independent on whether the row changes size. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, &qu

Re: How to do faster DML

2024-02-13 Thread Peter J. Holzer
of first column. So , is it > advisable here to go for similar approach of breaking the table into two , > if the total number of column reaches certain number/threshold for a > table? > > > I'm not sure of what Peter was testing exactly to get those 4-5x figures, Sorry, I

Re: How to do faster DML

2024-02-13 Thread Peter J. Holzer
On 2024-02-13 01:53:25 +0530, veem v wrote: > On Mon, 12 Feb 2024 at 03:40, Peter J. Holzer wrote: > > The fixed width types are those that the CPU can directly process: > Integers with 16, 32 and 64 bits, floating point numbers with 32 and 64 > bits. The CPU can read

Re: How should we design our tables and indexes

2024-02-13 Thread Peter J. Holzer
x would be useful but doesn't exist, PostgreSQL usually just chooses the best of the single column indexes and ignores the rest. That said, my rule of thumb is to create just single column indexes at first and only create composite indexes if they are necessary. hp -- _ | Pe

Re: How to do faster DML

2024-02-15 Thread Peter J. Holzer
ving himself wrong, of course, but computing correctly is hard - and choosing a data type which more closely mimics the way we learn to compute in primary school doesn't necessarily make it easier. Mostly it just makes it harder to spot the errors ;-). hp -- _ | Peter J. Ho

Re: PostgreSQL DB in prod, test, debug

2024-02-15 Thread Peter J. Holzer
e schema, I run the migration on the test database, then dump and commit it. This project is small enough (86 tests in 10 files) that all test cases can use the same test data. However, I could easily use different test data for different tests. hp -- _ | Peter J. Holzer| Story m

Re: Using a Conversion Table

2024-02-15 Thread Peter J. Holzer
le using double precision for fiscal year is rather grotesque overkill (smallint would be sufficient) it isn't wrong: Any value you could conceivably want to store for a fiscal year fits nicely (with lots of room to spare) into a double precision. I agree that consistency would be nice, though.

Re: How to do faster DML

2024-02-15 Thread Peter J. Holzer
On 2024-02-15 16:51:56 -0700, David G. Johnston wrote: > On Thu, Feb 15, 2024 at 4:31 PM Peter J. Holzer wrote: > On 2024-02-14 22:55:01 -0700, David G. Johnston wrote: > > On Tuesday, February 13, 2024, veem v wrote: > > > >     float data types rather

Re: How to do faster DML

2024-02-16 Thread Peter J. Holzer
On 2024-02-16 12:10:20 +0530, veem v wrote: > > On Fri, 16 Feb 2024 at 06:04, Peter J. Holzer wrote: > > On 2024-02-15 16:51:56 -0700, David G. Johnston wrote: > > On Thu, Feb 15, 2024 at 4:31 PM Peter J. Holzer > wrote: > >     On 2024-02-14 22:55:

Re: How to do faster DML

2024-02-17 Thread Peter J. Holzer
On 2024-02-16 01:34:01 +0100, Peter J. Holzer wrote: > On 2024-02-15 16:51:56 -0700, David G. Johnston wrote: > > What you see with an exact type is what you get, which allows for > > implementing > > equality, unlike inexact which requires epsilon checking. > > You

Re: Postgres 16 missing from apt repo?

2024-02-24 Thread Peter J. Holzer
ave cached an obsolete index. Use "apt update" to update the index. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Orphan files filling root partition after crash

2024-03-03 Thread Peter J. Holzer
hich just terminates all database connections - a bit drastic but effective) if free space runs low: https://github.com/hjp/platzangst hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles St

Re: Thoughts on user-defined types for talk at Postgres conference?

2024-03-07 Thread Peter J. Holzer
s are [...] > the type information (typmod if there is one and the OID of the > composite type), Is it necessary to store this in every row? Can a column contain different composite types? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: creating a subset DB efficiently ?

2024-03-09 Thread Peter J. Holzer
scan which may take a long time. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Postgresql docker health check

2024-03-14 Thread Peter J. Holzer
u have so many connections. If you have way more connections than you can reasonably expect, something is wrong, And it is better to fix the root cause than to just hit everything over the head with a hammer periodically. hp -- _ | Peter J. Holzer| Story must make more sense than

Re: PostgreSQL as advanced job queuing system

2024-03-22 Thread Peter J. Holzer
"jobs_pkey" PRIMARY KEY, btree (id) "jobs_queue_id_id_idx" btree (queue_id, id) "jobs_queue_id_idx" btree (queue_id) Foreign-key constraints: "jobs_queue_id_fkey" FOREIGN KEY (queue_id) REFERENCES queues(id) If you do have very few very long queues it might be faster to query each queue separately. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Is this a buggy behavior?

2024-03-24 Thread Peter J. Holzer
not without searching the table, so that is done first. Only then you have to check the index for a possible duplicate value, so that's done later. But as a user I actually prefer it that way. The more precisely the database can tell me why the insert failed, the better. hp --

Re: Is this a buggy behavior?

2024-03-24 Thread Peter J. Holzer
On 2024-03-24 11:23:22 -0700, David G. Johnston wrote: > On Sun, Mar 24, 2024 at 11:14 AM Peter J. Holzer wrote: > It doesn't. Your statement > > > CREATE TABLE test1 > > ( > > c1 numeric   NULL , > > c2 varchar(36)  NOT NULL , >

Re: how to check if the license is expired.

2024-03-31 Thread Peter J. Holzer
of the solution. So you ask how to achieve Y. However, Z would be better than Y for solving X, but nobody can tell you because they don't know about X. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at

expected authentication request from server, but received H

2024-05-23 Thread Peter J. Holzer
yte1('H') could mark a Copy Out response or a Flush command. Both don't make sense in that context. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, &q

Re: expected authentication request from server, but received H

2024-05-27 Thread Peter J. Holzer
On 2024-05-23 17:23:14 -0400, Tom Lane wrote: > "Peter J. Holzer" writes: > > One of our users reports getting the error message > > "expected authentication request from server, but received H" > > when trying to connect to the database. > > That

Re: Multiple tables row insertions from single psql input file

2024-06-10 Thread Peter J. Holzer
ave a value to insert into the foreign key field(s). There is no need to enter all companies before all locations. Indeed, currval() can only (as the name implies) return the *current* value of a sequence, so you can only use it to refer to the last entry you created. If you create two companie

Re: Restore of a reference database kills the auto analyze processing.

2024-06-18 Thread Peter J. Holzer
ting definition of "OPEN". hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Description: PGP signature

Re: Accommodating alternative column values

2024-07-03 Thread Peter J. Holzer
the intended contents. Try it with select array[email] from people; If that looks promising, you can use it in an alter table statement (Torsten already posted the solution, but I wanted to expand a bit on how to find it). hp -- _ | Peter J. Holzer| Story must make more se

<    3   4   5   6   7   8   9   10   >