Re: Blank, nullable date column rejected by psql

2019-02-12 Thread Laurenz Albe
NULL (unknown) as well. That is much better than any "zero" value which would lead to an undesired result. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Streaming replication - invalid resource manager ID

2019-02-14 Thread Laurenz Albe
references to the source deliberately. Since you say you like PostgreSQL and are someone who wants to understand what is going on, your way will eventually lead to the source code. Many of the error messages only make sense if you understand how PostgreSQL works, e.g. that there is a WAL receiver process that cannot proceed if the master server is shut down. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: PG Upgrade with hardlinks, when to start/stop master and replicas

2019-02-18 Thread Laurenz Albe
th rebuilding the standby later. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: LDAP authenticated session terminated by signal 11: Segmentation fault, PostgresSQL server terminates other active server processes

2019-02-20 Thread Laurenz Albe
ticated user, query foreign table - ERROR, server > crashes with signal 11: Segmentation fault error when I quit the psql session Are the "postgres" executable and libpq linked with the same version of OpenLDAP? Any other extensions installed? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Future Non-server Windows support???

2019-03-02 Thread Laurenz Albe
n the GUI level, while the C API is pretty much the same. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: POSTGRES/MYSQL

2019-03-11 Thread Laurenz Albe
wned and controlled by Oracle, but free open source. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: POSTGRES/MYSQL

2019-03-12 Thread Laurenz Albe
> For updates, MySQL avoids a lot of index write overhead. PostgreSQL has more > overhead per update. That is what I meant when I said that PostgreSQL is less suitable for a key-value store. There is HOT update which can mitigate the problem if the updated columns are not indexed. Yo

Re: xmin and very high number of concurrent transactions

2019-03-13 Thread Laurenz Albe
us_commit = off", I can imagine that it could matter. It is not a matter of how many clients there are, but of how often a new writing transaction is started. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Where to store Blobs?

2019-03-13 Thread Laurenz Albe
re several hundret MByte) Ideally outside the database, if they are many. Large databases are harder to backup than large file systems. If you keep 20MB binaries in the database, you'd use the "bytea" data type. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: postgres 9.5 DB corruption: invalid byte sequence for encoding "UTF8"

2019-03-26 Thread Laurenz Albe
nitdb", dump and restore to switch to checksums. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Recommendation to run vacuum FULL in parallel

2019-04-02 Thread Laurenz Albe
t; 3. What is the best way to run VACUUM FULL with less window. Identify which tables really need it rather than VACUUMing everything. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: 10.2: high cpu usage on update statement

2019-04-07 Thread Laurenz Albe
8 cores, all of which are 90% busy. Try to profile the server ("perf" on Linux) to see where the time is spent. Are there any foreign key constraints pointing to the table being updated? Then make sure that either no key column is updates or that the foreign keys are indexed. Y

Re: Multicolumn index for single-column queries?

2019-04-18 Thread Laurenz Albe
therefore you will have more disk-io when you read from such an index. To be more explicit: if you can live with a slightly less efficient index scan and want fast data modifications, use only the second index. If you hardly ever update the table, don't mind the wasted space and want e

Re: Display View Columns and Their Source Tables and Columns

2019-04-21 Thread Laurenz Albe
as an expression that involves several columns of the base table. You'd have to parse pg_rewrite.ev_action. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: 9.6.9 Default configuration for a default installation but different with-krb-srvnam

2019-04-26 Thread Laurenz Albe
make install > command. After restarting the service, all will work as expected with the > same database objects that were running before? If you use the same major release and configured it identically on the same architecture, yes. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: 9.6.9 Default configuration for a default installation but different with-krb-srvnam

2019-04-26 Thread Laurenz Albe
QL was configured. > > Do you know if it possible to run a query or something else because pg_config > isn’t in the binaries. > I’ve saw it but is was of version 10 or 11, not the 9.6 You have to install the package that contains the headers and development tools doe that. Usually it is called *-dev or *-devel. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Laurenz Albe
ool, > but I can't figure out how to get it. I see the following RPM (the ones > with an 'i' or 'i+' are installed): > [...] > i | postgresql10-devel | PostgreSQL development header files and-> > | package That would be the one with pg_config in it. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Migrating an application with Oracle temporary tables

