Re: Patroni, slots, and expiring WALs

2023-03-28 Thread Peter J. Holzer
On 2023-03-28 17:27:27 +0200, Peter J. Holzer wrote: > On 2023-03-28 17:08:38 +0200, Alexander Kukushkin wrote: > > The second option - you can put all member names into permanent slots > > configuration (using patronictl edit-config): > > slots: > >   nodena

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

2023-03-29 Thread Peter J. Holzer
could just specific a zero to get a new > > generated serial, but seems this has never been considered with > > PostgreSQL. > > Yes it has: [...] > insert into seq_test values(default, 'test'); Default is not the same as zero. hp -- _ | Peter J.

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 have

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

2023-04-07 Thread Peter J. Holzer
I thought 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 writi

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

2023-04-10 Thread Peter J. Holzer
tribute 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: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-14 Thread Peter J. Holzer
ion is strictly 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 a

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Peter J. Holzer
e it > 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.

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 containing ASP.NET AJAX

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: Fwd: Log file

2018-11-11 Thread Peter J. Holzer
edded in the log message. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/> signature.asc Description: PGP signature

Re: Ipv6 address stored differently while using Inet type

2018-12-27 Thread Peter J. Holzer
sent the same one being inserted? Yes. > Is this a known bug resolved in later versions of Postgres? No. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | ma

Re: In which session context is a trigger run?

2018-12-30 Thread Peter J. Holzer
he temporary table in session A. But since the transaction in session B hasn't yet committed, it wouldn't see the data that the insert statement has just inserted. Since the point of an after insert trigger is usually to do something with this new data, that would make the trigger use

Re: In which session context is a trigger run?

2018-12-31 Thread Peter J. Holzer
On 2018-12-30 08:56:13 -0800, Adrian Klaver wrote: > On 12/30/18 3:08 AM, Peter J. Holzer wrote: > > If I understood Mitar correctly he wants the trigger to execute in the > > session where it was declared, not in the sessio where the statement was > > executed that

Re: Is there something wrong with my test case?

2019-01-06 Thread Peter J. Holzer
far. Is it possible that your subjective impression wasn't based on the executions you posted but on others? Caching and load spikes can cause quite large variations in run time, so running the same query again may not take the same time (usually the second time is faster - sometimes much faster

Re: Oracke BLOB to Postgres BYTEA using ora2pg

2019-01-18 Thread Peter J. Holzer
ely a red herring - that's just for the benefit of humans, but humans can't read binary data directly. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at

Re: Query help

2019-01-27 Thread Peter J. Holzer
ept select ombcase_fkey from statuschange where insdatetime >= now()::date - xx; gives you all ombcase ids which did /not/ have a status change in the last xx days. Another way would be to use a CTE (https://www.postgresql.org/docs/10/queries-with.html) to extract the last status change for e

Re: Size estimation of postgres core files

2019-02-24 Thread Peter J. Holzer
ated (and possibly useless) core dump. For similar reasons I'm not convinced that omitting the shared memory is a good idea. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | |

Re: why not using a mountpoint as PGDATA?

2019-02-27 Thread Peter J. Holzer
nge that. Maybe it's a potential problem with other layouts. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross A

Re: why not using a mountpoint as PGDATA?

2019-02-27 Thread Peter J. Holzer
e "wrong" permissions. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/> signature.asc Description: PGP signature

Re: Camel case identifiers and folding

2019-03-16 Thread Peter J. Holzer
reference books) these differences are critical. A web page? Rarely, at least for the human readable parts. Medicine? I don't know. There may be names for different substances which differ only in case. But those are parts of a formal language, and as programmers

Re: Camel case identifiers and folding

2019-03-16 Thread Peter J. Holzer
t;the English language". Everybody else will see it as an obvious typo and won't assume that this refers to some "rob Sargent" who is a different person than "Rob Sargent". 2) I don't think the OP was talking about spell-checking. And in any case spell-checking is m

Re: Facing issue in using special characters

2019-03-18 Thread Peter J. Holzer
set which is "very common in Mobile phones", even in a relatively poor country like Myanmar. Does ZawGyi actually include characters which aren't in Unicode are are they just encoded differently? hp -- _ | Peter J. Holzer| we build much bigger, better disasters now

Re: Performance of ByteA: ascii vs binary

