expected authentication request from server, but received H

2024-05-23 Thread Peter J. Holzer
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, "Creative writing __/ | http://www.

Re: how to check if the license is expired.

2024-03-31 Thread Peter J. Holzer
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 |-- Charles S

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: Is this a buggy behavior?

2024-03-24 Thread Peter J. Holzer
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 -- _ | Peter J. Holzer| Sto

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: Postgresql docker health check

2024-03-14 Thread Peter J. Holzer
ctions. 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 reality. |_|_) |

Re: creating a subset DB efficiently ?

2024-03-09 Thread Peter J. Holzer
h 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: Thoughts on user-defined types for talk at Postgres conference?

2024-03-07 Thread Peter J. Holzer
] > 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: Orphan files filling root partition after crash

2024-03-03 Thread Peter J. Holzer
t (which 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: Postgres 16 missing from apt repo?

2024-02-24 Thread Peter J. Holzer
dex. 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: 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: 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-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 t

Re: Using a Conversion Table

2024-02-15 Thread Peter J. Holzer
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 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: How to do faster DML

2024-02-15 Thread Peter J. Holzer
lf 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. Holzer| Story

Re: How should we design our tables and indexes

2024-02-13 Thread Peter J. Holzer
ld 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 -- _ | Peter J. Hol

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 to do faster DML

2024-02-13 Thread Peter J. Holzer
bench where v{i} = 'a'" t0 = time.clock_gettime(time.CLOCK_MONOTONIC) csr.execute(q) r = csr.fetchall() print(r) t1 = time.clock_gettime(time.CLOCK_MONOTONIC) print(i, t1 - t0) db.commit() -- _ |

Re: How to do faster DML

2024-02-11 Thread Peter J. Holzer
e 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, "Creative writing __/

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
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 length, so

Re: How to do faster DML

2024-02-10 Thread Peter J. Holzer
sts 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 -- _ | Peter J. Hol

Re: How to do faster DML

2024-02-04 Thread Peter J. Holzer
nk 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 reality. |_|_)

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: 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: Changing a schema's name with function1 calling function2

2023-12-24 Thread Peter J. Holzer
ssumes 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| Story must make more sense tha

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 -- _ | Pe

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: How to generate random bigint

2023-12-21 Thread Peter J. Holzer
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: Read write performance check

2023-12-19 Thread Peter J. Holzer
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: Store PDF files in PostgreDB

2023-12-08 Thread Peter J. Holzer
t 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: pg_getnameinfo_all() failed: Temporary failure in name resolution

2023-11-26 Thread Peter J. Holzer
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: replication primary writting infinite number of WAL files

2023-11-26 Thread Peter J. Holzer
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. |_|_) || | | | h...@hjp.at |

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: 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-24 Thread Peter J. Holzer
gle 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: 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 |-- Char

Re: Postgres limitation in user management

2023-11-04 Thread Peter J. Holzer
t only 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: 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: pg_checksums?

2023-10-30 Thread Peter J. Holzer
y. > - 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 writing

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-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 hard t

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: 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 th

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 clust

Re: pg_checksums?

2023-10-28 Thread Peter J. Holzer
n 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 -- _ | Peter J. Holze

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

2023-10-27 Thread Peter J. Holzer
rse. 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...

2023-10-26 Thread Peter J. Holzer
bove 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
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: 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
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 |-- Charles Stross,

Re: Multiple inserts with two levels of foreign keys

2023-10-08 Thread Peter J. Holzer
q') ) 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...@hjp.at |-- Char

Re: Peer authentication failed ???

2023-10-03 Thread Peter J. Holzer
our 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: Ensuring Rifferential Integrity

2023-09-17 Thread Peter J. Holzer
_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 -- _ | Peter J. Holzer| Story must m

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

2023-09-12 Thread Peter J. Holzer
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, following the >

Re: Upgrade problem

2023-09-12 Thread Peter J. Holzer
/mga8/usr/bin/postgres to look there? 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 UPPER Method is converting the character "µ" into "M"

2023-09-09 Thread Peter J. Holzer
icro 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: postgreSQL UPPER Method is converting the character "µ" into "M"

2023-09-09 Thread Peter J. Holzer
. IMHO uppercasing 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 |-- Charl

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

2023-09-04 Thread Peter J. Holzer
ute 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/ | challenge!" signature.asc Des

Re: Restoring default privileges on objects

2023-08-30 Thread Peter J. Holzer
at 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 me fixing \dp to honor "\pset null". hp --

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 value, not an

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

2023-08-21 Thread Peter J. Holzer
ueries 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: Loops and Case Statements Involving Dates

2023-08-21 Thread Peter J. Holzer
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: PG minor version in data directory?