2019-05-02 Thread Laurenz Albe
vacuumed fast enough. Other than that, I don't really see the need for keeping a permanent "blueprint" table around; all this can lead to is confusion. True, it is cute to use CREATE TABLE ... (LIKE ...), but a few lines more in your code won't kill you. Particularly since you have that only once in your code, right? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Migrating an application with Oracle temporary tables

2019-05-02 Thread Laurenz Albe
ocedures against the temporary table. Yes, that would cause a problem. The SQL statement "DISCARD PLANS" should fix the problem. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: integrate Postgres Users Authentication with our own LDAP Server

2019-05-08 Thread Laurenz Albe
emote logins with that user. But for your application users LDAP authentication is a fine thing, and not hard to set up if you know a little bit about LDAP. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Postgres Database Hacked

2019-05-08 Thread Laurenz Albe
the hole through which the attacker crept in. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: integrate Postgres Users Authentication with our own LDAP Server

2019-05-09 Thread Laurenz Albe
as stupid enough not to notice right away). Then, please don't top-post on these lists. Write your reply *below* what you quote. What exactly is your problem? "We are getting issues" is not detailed enough. You probably just have to get the encoding right. Yours, Lau

Re: distinguish update from insert (on conflict)

2019-05-22 Thread Laurenz Albe
his answer can help you: https://stackoverflow.com/a/39204667/6464308 Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: csvlog Behavior when log file missing

2019-06-03 Thread Laurenz Albe
l mess with your log files and you should be able to find out more about the problem. I never use logrotate with PostgreSQL, but set "log_filename" to "postgresql-%a.log" or "postgresql-%d.log", "log_truncate_on_rotation" to "on" and "log_rotation_size" to "0". Then PostgreSQL rotates the log by itself. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Long running query - connection and keepalives enabled but query not canceled

2019-06-04 Thread Laurenz Albe
ger than that? Try to experiment with lower settings. It will cause marginally more network traffic, but dead connections will be detected more quickly. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: granting right to create and delete just one database

2019-06-05 Thread Laurenz Albe
by a normal user that has the EXECUTE privilege on the function. Don't forget to "SET search_path" on such a function (as mentioned in the documentation). It might also be a good idea to REVOKE EXECUTE on the function from PUBLIC. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: granting right to create and delete just one database

2019-06-05 Thread Laurenz Albe
EDB privilege. > > Thanks, that's a great idea! Is this pattern documented anywhere as a > complete finished thing? I'm afraid that is left as an exercise to the reader. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Strange connection limit problem

2019-06-07 Thread Laurenz Albe
hing else. What is the error message in the log? What do you see in /proc/12345/limits and /proc/12345/cgroup (assuming that your postmaster PID is 12345)? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: How to return ARRAY from SQL function?

2019-06-14 Thread Laurenz Albe
ype. You'll have to specify an array of which type you want, probably ... RETURNS text[] Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: restore error

2019-07-02 Thread Laurenz Albe
nnect timeout occurred Just guessing: Perhaps there is a materialized view that is based on a foreign table, and when PostgreSQL tries to populate the materialized view during the restore, it fails to connect to the remote database. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Statistics tables not being updated anymore

2019-07-02 Thread Laurenz Albe
he boot sequence, IPv6 was disabled, so no more statistics could be collected. Since it is an UDP socket, there were no errors. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re:

2019-07-02 Thread Laurenz Albe
file. The default is a tab character in text format, a comma in CSV format. This must be a single one-byte character. This option is not allowed when using binary format. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: multiple nodes in FDW create server statement

2019-07-03 Thread Laurenz Albe
names or ports, and you can also use "target_session_attrs". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Expression of check constraint

2019-07-04 Thread Laurenz Albe
types are binary coercible (the storage ist the same). > 3.The column ratified is of type character varying(1). Why is it casted > to text? See 2. above. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: Converting to identity columns with domains on PK columns

2019-07-05 Thread Laurenz Albe
ALTER TABLE mytable ALTER id ADD GENERATED ALWAYS AS IDENTITY; That would not rewrite the table, just "relabel" the type name to "integer" and then convert it to an identity column. Why do you want that extra level of obfuscation rather than calling an integer an integer? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

Re: PostgreSQL in-transit compression for a client connection