2019-03-19 Thread Peter J. Holzer
ea script (https://github.com/hjp/blob-bench) to restrict the byte values to printable ASCII (32 .. 126). There was absolutely no difference, as the attached graph shows. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || becau

Re: Performance of ByteA: ascii vs binary

2019-03-21 Thread Peter J. Holzer
On 2019-03-20 13:20:57 +0100, Thomas Güttler wrote: > > > Am 19.03.19 um 20:37 schrieb Peter J. Holzer: > > On 2019-03-18 15:33:17 +0100, Thomas Güttler wrote: > > > I did some benchmarking and in my setup there was major > > > performance difference. >

Re: Script which shows performance of ByteA: ascii vs binary

2019-03-22 Thread Peter J. Holzer
bytes. Not very meaningful. Another difference I noticed between our benchmarks is that I used a plain bytes object while he used a psycopg2.Binary object. Those might be serialized differently, but since the speed difference is adequately explained by the (lack of) randomness

Re: When to store data that could be derived

2019-03-24 Thread Peter J. Holzer
ndex scans on those columns. But this is not that easy to see, and I don't know whether the optimizer can do it. Rewriting the condition as (a.tran_type = 'ar_rec' and y.posted = 1) or (a.tran_type = 'cb_rec' and w.posted = 1) might make it easier for the optimizer

Re: Key encryption and relational integrity

2019-03-28 Thread Peter J. Holzer
ble to join patients and their medications. So at some level that has to be possible. If you assume a break-in into the server, there will always be a level of penetration at which the attacker will be able to access any data an authorized user can access. hp -- _ | Peter J.

Re: Key encryption and relational integrity

2019-03-28 Thread Peter J. Holzer
at an intruder would get access to the database but not the application. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp

Re: Key encryption and relational integrity

2019-03-29 Thread Peter J. Holzer
On 2019-03-29 17:01:07 +0100, Moreno Andreo wrote: > Il 28/03/2019 23:29, Peter J. Holzer ha scritto: > > On 2019-03-28 18:36:40 +0100, Moreno Andreo wrote: > > > it's just "separation" (that was OK with the last privacy act, but not > > > with GDPR

Re: Key encryption and relational integrity

2019-03-29 Thread Peter J. Holzer
On 2019-03-29 17:05:41 +0100, Moreno Andreo wrote: > Il 28/03/2019 23:50, Peter J. Holzer ha scritto: > > On 2019-03-28 15:29:50 +0100, Moreno Andreo wrote: > > > here I'm trying to find a way so nobody can, without the use of the > > > application, match a patient

Re: Gigantic load average spikes

2019-03-31 Thread Peter J. Holzer
Runnable (R)? Uninterruptible sleep (D)? Both? Something else? hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hj

Re: Recommendation to run vacuum FULL in parallel

2019-04-03 Thread Peter J. Holzer
ere are (at least) pg_repack and pg_squeeze. It would be nice to have that in the core, though. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ |

Re: Recommendation to run vacuum FULL in parallel

2019-04-03 Thread Peter J. Holzer
dates is much greater than the number of > inserts, the unused zombie space gradually creeps up. Not if autovacuum has a chance to run between updates. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more

Re: Recommendation to run vacuum FULL in parallel

2019-04-05 Thread Peter J. Holzer
first issued an update on the first column, checked that the result looked plausible, then issued an update on the second column, and so on. The result was of course massive bloat). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) ||

Re: Trigger when user logs in

2019-04-14 Thread Peter J. Holzer
ck off" doesn't have to be really instantly, you could also monitor pg_stat_activity every second or so and terminate any suspicious session. But note that this rather insecure: A session which lasts for much less than a second has a good chance of flying under the radar. hp -- _

Re: PostgreSQL ping/pong to client

2019-04-19 Thread Peter J. Holzer
ity or the peer machine being turned off). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson &l

Re: TCP Resets when closing connection opened via SSL

2019-04-27 Thread Peter J. Holzer
ecessary delay. > This is an issue because we have a lot of connections being initiated and > closed. And this creates a lot of TCP resets. Why are those resets a problem? (If the answer is "our monitoring software complains about them" then the question beco

Re: PG version recommendation

2019-05-11 Thread Peter J. Holzer
which the OP hasn't said. If there is a wider varietyl of distributions to choose from, my preference would be Debian or Ubuntu (in that order). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophistica

Re: bigint out of range

2019-05-18 Thread Peter J. Holzer
ds seems odd. I guess the schema was copied from Oracle. In Oracle, all numbers are really 38 digit decimal floating point numbers and the limit for varchar2 is 4000. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) ||

Re: bigint out of range