2023-08-19 Thread Peter J. Holzer
stgresql/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: Converting sql anywhere to postgres

2023-08-15 Thread Peter J. Holzer
UES(...) 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!" signature.asc Des

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

2023-08-12 Thread Peter J. Holzer
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 |-- Char

Re: Upgrading

2023-07-30 Thread Peter J. Holzer
_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 improve the performance of my SQL query?

2023-07-29 Thread Peter J. Holzer
ws 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. Also try lowering random_page_cost.

Re: Effects of dropping a large table

2023-07-23 Thread Peter J. Holzer
ow 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| S

Re: Effects of dropping a large table

2023-07-23 Thread Peter J. Holzer
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 improve the performance of my SQL query?

2023-07-20 Thread Peter J. Holzer
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| Story must make more sense than reality. |_|_) || | | | h..

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

2023-07-15 Thread Peter J. Holzer
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 make more sense than reality. |_|_) |

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

2023-07-09 Thread Peter J. Holzer
n 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 $$ ... $$; hp --

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: 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-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 used to

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

2023-06-19 Thread Peter J. Holzer
me 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 possibility would of course be to extend pgb

Re: DB migration : Sybase to Postgres

2023-05-26 Thread Peter J. Holzer
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 ... IMMEDIATE) hp -- _ | Peter J. Holzer| Story must

Re: Having issue with SSL.

2023-05-26 Thread Peter J. Holzer
n (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 sense than

Re: Maintaining accents with "COPY" ?

2023-05-25 Thread Peter J. Holzer
e 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 -- _ | Peter J. Holzer| Story must m

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: 15 pg_upgrade with -j

2023-05-23 Thread Peter J. Holzer
stem 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: Modeling combinations (options and dependencies)

2023-05-19 Thread Peter J. Holzer
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: Is there a good way to handle sum types (or tagged unions) in PostgreSQL?

2023-05-19 Thread Peter J. Holzer
t 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. |_|_) || | | | h...@hjp.a

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: Death postgres

2023-05-12 Thread Peter J. Holzer
) 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 |-- Charles Stross, "Creativ

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-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). h

Re: Death postgres

2023-05-06 Thread Peter J. Holzer
t 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: libpq and multi-threading

2023-05-03 Thread Peter J. Holzer
ly. 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: libpq and multi-threading

2023-05-02 Thread Peter J. Holzer
u 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/library construct).

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

2023-04-25 Thread Peter J. Holzer
't' => ' ', 'id' => 3 }, { 't' => 'a', 'id' => 4 }, { 'id' => 5, 't' => 'a' } ]; hp -- _ |

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-15 Thread Peter J. Holzer
On 2023-04-15 09:12:41 -0700, Adrian Klaver wrote: > On 4/15/23 03:46, Peter J. Holzer wrote: > > On 2023-04-14 10:44:08 -0700, Adrian Klaver wrote: > > > On 4/14/23 9:31 AM, Peter J. Holzer wrote: > > > > On 2023-04-13 10:07:09 -0500, Ron wrote: > > > > &

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-15 Thread Peter J. Holzer
On 2023-04-14 10:44:08 -0700, Adrian Klaver wrote: > On 4/14/23 9:31 AM, Peter J. Holzer wrote: > > On 2023-04-13 10:07:09 -0500, Ron wrote: > > > On 4/13/23 09:44, Sebastien Flaesch wrote: > > > Is there an easy way to convert JSON data containin

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Peter J. Holzer
should generate the same md5, as I understand it. That's not necessarily the case. There are quite a few data types where the input value is truncated, rounded or otherwise normalized. So I don't think you can generally expect to read back exactly the same value you inserted. hp --

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-14 Thread Peter J. Holzer
by convention between the sender and the receiver. > This looks like "milliseconds since the Unix epoch: > > $ date -d @1672692813.062 > Mon 02 Jan 2023 02:53:33 PM CST > > Thus: > select to_timestamp(cast(1672692813062 as bigint))::tim

Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-10 Thread Peter J. Holzer
attribute of an entity which is unique for a given application may not be unique for other applications. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative

Re: "PANIC: could not open critical system index 2662" - twice

2023-04-07 Thread Peter J. Holzer
the Debian/Ubuntu packages enabled this by default. But that doesn't seem to be the case. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http

Re: Using CTID system column as a "temporary" primary key

2023-03-30 Thread Peter J. Holzer
On 2023-03-29 12:15:09 -0700, Adrian Klaver wrote: > On 3/29/23 09:43, Peter J. Holzer wrote: > > On 2023-03-29 07:59:54 -0700, Adrian Klaver wrote: > > > On 3/29/23 07:19, Sebastien Flaesch wrote: > > > > INSERT statements must not use the serial column, so you ha

  1   2   3   4   5   6   >