2023-04-27 Thread Laurenz Albe
pport it anyway. Yours, Laurenz Albe

Re: PostgreSQL in-transit compression for a client connection

2023-04-27 Thread Laurenz Albe
PostgreSQL > backend recompress them when TOAST'ed. That's a waste of CPU and IO > bandwidth... That's not what you were looking for, but why not store the compressed data in the database (after SET STORAGE EXTERNAL on the column) and uncompress them after you have received them on the client side? Yours, Laurenz Albe

Re: libpq and multi-threading

2023-05-02 Thread Laurenz Albe
ever, > when I try to read > the result from the parent thread, the program crashes with a segmentation > fault. That's too little information. Yours, Laurenz Albe

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

2023-05-04 Thread Laurenz Albe
roblem with a storage driver, file system or some other low-level software component. It might of course be a PostgreSQL bug too, but it is hard to say without a way to reproduce... Yours, Laurenz Albe

Re: Death postgres

2023-05-07 Thread Laurenz Albe
t; > What are the cases where postgres may grow without caring about > temp_file_limit ? That's too little information for a decent answer. One obvious answer is: if it is not writing temporary files. Yours, Laurenz Albe

Re: ICU, locale and collation question

2023-05-08 Thread Laurenz Albe
this a safe configuration to avoid index corruption, and other > problems, while still being compatible with the previous locale > settings? Yes, that is safe. But it is not compatible with the old setup when it comes to lc_time, lc_messages and the others. You should use sv_SE.UTF-8 for these locale categories. Note that that won't cause problems with upgrading the C library. Yours, Laurenz Albe

Re: ICU, locale and collation question

2023-05-09 Thread Laurenz Albe
The C collation is not good for natural language sorting, but it is fast and not subject to collation changes. Yours, Laurenz Albe

Re: Death postgres

2023-05-10 Thread Laurenz Albe
ost=0.00..243466.06 rows=2965306 width=31) >                      ->  Parallel Hash  (cost=243466.06..243466.06 > rows=2965306 width=34) >                            ->  Parallel Seq Scan on table_b t2   > (cost=0.00..243466.06 rows=2965306 width=34) >  JIT: >    Functions: 19 >    Options: Inlining true, Optimization true, Expressions true, Deforming true > (17 rows) Perhaps parallel query drives you OOM. Does the problem also happen if "max_parallel_workers_per_gather" is set to 0? Yours, Laurenz Albe

Re: How can I change replication slot's restart_lsn from SQL?

2023-05-16 Thread Laurenz Albe
t; > I tried with pg_recvlogical, and read > https://www.postgresql.org/docs/current/protocol-replication.html but > I don't see how I can make restart_lsn advance to anything. You could shutdown the server and edit the file in "pg_replslot" with a hex editor. Not very convenient, and you'd have to study the source to understand the format of the file. Yours, Laurenz Albe

Re: How can I change replication slot's restart_lsn from SQL?

2023-05-17 Thread Laurenz Albe
On Wed, 2023-05-17 at 08:21 +0200, hubert depesz lubaczewski wrote: > On Wed, May 17, 2023 at 08:16:41AM +0200, Laurenz Albe wrote: > > On Tue, 2023-05-16 at 19:35 +0200, hubert depesz lubaczewski wrote: > > > > I'm working on a workaround for a bug in Pg > >

Re: Unexpected cross-database vacuum impact with hot_standby_feedback=on

2023-05-19 Thread Laurenz Albe
ot;, which corresponds to the snapshot held by the oldest query in any database on the standby server. Yours, Laurenz Albe

Re: Where I can find the achieve of the 'generate_series' ?

2023-05-30 Thread Laurenz Albe
it.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/adt/int.c;h=44d1c7ad0c4d770acc33f35bb57080bac7670e5c;hb=HEAD#l1499 This is the "integer" version of the function, the others are in "int8.c", "numeric.c" and "timestamp.c". Yours, Laurenz Albe

Re: Question - Does PostgreSQL have an Evaluation Assurance Level?

2023-05-31 Thread Laurenz Albe
ould appreciate any assistance you are able > to provide for this. I have never heard of that, but I'll reply on the -general list, where the question is more likely to reach the people who know. Yours, Laurenz Albe