2019-05-18 Thread Peter J. Holzer
On 2019-05-18 10:49:53 -0700, David G. Johnston wrote: > On Saturday, May 18, 2019, Peter J. Holzer wrote: > > On 2019-05-16 08:48:51 -0700, David G. Johnston wrote: > > On Thu, May 16, 2019 at 8:31 AM Daulat Ram > wrote: > > > > >

Re: bigint out of range

2019-05-18 Thread Peter J. Holzer
On 2019-05-18 15:19:22 -0500, Ron wrote: > On 5/18/19 2:27 PM, Peter J. Holzer wrote: > > On 2019-05-18 10:49:53 -0700, David G. Johnston wrote: > > > You don’t perform math on a hash > > That's not generally true. Hashes are used for further computation for >

Re: bigint out of range

2019-05-18 Thread Peter J. Holzer
On 2019-05-18 17:14:59 -0500, Ron wrote: > On 5/18/19 3:49 PM, Peter J. Holzer wrote: > > On 2019-05-18 15:19:22 -0500, Ron wrote: > > On 5/18/19 2:27 PM, Peter J. Holzer wrote: > > On 2019-05-18 10:49:53 -0700, David G. Johnston wrote: > >

Re: bigint out of range

2019-05-19 Thread Peter J. Holzer
On 2019-05-18 19:16:19 -0500, Ron wrote: > On 5/18/19 5:39 PM, Peter J. Holzer wrote: > > On 2019-05-18 17:14:59 -0500, Ron wrote: > > > On 5/18/19 3:49 PM, Peter J. Holzer wrote: > > > On 2019-05-18 15:19:22 -0500, Ron wrote: > > > On 5/

Migrating a Patroni cluster from Ubuntu 16.04 to Ubuntu 18.04

2019-05-30 Thread Peter J. Holzer
n with one machine upgraded to Ubuntu 18. Yay! \o/ Next node is E, which is only running etcd. Since it already has 3.0, the upgrade to 3.2 is smooth. Finally A: Swith the master over to B, run do-release-upgrade, after the reboot, reinstall patroni (+depencies, +rename config). And ... everyt

Re: Questions about btree_gin vs btree_gist for low cardinality columns

2019-05-30 Thread Peter J. Holzer
g the contents of the index if hd seems to confirm this. For a btree_gin index spanning multiple columns I'm not sure. I would have expected each field to be a token, but it looks like both are stored together. So unless somebody more knowledgeable speaks up, I guess Jeremy will have to read t

Re: Questions about btree_gin vs btree_gist for low cardinality columns

2019-05-31 Thread Peter J. Holzer
On 2019-05-30 21:00:57 +0200, Peter J. Holzer wrote: > Firstly, the GIN index doesn't generally index single characters. It > uses some rule to split the field into tokens. For example, for a text > field, it might split the field into words (possibly with some > normalization

Re: Questions about btree_gin vs btree_gist for low cardinality columns

2019-06-01 Thread Peter J. Holzer
A hash of a two > character string is likely about worst-case. I think that a hash index is generally a poor fit for low cardinality indexes: You get a lot of equal values, which are basically hash collisions. Unless the index is specifically designed to handle this (e.g. by storing the key only once

Re: Questions about btree_gin vs btree_gist for low cardinality columns

2019-06-02 Thread Peter J. Holzer
other database, I would write a Python script (I'm sure you can do that in pgsql, too, but I feel more comfortable in Python). I don't think there is a way to get time timings in plain SQL. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: Postgres 10.7 Systemd Startup Issue

2019-06-08 Thread Peter J. Holzer
a working systemd configuration (assuming systemd is the default init on SuSE). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.h

Re: Requirement PA-DSS 1.1.4

2019-06-08 Thread Peter J. Holzer
Is this safe? You are overwriting the file while it still belongs to the database. Renaming the table should have gotten rid of all transactions accessing it, but what about the background writer or autovacuum? I'm not convinced that nothing would access the file between i. and ii. hp

Re: checkpoints taking much longer than expected

2019-06-14 Thread Peter J. Holzer
.com Maybe you have the same problem? hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson &

Re: bug regclass::oid

2019-06-16 Thread Peter J. Holzer
lumn_name from information_schema.columns where table_name like '% %'; ╔══╤═╤═════════╗ ║ table_schema │ quote_ident │ column_name ║ ╟──┼─┼─╢ ║ public │ "foo bar" │ id ║ ╚══╧═

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
ehow told /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: 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

<    1   2   3   4   5   6   7   >