Re: Size estimation of postgres core files

2019-02-24 Thread Peter J. Holzer
s) 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 | | | h...@hjp.at | manage

Re: Query help

2019-01-27 Thread Peter J. Holzer
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 each ombcas

Re: Oracke BLOB to Postgres BYTEA using ora2pg

2019-01-18 Thread Peter J. Holzer
t 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 | management tools. __/ | http://www

Re: Is there something wrong with my test case?

2019-01-06 Thread Peter J. Holzer
r. 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). hp

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: In which session context is a trigger run?

2018-12-30 Thread Peter J. Holzer
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 useless. hp -- _ | Peter J.

Re: Ipv6 address stored differently while using Inet type

2018-12-27 Thread Peter J. Holzer
ame 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 | management t

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: convert real to numeric.

2018-10-20 Thread Peter J. Holzer
On 2018-10-18 18:58:13 -0400, Tom Lane wrote: > "Peter J. Holzer" writes: > > On 2018-10-18 10:15:40 -0400, Tom Lane wrote: > >> You could ju-jitsu the system into duplicating that behavior by casting > >> to text (which invokes float4out) and then to nu

Re: convert real to numeric.

2018-10-18 Thread Peter J. Holzer
> I'm not really convinced that doing it like this rather than doing the > standard conversion is a good idea. You can't manufacture precision > where there is none It may be that the real value of that number is only known to +/- 0.1. Or maybe only to +/- 100. But postgresql can't know t

Re: COPY threads

2018-10-11 Thread Peter J. Holzer
re about 33 % faster than 2. But there is a still quite a respectable performance boost. hp PS: The script is of course in the same repo, but I didn't include the test data because I don't think I'm allowed to include that. -- _ | Peter J. Holzer| we build much bigger, better

Re: How to maintain the csv log files in pg_log directory only for past 30 days

2018-09-30 Thread Peter J. Holzer
if that matters or not. It may or may not. Personally I prefer to use find -mtime (or logrotate, or cleandir, or keepfree, ...) to avoid the irregularities of the Gregorian calendar. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: Out of Memory

2018-09-29 Thread Peter J. Holzer
and you are only overcommitting if you exceeded the size of the sum. The overcommitment in Linux is of a different kind: Linux uses copy on write whereever it can (e.g. when forking processes, but also when mallocing memory), and a CoW page may or may not be written in the future. It only needs addition

Re: PG8.3->10 migration data differences

2018-09-10 Thread Peter J. Holzer
on output while Pg10 prints the more precise (but still not exact) "2.2005". (I would argue that the Pg9.3 output is better, since it represents the same value in fewer digits, but always printing the minimum number of digits necessary is surprisingly difficult.) hp --

Re: Duplicating data folder without tablespace, for read access