Re: EXTERNAL: Re: Question - Does PostgreSQL have an Evaluation Assurance Level?

2023-05-31 Thread Laurenz Albe
But this is more about ticking off checkboxes, right? Yours, Laurenz Albe

Re: custom background worker task for \copy?

2023-06-02 Thread Laurenz Albe
o the easy way of using several database connections to run the parallel COPY statements? Yours, Laurenz Albe

Re: [Question]What will happen if the server active close the connection?

2023-06-05 Thread Laurenz Albe
e user) If the server has already closed the connection, nothing much will happen. If the client never sends ACK to the FIN, the session will still time out. You can fiddle with the tcp_keepalives_* parameters to influence that. Yours, Laurenz Albe

Re: Composite type: Primary Key and validation

2023-06-05 Thread Laurenz Albe
this way I've a dominan of composite type that contain others > domain... what do you think? Avoid using composite types as data types for a table column. It adds complexity for no clear gain. Yours, Laurenz Albe

Re: Composite type: Primary Key and validation

2023-06-05 Thread Laurenz Albe
gt; > Talking about first point I could use the "table inheritance", but I've to > reset all constraints for each table :-( Inheritance is actually a very good way to do this. You don't inherit constraints, but at least the column definitions. Yours, Laurenz Albe

Re: vacuum to prevent wraparound

2023-06-06 Thread Laurenz Albe
ovacuum that caused your concern, but afterwards you will never again have a long-running, intense autovacuum run on that table. Yours, Laurenz Albe

Re: date format

2023-06-14 Thread Laurenz Albe
step process, if you create a view on the table that uses to_date() to convert the column to a "date". Yours, Laurenz Albe

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

2023-06-16 Thread Laurenz Albe
On Fri, 2023-06-16 at 09:40 +, Brainmue wrote: > I am currently looking for a solution similar to Oracle Listener. Can you explain why? Perhaps there exists a good solution for the underlying problem. Yours, Laurenz Albe

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

2023-06-16 Thread Laurenz Albe
l.org/docs/current/libpq-ldap.html Yours, Laurenz Albe

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

2023-06-16 Thread Laurenz Albe
On Fri, 2023-06-16 at 14:49 +, Brainmue wrote: > 16. Juni 2023 14:50, "Laurenz Albe" schrieb: > > > On Fri, 2023-06-16 at 12:35 +, Brainmue wrote: > > > > > We want to minimise dependencies between the application and the > > > associ

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

2023-06-16 Thread Laurenz Albe
On Fri, 2023-06-16 at 09:04 -0500, Ron wrote: > On 6/16/23 07:50, Laurenz Albe wrote: > > On Fri, 2023-06-16 at 12:35 +, Brainmue wrote: > > > We want to minimise dependencies between the application and the > > > associated PostgreSQL DB. > > > The idea

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

2023-06-16 Thread Laurenz Albe
On Fri, 2023-06-16 at 15:25 +0200, Dominique Devienne wrote: > On Fri, Jun 16, 2023 at 2:50 PM Laurenz Albe wrote: > > There is an existing solution for that: the libpq connection service file: > > https://www.postgresql.org/docs/current/libpq-pgservice.html > > The problem

Re: strange behavior of .pgpass file

2023-06-21 Thread Laurenz Albe
postgres -p 5432 -c "select > pg_is_in_recovery" > > I don't get any errors and get the expected output as "t". > > Note: the passwords in and path of both pgpass files are identical. > > then why am I getting errors on the slave node for the same command even > after having everything the same ? pg_hba.conf could be different on both servers. Yours, Laurenz Albe

Re: libpq: What can and cannot be bound? How to know?

2023-06-21 Thread Laurenz Albe
, DELETE, MERGE, or VALUES statement. so NOTIFY is not supported. However, you need some inside knowledge to know that what you are running is an "unnamed prepared statement" and that the limitation stated in PREPARE applies. Yours, Laurenz Albe

Re: synchronous_commit= remote_apply | "The transaction has already committed locally..."

2023-06-23 Thread Laurenz Albe
that primary database can > have locally > committed data when it is waiting on SYNC and receive the cancel signal from > the application, > it can be helpful. I don't think that's anywhere in the documentation. Yours, Laurenz Albe

Re: synchronous_commit= remote_apply | "The transaction has already committed locally..."

2023-06-23 Thread Laurenz Albe
is this proposal: https://www.postgresql.org/message-id/flat/CALj2ACUrOB59QaE6%3DjF2cFAyv1MR7fzD8tr4YM5%2BOwEYG1SNzA%40mail.gmail.com Yours, Laurenz Albe

Re: plan using BTree VS GIN

2023-06-23 Thread Laurenz Albe
registry)::text) ~~* > '%nse%'::text))) >          Rows Removed by Filter: 6226870 >          Buffers: shared hit=4322296 read=1608998 dirtied=1 written=1247 >  Planning Time: 0.891 ms >  Execution Time: 86509.070 ms > (10 rows) > > It's not using our gin index at all, but the btree one. The problem is that PostgreSQL estimates that the index scan will return 11214 rows, when it is actually one. This makes the plan to scan the table using an index that matches the ORDER BY clause appealing: we might find 100 rows quickly and avoid a sort. You can try to improve the estimates with more detailed statistics, but if that doesn't do the job, you can modify the ORDER BY clause so that it cannot use the bad index: ORDER BY res_partner.display_name ,res_partner.id + 0 Yours, Laurenz Albe

Re: Replication between different 15.x minor versions ok?

2023-06-28 Thread Laurenz Albe
On Wed, 2023-06-28 at 12:01 +0200, David Tinker wrote: > Is it ok to use physical replication between different 15.x minor releases > (on Ubuntu 22.04)? I haven't been able to find a definitive answer. Yes, that is OK. Yours, Laurenz Albe

Re: pgbouncer

2023-06-28 Thread Laurenz Albe
e active as much as possible. That will improve throughput. Yours, Laurenz Albe

Re: need explanation about an explain plan

2023-06-28 Thread Laurenz Albe
bet is to create an index that covers both WHERE conditions, or a covering index, which will get you the best result: CREATE INDEX ON table1 (numfic, ladate) INCLUDE (cod, nb_obs); Yours, Laurenz Albe

Re: need explanation about an explain plan

2023-06-28 Thread Laurenz Albe
On Wed, 2023-06-28 at 19:25 +0200, Marc Millas wrote: > Hi Laurenz, as said, in each partition there is only one value for ladate. The planner doesn't seem to take that into account. Yours, Laurenz Albe

Re: Toasted column values during replication

2023-06-30 Thread Laurenz Albe
h logical decoding plugin are you using? "pgoutput", which is provided by PostgreSQL, will surely emit properly detoasted values. Yours, Laurenz Albe

Re: Need Help On Upgrade

2023-07-10 Thread Laurenz Albe
    0.0.0.0/0 md5" Then you must have entered the wrong password. If in doubt, change the password. Yours, Laurenz Albe

Re: EDB to Postgres Migration

2023-07-13 Thread Laurenz Albe
f EDB's special featurs, a simple pg_upgrade could work. Otherwise, things can become tricky. Test well. Yours, Laurenz Albe

Re: create a temp table in SPI

2023-07-13 Thread Laurenz Albe
the query cannot see the results from the previous statement. The documentation is quite clear here: It is generally unwise to mix read-only and read-write commands within a single function using SPI; that could result in very confusing behavior, since the read-only queries would not see the results of any database updates done by the read-write queries. Yours, Laurenz Albe

Re: Upgrade Failure

2023-07-18 Thread Laurenz Albe
    ok >   > The source cluster was not shut down cleanly. > Failure, exiting > > Please how do you resolve this Well, start the 9.5 server and shut it down cleanly. Yours, Laurenz Albe

Re: Effects of dropping a large table

2023-07-19 Thread Laurenz Albe
king other transactions for a long time, you can SET lock_timeout = '1s'; DROP TABLE ...; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com

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

2023-07-20 Thread Laurenz Albe
RYS = '01' > > The amount of data in the table is as follows. > TBL_SHA    38700325 > TBL_INF    35546 This looks very much like it is a problem with the data types. I see that you are using "character", which you shouldn't do. What I cannot see is if the columns are defined as "character" or whether you bind the parameters as "character". Can you show us the table definition of "TBL_SHA" and "TBL_INF"? Yours, Laurenz Albe

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