2018-08-14 Thread Peter J. Holzer
blspc/* on the release server > - start postgres on both servers If you copy the whole database anyway before deleting the tablespace: Why don't you just drop the 600 GB table on the release server? hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: Connections on cluster not being logged

2018-07-24 Thread Peter J. Holzer
cluster" is. Probably some kind of appliance which packages two nodes, some storage and the HA software.) hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | manage

Re: User documentation vs Official Docs

2018-07-19 Thread Peter J. Holzer
On 2018-07-19 11:43:18 -0600, Rob Sargent wrote: > On 07/19/2018 11:04 AM, Peter J. Holzer wrote: > > On 2018-07-18 08:09:35 +1000, Tim Cross wrote: > > > If using web widgets to author content on the wiki is the main > > > impediment for contributing content, mayb

Re: User documentation vs Official Docs

2018-07-19 Thread Peter J. Holzer
se a real text editor instead of a text area. 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

Inefficient plan on 10.4

2018-07-05 Thread Peter J. Holzer
red partial order in the application. But I'd like to understand what the optimizer is doing here. -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/

Re: execute block like Firebird does

2018-05-30 Thread Peter J. Holzer
the | only way to communicate changes between different WITH sub-statements | and the main query. -- https://www.postgresql.org/docs/10/static/queries-with.html#QUERIES-WITH-MODIFYING In a DO block the statements are processed sequentially and each statement sees the results of the previ

Re: case statement within insert

2018-05-28 Thread Peter J. Holzer
uch faster than individual inserts), and then convert it with a single SQL statement. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http:

Re: Renice on Postgresql process

2018-05-24 Thread Peter J. Holzer
e cpu or disk bound and what exactly the "nice value" affects. The best way to find out is probably to try it. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.a

Re: Out of memory error with PG10.3, 10.4 but not 9.3.19

2018-05-18 Thread Peter J. Holzer
o rewrite the query so that it creates several shorter strings instead. 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/ | -

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-13 Thread Peter J. Holzer
one, the internally stored value is always in UTC > (Universal Coordinated Time, traditionally known as Greenwich Mean Time, > GMT)" This is not actually true. There is nothing in the storage format which depends on UTC (well, the epoch is at Midnight UTC, at if you say the epoch is at 08

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Peter J. Holzer
0 23:17:44+00'::timestamptz) will still return 7200, even though I have explicitely specified a UTC timestamp. What your check probably does is to enforce that the client's time zone is set to UTC. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|

Re: Rationale for aversion to the central database?

2018-04-28 Thread Peter J. Holzer
On 2018-04-28 09:54:27 -0500, Steven Lembark wrote: > On Sat, 28 Apr 2018 08:02:21 +0200 > "Peter J. Holzer" <hjp-pg...@hjp.at> wrote: > > > On 2018-04-27 22:52:39 +, g...@luxsci.net wrote: > > > Perhaps I'm extreme. In my ideal world, developers mi

Re: Rationale for aversion to the central database?

2018-04-28 Thread Peter J. Holzer
On 2018-04-27 22:52:39 +, g...@luxsci.net wrote: > Perhaps I'm extreme. In my ideal world, developers might not even know table > names! I'm kidding ,sorta... If they don't know the table names, how can they write those stored procedures? hp -- _ | Peter J. Holzer

Re: Rationale for aversion to the central database?

2018-04-09 Thread Peter J. Holzer
0 years ago. These days much software is offered as a service. If the customer sees only a REST API and doesn't have to host the database on their own servers, they won't care about the RDBMS underneath. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now

Re: Rationale for aversion to the central database?

2018-04-09 Thread Peter J. Holzer
s Perl (And I suspect it's the same for Python). 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:

Re: I do not get the point of the information_schema

2018-02-13 Thread Peter J. Holzer
On 2018-02-13 16:06:43 -0700, David G. Johnston wrote: > On Tue, Feb 13, 2018 at 3:57 PM, Peter J. Holzer <hjp-pg...@hjp.at> wrote: > > (That said, it looks like both PostgreSQL and MariaDB include additional > columns beyond those mandated by the standard - you c

Re: I do not get the point of the information_schema

2018-02-13 Thread Peter J. Holzer
MariaDB to get a list of tables. (That said, it looks like both PostgreSQL and MariaDB include additional columns beyond those mandated by the standard - you can't rely on those, of course. And some databases like Oracle don't even have an information schema.) hp -- _ | Peter J. Holz

Re: Information on savepoint requirement within transctions

2018-01-31 Thread Peter J. Holzer
> They allow to provide a try/catch behavior with the ability > > to continue to use a transaction after a failure. I agree. The goal isn't to ignore the error but to handle it. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || beca

Re: Information on savepoint requirement within transctions

2018-01-31 Thread Peter J. Holzer
the PostgreSQL model. If the programmer wants to tolerate and error, they have to handle it explicitely (with a savepoint or even a full transaction). I can't really think of a reason why the MSSQL behaviour might be useful, but I'm sure that they had a use-case in mind when they designed this.

Re: Bulk Insert/Update Scenario

2018-01-31 Thread Peter J. Holzer
ql -c '\copy ...' 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/> signatu

Re: postgres for production

2018-01-31 Thread Peter J. Holzer
a single client might use more than one core). 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: How to measure query time - with warm up and cached data

2018-01-21 Thread Peter J. Holzer
pecially between the 2nd and 3rd). But in your case it is just the opposite. > [cleardot] Sending Webbugs to a mailinglist? hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@

Re: String comparison problem in select - too many results

2018-01-14 Thread Peter J. Holzer
On 2018-01-14 13:20:05 +0100, Francisco Olarte wrote: > On Sun, Jan 14, 2018 at 12:14 PM, Peter J. Holzer <hjp-pg...@hjp.at> wrote: > > On 2018-01-12 11:08:39 +0100, Francisco Olarte wrote: > >> C collation is like sorting raw bytes, it doesn't event sort > &g

Re: String comparison problem in select - too many results

2018-01-14 Thread Peter J. Holzer
ws) It might be possible to define a custom collation for that, but in a case like this I would either split this field into two integer fields or use a function-based index. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we

Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: data-checksums

2018-01-14 Thread Peter J. Holzer
to the fact that enabling CRCs may cause extra disk writes, which rings a much louder alarm bell for me. (When are those hint-bits set? Does this happen often when otherwise no write would have been necessary? I have no idea so I guess I'd better measure it!) hp -- _ | Peter J. Holzer

Re: Mailing list archiver

2018-01-03 Thread Peter J. Holzer
o that might work on some platforms. 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.

Re: Array of foreign key

2017-12-24 Thread Peter J. Holzer
On 2017-12-23 14:40:13 -0500, Melvin Davidson wrote: > On Sat, Dec 23, 2017 at 2:27 PM, Peter J. Holzer <hjp-pg...@hjp.at> wrote: > >If you do not understand something, please ask. > > Your response is inappropriate and offensive. I apologize for my tone. I should ha

Re: Array of foreign key

2017-12-23 Thread Peter J. Holzer
hope this someday gets > included into Postgres! > > Actually, I think the op may be referring to a MULTI COLUMN FK array I see no reason to assume that. He explicitely asked about an array of foreign keys, and there is no array here. hp -- _ | Pe

Re: Array of foreign key

2017-12-23 Thread Peter J. Holzer
On 2017-12-23 12:24:07 -0500, Melvin Davidson wrote: > On Sat, Dec 23, 2017 at 12:09 PM, Peter J. Holzer <hjp-pg...@hjp.at> wrote: > >...Is there a way to > >enforce foreign key constraints on the members of an array? > >At insert time you can check with a t

Re: Re: PostgreSQL needs percentage function

2017-12-18 Thread Peter J. Holzer
le is 1, it's not a percentage (and yes, percent_rank() is misnamed). 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/ |

Re: Re: PostgreSQL needs percentage function

2017-12-18 Thread Peter J. Holzer
uld be, because that's what "cent" means, but it's missing in percent_rank()). If such a function existed, I would avoid it. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h

Re: ERROR: could not load library libperl.so, PostgreSQL trying to CREATE EXTENSION plperlu

2017-12-03 Thread Peter J. Holzer
ular OS. https://www.postgresql.org/download/linux/suse/? > Or run a supported OS; that one looks pretty old. SLES 12 is the current version of SLES. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated |

Re: large numbers of inserts out of memory strategy

2017-11-30 Thread Peter J. Holzer
For separate insert statements that should have about the same performance. (It is usually much faster to write to a csv file and load that with copy than to insert each row, but you don't do that and it might be difficult in your case). hp -- _ | Peter J. Holzer| we build much b

Plan for update ... where a is not distinct from b

2017-11-28 Thread Peter J. Holzer
2.07 rows=1 width=0) ║ Index Cond: (macrobondtimeseries IS NULL) ╚═══════════╝ hp -- _ | Peter J. Holzer| we build much bigger, better disasters now

<    1   2   3   4   5   6