2023-07-20 Thread Laurenz Albe
On Thu, 2023-07-20 at 22:14 +0800, gzh wrote: > The information I provided is incorrect, please see my previous reply. My question remains: I would like to see the table definitions. Also, did you ANALYZE the tables? Yours, Laurenz Albe

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

2023-07-23 Thread Laurenz Albe
_CD = 'MLD009'::bpchar) AND (ETRYS = > '0001'::bpchar)) >                     Rows Removed by Filter: 32000325 > Planning Time: 0.162 ms > Execution Time: 124168.838 ms Thanks. That should definitely use a b-tree index defined on (ms_cd, etrsys). Did you change any parameters that have an impact on query planning? You can see that in the output of EXPLAIN (ANALYZE, BUFFERS, SETTINGS). Yours, Laurenz Albe

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

2023-07-24 Thread Laurenz Albe
"\d tablenane" in "psql"). Invalid indexes won't be used. Yours, Laurenz Albe

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

2023-07-24 Thread Laurenz Albe
'1886088kB', jit = 'off', search_path = > '"$user", mdb' > [...] No unusual settings. So that theory is dead. > > One other idea: check if the index is INVALID (this will > > be visible if you run "\d tablenane" in "psql"). &

Re: Setting Auto Commit off in C API

2023-07-24 Thread Laurenz Albe
On Mon, 2023-07-24 at 18:54 -0700, Badri Subramaniam wrote: > Is there a way to turn off auto commit using the C API? No. Yours, Laurenz Albe

Re: Reindex after upgrade from PostgreSQL 12.10 to PostgreSQL 15.3

2023-07-28 Thread Laurenz Albe
grade the operating system.) > Will the performance be as good as before I upgrade? It should be at least as good, but sometimes it isn't. That's why you test (and tune if necessary). Yours, Laurenz Albe

Re: Support for Deferred Constraints in PG15 Logical Replication

2023-08-28 Thread Laurenz Albe
TRAINTS ALL DEFERRED is replicated, no, it isn't. Yours, Laurenz Albe

Re: createuser unexpectedly creates superuser with createdb and createrole

2023-08-29 Thread Laurenz Albe
ld cause more harm than benefit. First, as the code says, it doesn't make a lot of difference. And who knows, perhaps someone somewhere creates superusers, later changes them to NOSUPERUSER and expects CREATEDB and CREATEROLE to be set after that. If anything, we could add something to the documentation. Yours, Laurenz Albe

Re: createuser unexpectedly creates superuser with createdb and createrole

2023-09-04 Thread Laurenz Albe
On Tue, 2023-09-05 at 00:03 +0200, Erik Wienhold wrote: > On 04/09/2023 03:42 CEST Tom Lane wrote: > > I think the last hunk of this is plenty sufficient, and the earlier > > ones just add noise. > > Done. Looks good to me. Yours, Laurenz Albe

Re: Array vs Temporary table vs Normal Table + truncate at end

2023-09-04 Thread Laurenz Albe
all the time, I'd try to use a persistent table to avoid catalog table bloat. If several function invocations need to store their record set in the same table, you could make the backend process ID part of the primary key. Yours, Laurenz Albe

Re: Postgres partition max limit

2023-09-06 Thread Laurenz Albe
On Wed, 2023-09-06 at 13:35 +0530, Daulat wrote: > Do we have a max limit of partitions for a table in postgres? I don't think there is a technical limit. But as soon as you have more than a few thousand partitions, the experience won't be that great any more. Yours, Laurenz Albe

Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"

2023-09-06 Thread Laurenz Albe
reproducer, but still I am curious what is wrong here with me running > an "ANALYZE" after my data import. To fix the "pg_statistic" error: - take down time - set "allow_system_mods = on" - TRUNCATE pg_statistic; - ANALYZE; You are lucky that the corrupted table is one that holds data that can be rebuilt. Yours, Laurenz Albe

Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"

2023-09-06 Thread Laurenz Albe
On Wed, 2023-09-06 at 10:33 +0200, Torsten Krah wrote: > Am Mittwoch, dem 06.09.2023 um 10:21 +0200 schrieb Laurenz Albe: > > You are lucky that the corrupted table is one that holds data that > > can be rebuilt. > > It is a test instance / container anyway which is deleted

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

2023-09-06 Thread Laurenz Albe
llation that does what you want explicitly: SELECT upper('testµ' COLLATE "C"); upper ═══ TESTµ (1 row) But then don't complain if your "ö" and "é" are not uppercased either. Yours, Laurenz Albe

Re: Query performance going from Oracle to Postgres

2023-09-06 Thread Laurenz Albe
t;:SYS_B_04 AND >   "HISTORYEVE0_"."EVENT_TYPE"<>:SYS_B_05 AND > "HISTORYEVE0_"."EVENT_TYPE"<>:SYS_B_06 AND >       "HISTORYEVE0_"."EVENT_TYPE"<>:SYS_B_07 AND > "HISTORYEVE0_"."EVENT_TYPE"<>:SYS_B_08 AND >   "HISTORYEVE0_"."IS_DELETED"=:SYS_B_00 AND > (INTERNAL_FUNCTION("HISTORYEVE0_"."PRODUCT_VIEW") OR >  "HISTORYEVE0_"."PRODUCT_VIEW" IS NULL))) >   > It finds the same 332 rows but it does only 20 logical reads. In PostgreSQL, the 332 matching rows seem to me stored mostly on different pages, while they are better clustered in your Oracle table. If it is really very important for you, and the 57 milliseconds for the index scan is too much, you can reorganize the table with CLUSTER hist28.history_event_display_timestamp_20230301 USING history_event_display_timesta_prism_guid_display_timestamp_idx1; That should reduce the number of pages read. Yours, Laurenz Albe

Re: ERROR: stack depth limit exceeded

2023-09-07 Thread Laurenz Albe
My advice it not to worry. But if you feel like worrying very much, go ahead and test your application thoroughly with 12.14. Yours, Laurenz Albe

Re: Unqualified relations in views

2023-09-12 Thread Laurenz Albe
ot;. So the solution is to set "search_path" empty: SET search_path = ''; SELECT pg_get_viewdef('myschema.myview'); Yours, Laurenz Albe

Re: trouble restoring a database backed up with pg_dump/pg_dump_all - relations are created in the wrong order

2023-09-18 Thread Laurenz Albe
the tables micht be an explanation. Since one of the functions is called "check_...", another explanation could be that you have check constraints that use functions that access other tables. That won't work and is not allowed. Without knowing more, I cannot be certain what exactly is wrong, but it doesn't look like a PostgreSQL bug to me. Perhaps you can provide more details. Yours, Laurenz Albe

Re: could not open file "base/XX/XX": Interrupted system call

2023-09-20 Thread Laurenz Albe
25.076 CEST [47] ERROR:  could not open file > "base/16386/17328": Interrupted system call > 2023-09-20 10:38:41.897 CEST [49] ERROR:  could not open file > "base/16386/68359": Interrupted system call Is that an NFS mount? What are the mount options? Yours, Laurenz Albe

Re: trouble restoring a database backed up with pg_dump/pg_dump_all - relations are created in the wrong order

2023-09-20 Thread Laurenz Albe
he function itself, we > refer to > the accounts table, and if I am not mistaken, the whole point of pl/pgsql is > that > you can refer to tables, etc. so I don't think I have done anything 'illegal'. Ok, so my conjecture about check constraints was wrong. The fact remains that you have to restore the dump into an empty database. Then these errors should not occur. Yours, Laurenz Albe

Re: Database selection

2023-09-20 Thread Laurenz Albe
rable. The people on MySQL mailing lists or forums might tell an entirely different story. I would say something about license and free software, but if you plan to lock yourself into the cage of a cloud hosted database, that probably doesn't matter much. Yours, Laurenz Albe

Re: Database selection

2023-09-20 Thread Laurenz Albe
gy for transaction management? or > any > different/better ones? Nobody except Amazon can tell. It is closed source. Yours, Laurenz Albe

Re: Changed functionality from 14.3 to 15.3

2023-09-21 Thread Laurenz Albe
also be that this is caused by modifications that Amazon did to PostgreSQL. Yours, Laurenz Albe

Re: Migration of Oracle Vault to Postgres

2023-09-22 Thread Laurenz Albe
ication, which may not be simple either. Yours, Laurenz Albe

<    2   3   4   5   6   7   8   9   10   11   >