Re: ora2pg and invalid command \N

2018-03-16 Thread Julien Rouhaud
On Fri, Mar 16, 2018 at 8:28 PM, Adrian Klaver wrote: > On 03/16/2018 11:36 AM, Charlin Barak wrote: >> >> Thanks for your response. >> >> the NULL values from Oracle were indeed replaced by \N in the data output. >> How do I go about loading this file? I hope I do not have to temporary >> replace

Re: Default ordering option

2019-07-26 Thread Julien Rouhaud
On Fri, Jul 26, 2019 at 9:53 AM Cyril Champier wrote: > > Adrian: > >> Are you really looking for a pseudo-random name? > > > No, the code I pasted was an existing production bug: the last_name should > have been unique, so the selected patient would always be the same. > This should have been de

Re: Linux Mint - cannot find auto_explain extension

2019-08-01 Thread Julien Rouhaud
Hi, On Thu, Aug 1, 2019 at 7:53 PM Keith Roberts wrote: > > postgres=# CREATE EXTENSION auto_explain; > ERROR: could not open extension control file > "/usr/share/postgresql/9.5/extension/auto_explain.control": No such file > or directory > postgres=# > > Does anyone have any idea what package I

Re: Question on upgrading postgresql from 10.7 to 11.5

2019-12-25 Thread Julien Rouhaud
On Wed, Dec 25, 2019 at 3:42 PM Lu, Dan wrote: > > Hello, > > I am trying to upgrade my PG instance from 10.7 to 11.5. > > I got an error in doing so. Any idea what I am missing? > > Example: pg_upgrade -d /hostname/pg/dpoc/data -D /hostname/pg/dpoc115/data -b > /hostname/pg/PostgreSQL-10.7/bin

Re: Query returns no results until REINDEX

2020-02-11 Thread Julien Rouhaud
On Tue, Feb 11, 2020 at 8:33 PM Peter Geoghegan wrote: > > On Sun, Feb 9, 2020 at 12:50 PM Colin Adler wrote: > > Looks like it found something. I checked out the contrib/pageinspect docs > > but > > wasn't too sure what to run. Are incompatible libc versions causing btree > > corruption somethi

Re: Enabling extensions on a compiled instance of postgresql 12.1

2020-02-13 Thread Julien Rouhaud
On Thu, Feb 13, 2020 at 01:34:55PM +, Sterpu Victor wrote: > Hello > > I compiled from source postgresql 12.1 and all went fine but when I try to > restore my DB I can see that I have 3 extensions missing: uuid-ossp, > btree_gist, tablefunc. > I tried to run: CREATE EXTENSION "uuid-ossp"; and t

Re: strange locks on PG 11 with Golang programs

2020-03-09 Thread Julien Rouhaud
On Mon, Mar 09, 2020 at 09:51:21AM +0100, Josef Machytka wrote: > We are lately experiencing very strange locks on PostgreSQL 11.7 when we > process ETL tasks using our programs in Go 1.13.8 using standard libraries > sql and pq. > > ETL task has to rename tables but PostgreSQL shows that this simp

Re: strange locks on PG 11 with Golang programs

2020-03-09 Thread Julien Rouhaud
On Mon, Mar 09, 2020 at 10:21:23AM +0100, Josef Machytka wrote: > On Mon, 9 Mar 2020 at 09:58, Julien Rouhaud wrote: > > > The query displayed is just the query currently executing, but if the > > connection is in a transaction the problematic lock could have been >

Re: PG12 autovac issues

2020-03-23 Thread Julien Rouhaud
On Fri, Mar 20, 2020 at 12:03:17PM -0700, Andres Freund wrote: > Hi, > > On 2020-03-20 12:42:31 -0500, Justin King wrote: > > When we get into this state again, is there some other information > > (other than what is in pg_stat_statement or pg_stat_activity) that > > would be useful for folks here

Re: PG12 autovac issues

2020-03-23 Thread Julien Rouhaud
Hi, On Mon, Mar 23, 2020 at 09:23:03AM -0700, Andres Freund wrote: > Hi, > > On 2020-03-23 16:22:47 +0100, Julien Rouhaud wrote: > > On Fri, Mar 20, 2020 at 12:03:17PM -0700, Andres Freund wrote: > > > Hi, > > > > > > On 2020-03-20 12:42:31 -0500, J

Re: PG12 autovac issues

2020-03-27 Thread Julien Rouhaud
On Fri, Mar 27, 2020 at 02:12:04PM +0900, Michael Paquier wrote: > On Thu, Mar 26, 2020 at 09:46:47AM -0500, Justin King wrote: > > Nope, it was just these tables that were looping over and over while > > nothing else was getting autovac'd. I'm happy to share the full log > > if you'd like. > > T

Re: Why there is 30000 rows is sample

2020-04-04 Thread Julien Rouhaud
Hi, On Sat, Apr 04, 2020 at 10:07:51AM +0300, Andrus wrote: > Hi! > > vacuumdb output: > > vacuumdb: vacuuming database "mydb" > INFO: analyzing "public.mytable" > INFO: "mytable": scanned 2709 of 2709 pages, containing 10834 live rows and > 0 dead rows; 10834 rows in sample, 10834 estimated t

Re: Log Unique Queries without Params?

2020-04-11 Thread Julien Rouhaud
On Sun, Apr 12, 2020 at 6:51 AM Chris Morris wrote: > > I have a local script I've written that will scan a log of PG queries to > extract out unique queries without any specific parameter data. For example, > if these 2 queries are actually run: > > SELECT * FROM foo where bar = 1; > SELECT * F

Re: Recursive Queries

2020-04-16 Thread Julien Rouhaud
On Thu, Apr 16, 2020 at 2:49 PM Rob Northcott wrote: > > From: Alex Magnum > > What I would like to do is to create a table as shown below that displays the > counts per our for the past n dates. > > > > I can do this with a function but is there an easy way to use recursive > queries? > >

Re: Replication issue

2020-04-17 Thread Julien Rouhaud
On Fri, Apr 17, 2020 at 4:02 PM Adrian Klaver wrote: > > On 4/17/20 6:31 AM, Sonam Sharma wrote: > > I have setup db replication. And added below parameter in jdbc file . > > The connection is failing and it's throwing error like db doesn't exist > > on secondary server. > > > > jdbc:postgresql://

Re: increase of xact_commit vs txid_current

2020-05-07 Thread Julien Rouhaud
On Thu, May 7, 2020 at 7:01 PM wrote: > > Hi, > > I am confused, the documentation says for pg_stat_database > xact_commit Number of transactions in this database that have > been committed > and somewhere else > txid_current()get current transaction ID, assigning a new one > if

Re: Vanishing unique constraint

2020-06-01 Thread Julien Rouhaud
Hello, On Mon, Jun 1, 2020 at 11:15 AM Bernhard Beroun wrote: > > Hello, > > I am experiencing a strange thing on my production database server, which I > can't explain. > > On my production database server, there is a table called "label_suggestion" > which has a unique constraint on the "name

Re: Vanishing unique constraint

2020-06-01 Thread Julien Rouhaud
On Mon, Jun 1, 2020 at 1:23 PM Bernhard Beroun wrote: > > Am Montag, Juni 01, 2020 12:56 CEST, schrieb Julien Rouhaud > : > > On Mon, Jun 1, 2020 at 11:15 AM Bernhard Beroun wrote: > > > > Hello, > > > > I am experiencing a strange thing on my product

Re: Replication conflicts despite hot_standby_feedback = on?

2020-06-03 Thread Julien Rouhaud
On Wed, Jun 3, 2020 at 1:07 PM Laurenz Albe wrote: > > I'm seeing the following at a customer site: > > SELECT confl_tablespace, confl_lock, confl_snapshot, confl_bufferpin, > confl_deadlock > FROM pg_stat_database_conflicts > WHERE datname = 'something' \gx > > -[ RECORD 1 ]+-- > confl_t

Re: Replication conflicts despite hot_standby_feedback = on?

2020-06-03 Thread Julien Rouhaud
On Wed, Jun 3, 2020 at 2:05 PM Laurenz Albe wrote: > > On Wed, 2020-06-03 at 13:41 +0200, Julien Rouhaud wrote: > > > I'm seeing the following at a customer site: > > > > > > SELECT confl_tablespace, confl_lock, confl_snapshot, confl_buffe

Re: survey: psql syntax errors abort my transactions

2020-07-03 Thread Julien Rouhaud
On Fri, Jul 3, 2020 at 7:46 PM Ron wrote: > > On 7/3/20 1:54 AM, Laurenz Albe wrote: > > This is my favorite example why I like the way PostgreSQL does things: > > > > /* poor man's VACUUM (FULL) */ > > BEGIN; > > CREATTE TABLE t2 AS SELECT * FROM t1; > > DROP TABLE t1; > > ALTER TABLE t2 RENAME T

Re: Track pgsql steps

2020-07-30 Thread Julien Rouhaud
On Wed, Jul 29, 2020 at 7:58 PM Adrian Klaver wrote: > > On 7/29/20 8:44 AM, Olivier Leprêtre wrote: > > Hi, > > > > I have a rather long pgsql procedure and I would like to detect which > > step is currently executing (subscript 1,2,3…). Due to transaction > > isolation, it’s not possible to make

Re: PG 13 trusted extensions and pg_available_extensions

2020-09-23 Thread Julien Rouhaud
On Thu, Sep 24, 2020 at 10:58 AM Michael Paquier wrote: > > On Wed, Sep 23, 2020 at 03:28:45PM +, Daniel Westermann (DWE) wrote: > > I was playing a bit with trusted extensions and wondered if there is > > a reason that the "trusted" flag is not exposed in pg_available_extensions. > > I believ

Re: PG 13 trusted extensions and pg_available_extensions

2020-09-26 Thread Julien Rouhaud
On Fri, Sep 25, 2020 at 2:51 PM Daniel Westermann (DWE) wrote: > > On Thu, Sep 24, 2020 at 10:58 AM Michael Paquier wrote: > >> > >> On Wed, Sep 23, 2020 at 03:28:45PM +, Daniel Westermann (DWE) wrote: > >> > I was playing a bit with trusted extensions and wondered if there is > >> > a reason

Re: PG 13 trusted extensions and pg_available_extensions

2020-09-26 Thread Julien Rouhaud
On Sat, Sep 26, 2020 at 10:11 PM Tom Lane wrote: > > Julien Rouhaud writes: > > So, apparently pg_available_extension_versions already had those > > fields so all the required infrastructure was already there. I just > > added the exact same fields to pg_available_

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-23 Thread Julien Rouhaud
On Sun, Jan 24, 2021 at 2:58 PM rob...@redo2oo.ch wrote: > > root@elfero-test:~/scripts# pg_lsclusters > Ver Cluster Port Status OwnerData directory Log file > 10 main5433 online postgres /var/lib/postgresql/10/main > /var/log/postgresql/postgresql-10-main.log > [...] > psyc

Re: Script checking to see what database it's connected to

2021-02-21 Thread Julien Rouhaud
On Mon, Feb 22, 2021 at 7:19 AM Ron wrote: > > Thus, I want to add a bit to the top of the script, something like this: > > \if :DBNAME = postgres > echo "must not run in postgres" > exit > \endif > > However, I can't seem to find the magic sauce. You have to use a dedicated variable.

Re: Script checking to see what database it's connected to

2021-02-21 Thread Julien Rouhaud
On Mon, Feb 22, 2021 at 9:00 AM Ron wrote: > > On 2/21/21 5:26 PM, Julien Rouhaud wrote: > > On Mon, Feb 22, 2021 at 7:19 AM Ron wrote: > > Thus, I want to add a bit to the top of the script, something like this: > > \if :DBNAME = postgres > echo "must

Re: Different query result, maybe bad index

2021-02-24 Thread Julien Rouhaud
Hi, On Wed, Feb 24, 2021 at 7:50 PM Václav Steiner wrote: > > We have three servers running postgres 9.6, master and two slaves feeded by > streaming replication. > On of those slaves we are getting different query results. The replica was > recreated from scratch, but problem persists. > > If

Re: Simple Query Doesn't Even with Data

2022-03-10 Thread Julien Rouhaud
Hi, On Wed, Mar 09, 2022 at 08:40:45PM -0500, Scott Macri wrote: > > If I do a select * without a where clause I get the expected results. > However, when I execute the following select statement I was astonished > to see no results come back. > > SELECT * > FROM public.map_table > WHERE company_l

Re: primary_conninfo and restore_command ?

2022-03-10 Thread Julien Rouhaud
Hi, On Thu, Mar 10, 2022 at 02:51:16PM +0100, Luca Ferrari wrote: > a friend of mine has shown to me a "strange" configuration of its > physical replication server (13): he has both primary_conninfo and > primary_slot_name, with replication slots active when queried on the > master. So far so good

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-19 Thread Julien Rouhaud
Hi, On Tue, Apr 19, 2022 at 07:21:19PM -0700, David G. Johnston wrote: > On Tue, Apr 19, 2022 at 7:07 PM Bryn Llewellyn wrote: > > > *SUMMARY* > > > > This part of the syntax diagram for "alter function": > > > > *ALTER FUNCTION name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] > > action

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-19 Thread Julien Rouhaud
On Wed, Apr 20, 2022 at 10:47:07AM +0800, Julien Rouhaud wrote: > > AFAICT the problem is that SET / RESET part is messing with the HeapTuple, so > you can't use the procForm reference afterwards. Simply processing > parallel_item before set_items fixes the problem, as in th

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-19 Thread Julien Rouhaud
On Tue, Apr 19, 2022 at 11:06:30PM -0400, Tom Lane wrote: > Julien Rouhaud writes: > > On Wed, Apr 20, 2022 at 10:47:07AM +0800, Julien Rouhaud wrote: > >> > >> AFAICT the problem is that SET / RESET part is messing with the > >> HeapTuple, so you can

Re: No default for (user-specific) service file location on Windows?

2022-05-19 Thread Julien Rouhaud
Hi, On Thu, May 19, 2022 at 3:46 PM Dominique Devienne wrote: > > The doc is explicit about defaults for the password file: > From https://www.postgresql.org/docs/current/libpq-pgpass.html > Linux: ~/.pgpass > Windows: %APPDATA%\postgresql\pgpass.conf > > But for the service file OTOH, only the L

Re: No default for (user-specific) service file location on Windows?

2022-05-19 Thread Julien Rouhaud
On Thu, May 19, 2022 at 10:57:55AM +0200, Dominique Devienne wrote: > On Thu, May 19, 2022 at 10:17 AM Julien Rouhaud wrote: > > > Or is it instead a lack of symmetry in the implementations of these > > > two mechanisms? > > > > As far as I can see from t

Re: No default for (user-specific) service file location on Windows?

2022-05-19 Thread Julien Rouhaud
On Thu, May 19, 2022 at 10:11:06AM -0400, Tom Lane wrote: > I do not like your proposed wording, as it seems way too dense. > Can't we avoid the parenthetical remarks (plural) inside a sub-clause? > You're asking the reader to keep track of about three levels of > interrupt. Yes, I was a bit unhap

Re: No default for (user-specific) service file location on Windows?

2022-05-19 Thread Julien Rouhaud
On Thu, May 19, 2022 at 11:53:22PM +0800, Julien Rouhaud wrote: > On Thu, May 19, 2022 at 10:11:06AM -0400, Tom Lane wrote: > > I do not like your proposed wording, as it seems way too dense. > > Can't we avoid the parenthetical remarks (plural) inside a sub-clause? > > Y

Re: No default for (user-specific) service file location on Windows?

2022-05-19 Thread Julien Rouhaud
On Thu, May 19, 2022 at 06:38:46PM -0400, Tom Lane wrote: > Julien Rouhaud writes: > > This time with the patch. > > Pushed, with some minor twiddling to make the .pgpass and .pg_service.conf > descriptions more alike. I figured that the .pgpass docs are fine since > (sur

Re: Question about attention to pgsql-hack...@lists.postgresql.org

2022-06-26 Thread Julien Rouhaud
On Sun, Jun 26, 2022 at 01:22:49PM +0200, Laurenz Albe wrote: > On Sun, 2022-06-26 at 10:37 +, A Z wrote: > > I have successfully sent an (updated) email list message to > > > > pgsql-hack...@lists.postgresql.org > > > > which can be viewed in the archive here: > > > > https://www.postgresq

Re: Feature request: psql --idle

2022-07-27 Thread Julien Rouhaud
Hi, On Wed, Jul 27, 2022 at 02:49:45PM +0200, Wiwwo Staff wrote: > Since changing ph_hda.conf file to give users access involves the restart > of server, many companies I work(ed) use a bastion host, where users ssh > to, and are allowed "somehow" use postgresql. You mean pg_hba.conf right? It d

Re: a database can be created but not droped

2022-08-01 Thread Julien Rouhaud
Hi, On Mon, Aug 01, 2022 at 11:22:33AM +0200, Matthias Apitz wrote: > > This is with 14.1 on Linux. I have created a new database with > > $ createdb -U sisis -T template0 SRP-27097 > > I can connect to it, created tables and fill them with SQL: > > but I can not drop the database: > > $ psql -Usi

Re: Purpose of DEFERRABLE _and_ INITIALLY DEFERRED foreign key constraint checking?

2022-08-03 Thread Julien Rouhaud
Hi, On Wed, Aug 03, 2022 at 07:30:31PM -0500, Ron wrote: > > [quote] > |DEFERRABLE| > |NOT DEFERRABLE| > >This controls whether the constraint can be deferred. A constraint that >is not deferrable will be checked immediately after every command. >*Checking of constraints that are defer

Re: sequence id overflow ERROR using timescaledb

2022-08-04 Thread Julien Rouhaud
Hi, On Thu, Aug 04, 2022 at 08:47:16PM +, abrahim abrahao wrote: > >  I am using timescaledb version  2.7.2, and PostgreSQL 12.11 > [...] > I tried to compress a chuck using the compress_chunk function and running a > job as well, and I got "sequence id overflow" message ERROR.Any idea how to

Re: Surprising results from current_role in a "security invoker" trigger function in a "cascade delete via FK" scenario

2022-08-11 Thread Julien Rouhaud
On Thu, Aug 11, 2022 at 04:20:20PM -0700, Bryn Llewellyn wrote: > > Nobody has told me how an outsider like me can deliver such a .zip file, > together with its typographically nuanced external documentation, to readers > of plsql-general. So this is what I'll do: You mentioned previously that "Em

Re: Would it be possible to add functions to tab-completion in psql?

2022-08-16 Thread Julien Rouhaud
Hi, On Tue, Aug 16, 2022 at 02:28:49PM +0200, hubert depesz lubaczewski wrote: > Hi, > As a dba I have to, very often, query system functions, starting with > pg_last_xact_replay_timestamp and pg_current_wal_lsn. > > Would it be possible/hard/expensive, to change tab-completion so that: > > select

Re: ERROR: catalog is missing 3 attribute(s) for relid 150243

2022-08-18 Thread Julien Rouhaud
Hi, Please don't top-post on this list (and please trim quoted messages too). On Fri, Aug 19, 2022 at 05:55:03AM +0700, milist ujang wrote: > On Thu, Aug 18, 2022 at 5:33 PM milist ujang wrote: > > > > 3rd query ERROR same as subject (ERROR: catalog is missing 3 attribute(s) > > for relid 15024

Re: Missing query plan for auto_explain.

2022-08-30 Thread Julien Rouhaud
Hi, On Tue, Aug 30, 2022 at 01:16:43PM +0200, Alvaro Herrera wrote: > On 2022-Aug-30, Matheus Martin wrote: > > > Our Postgres recently started reporting considerably different > > execution times for the same query. When executed from our JDBC > > application the Postgres logs report an average

Re: Missing query plan for auto_explain.

2022-09-01 Thread Julien Rouhaud
Hi, On Thu, Sep 01, 2022 at 08:20:13PM +0100, Matheus Martin wrote: > We tried running the prepared statement six times as suggested but wasn't > still able to recreate the original problem. > > Perhaps more concerning/relevant is that we have not found any explanation > to why the explain plan i

Re: unable to install pldebugger

2022-09-12 Thread Julien Rouhaud
Hi, On Mon, Sep 12, 2022 at 06:49:21PM +0530, shashidhar Reddy wrote: > > I am in a process of upgrading postgres 12 to 13 on ubuntu. When I am > running the test getting error could not load library > "$libdir/plugin_debugger": ERROR: could not load library > "/usr/lib/postgresql/13/lib/plugin_d

Re: Missing query plan for auto_explain.

2022-09-12 Thread Julien Rouhaud
On Mon, Sep 12, 2022 at 05:34:37PM +0100, Matheus Martin wrote: > Understood. I have run a prepared statement with the query in question > through `psql` and JIT was not used (see plan below), however please note > that the long response times were never reproducible from `psql`, they only > happen

Re: unable to install pldebugger

2022-09-12 Thread Julien Rouhaud
On Mon, Sep 12, 2022 at 10:14:20PM +0530, shashidhar Reddy wrote: > Hello Julien, > > Can I use this link to install in community edition postgres or is it > specific to enterpriseDB It should work with the standard community edition.

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-26 Thread Julien Rouhaud
On Mon, Sep 26, 2022 at 11:18:34AM -0700, Bryn Llewellyn wrote: > > My demo seems to show that when a program connects as "client", it can > perform exactly and only the database operations that the database design > specified. > > Am I missing something? In other words, can anybody show me a vulne

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-27 Thread Julien Rouhaud
On Tue, Sep 27, 2022 at 05:27:22PM -0700, Bryn Llewellyn wrote: > > hjp-pg...@hjp.at wrote: > > > >> rjuju...@gmail.com wrote: > >> > >>> b...@yugabyte.com wrote: > >>> > >>> My demo seems to show that when a program connects as "client", it can > >>> perform exactly and only the database operation

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-27 Thread Julien Rouhaud
On Tue, Sep 27, 2022 at 07:29:39PM -0700, Bryn Llewellyn wrote: > > Now back to my new thread. I interpreted what Tom wrote to mean that he > flatly rejected the idea that a database design was possible that prevented a > client session that authorized as a role, that's designed for that purpose, >

Re: Limiting the operations that client-side code can perform upon its database backend's artifacts

2022-09-27 Thread Julien Rouhaud
On Tue, Sep 27, 2022 at 08:47:52PM -0700, Bryn Llewellyn wrote: > > For example, the "lower case only" rule was meant to be an > example of *any* data rule. Just like the write-once-read-many auto-generated > surrogate primary key rule. Can you show me how those data rules, unrealistic > as you mig

Re: Names of run-time configuration parameters (was: Limiting the operations that client-side code can perform upon its database backend's artifacts)

2022-10-01 Thread Julien Rouhaud
Hi, On Sat, Oct 01, 2022 at 02:05:53PM +0200, Peter J. Holzer wrote: > On 2022-09-30 17:59:01 -0700, Bryn Llewellyn wrote: > > set rls.tenant_id=42; > > This works because there is a "." in the name. Without the "." > PostgreSQL complains: > > hjp=> set rls_tenant_id=42; > ERROR: unrecognized con

Re: Postgres calendar?

2022-10-04 Thread Julien Rouhaud
Hi, On Tue, Oct 04, 2022 at 05:02:28PM -0400, Bruce Momjian wrote: > Would people be interesting in subscribing to a Postgres calendar that > includes dates for minor releases, final minor release dates for major > versions, commit fests, and even Postgres events? For example, it could > include

Re: Same query, same data different plan

2022-10-10 Thread Julien Rouhaud
On Mon, Oct 10, 2022 at 04:05:42PM +0300, Kostas Papadopoulos wrote: > Hi, > > Yes, I ran ANALYZE in both databases. Please look at https://wiki.postgresql.org/wiki/Slow_Query_Questions to provide more information.

Re: Weird planner issue on a standby

2022-10-11 Thread Julien Rouhaud
dby, > it should be the same on the primary. > > Actually, there are two things that really bug me: > * why the difference between primary and both standbys? > * why now? (it worked great before this weekend, and the only thing I know > happened before is a batch delete on sunday...

Re: Problem with LATERAL

2022-10-13 Thread Julien Rouhaud
Hi, On Thu, Oct 13, 2022 at 07:05:48AM +, Eagna wrote: > > relatively simple one would have thought! I tried to convert this into a > Postgres query as follows: > > SELECT  o.order_id, >   o.total_price - COALESCE(sub.paid, 0) > FROM _order o > LEFT JOIN LATERAL ( >     SELECT SUM(p.amount) A

Re: Problem with LATERAL

2022-10-13 Thread Julien Rouhaud
On Thu, Oct 13, 2022 at 08:04:03AM +, Eagna wrote: > > > > ERROR: syntax error at or near "WHERE" > > > LINE 10: WHERE o.total_price > ISNULL(sub.paid, 0); > > > > There error here is because a JOIN clause requires a join condition. Adding > > an > > "ON true" is probably what you want. You wo

Re: Attaching database

2022-10-14 Thread Julien Rouhaud
Hi, On Fri, Oct 14, 2022 at 11:16:44PM -0500, Igor Korot wrote: > > Sorry for resurrecting this old thread... > If an attaching the DB creates new connection which will be cmpletely > independent - how the INFORMATION_SCHEMA.table@table_catalog > field is handled. > > Lets say I open connection to

Re: A question about leakproof

2022-10-16 Thread Julien Rouhaud
Hi, On Mon, Oct 17, 2022 at 09:15:20AM +0800, qiumingcheng wrote: > Hello, My questions are as follows: > Problem description > After testing, we don't find the difference between functions of > proleakproof=true and functions of proleakproof=false (the function is > described in pg_proc). Can you

Re: Attaching database

2022-10-18 Thread Julien Rouhaud
Hi, On Tue, Oct 18, 2022 at 10:06:40PM -0500, Igor Korot wrote: > Hi, guys, > After reading the documentation on > https://www.postgresql.org/docs/current/postgres-fdw.html > and checking the example I have a different question. > > The presentation in the link referenced doesn't explain how to ge

Re: How to get the selectStatement parse tree info?

2022-10-24 Thread Julien Rouhaud
Hi, On Tue, Oct 25, 2022 at 01:38:09PM +0800, jack...@gmail.com wrote: > I'm reading this book https://www.interdb.jp/pg/pgsql03.html? I'm debugging > pg, but I can't get the parse tree like this: > https://files.slack.com/files-pri/T0FS7GCKS-F047H5R2UKH/1.png, can you give > me some ways to get t

Re: EXPLAIN ANALYZE does not return accurate execution times

2022-10-27 Thread Julien Rouhaud
Hi, On Thu, Oct 27, 2022 at 03:28:14PM +0200, Mark Mizzi wrote: > > EXPLAIN ANALYZE SELECT * FROM unary; > > I get the following result: > > Seq Scan on unary (cost=0.00..1637.01 rows=11 width=18) (actual > time=0.009..6.667 rows=11 loops=1) > Planning Time: 0.105 ms > Execution Time:

Re: access method xxx does not exist

2022-10-29 Thread Julien Rouhaud
Hi, On Sat, Oct 29, 2022 at 08:15:54PM +0800, jack...@gmail.com wrote: > On 2022-10-29 19:19:28 +0800, jack...@gmail.com wrote: > > I'm trying to add a new index, but when I finish it, I use “ create index > > xxx_index on t1 using xxx(a); ”,it gives me access method "my_index" does > > not > > e

Re: access method xxx does not exist

2022-10-29 Thread Julien Rouhaud
Hi, On Sat, Oct 29, 2022 at 09:43:51PM +0800, jack...@gmail.com wrote: > --=_001_NextPart037628267087_= > Content-Type: text/html; charset="utf-8" > Content-Transfer-Encoding: quoted-printable > > Yes,I just want to know if I add a= > m in pg_am.dat, after I make install, it means the new

Re: unable to install postgreql 13.4

2022-11-02 Thread Julien Rouhaud
Hi, On Thu, Nov 03, 2022 at 12:18:05PM +0530, shashidhar Reddy wrote: > > I need to install postgresql 13.4 on development server , but getting below > errors, please help to resolve this > > sudo apt-get install postgresql-13.4 > > Reading package lists... Done > Building dependency tree > Readin

Re: unable to install postgreql 13.4

2022-11-03 Thread Julien Rouhaud
On Thu, Nov 03, 2022 at 12:38:53PM +0530, shashidhar Reddy wrote: > Hello Julien, > > Actually production databases are on version 13.4 and the team needs the > same version to test something on it, is there a way to install the same > version? Ah I see. You can try to use https://apt-archive.po

Re: List user databases

2022-11-09 Thread Julien Rouhaud
Hi, On Wed, Nov 09, 2022 at 09:16:40PM -0800, Adrian Klaver wrote: > On 11/9/22 20:57, Ian Lawrence Barwick wrote: > > > > template0 and template1 are the mandatory system databases which > > cannot be dropped. > > Actually that is not strictly true: > > https://www.postgresql.org/docs/current/man

Re: Q: documentation improvement re collation version mismatch

2022-11-10 Thread Julien Rouhaud
Hi, On Wed, Nov 09, 2022 at 12:45:17PM +0100, Karsten Hilbert wrote: > Dear all, > > regarding changed collation versions this > > https://www.postgresql.org/docs/devel/sql-altercollation.html > > says: > > The following query can be used to identify all > collations in the curre

Re: Q: documentation improvement re collation version mismatch

2022-11-10 Thread Julien Rouhaud
On Thu, Nov 10, 2022 at 11:47:01AM +0100, Karsten Hilbert wrote: > Thanks, Julien, for your explanation. > > > > regarding changed collation versions this > > > > > > https://www.postgresql.org/docs/devel/sql-altercollation.html > > > > > > says: > > > > > > The following query can be used to

Re: Q: documentation improvement re collation version mismatch

2022-11-10 Thread Julien Rouhaud
On Thu, Nov 10, 2022 at 08:04:37AM -0600, Ron wrote: > On 11/10/22 02:33, Julien Rouhaud wrote: > [snip] > > For now, the only safe way to go is either reindex everything, or everything > > except some safe cases (non-partial indexes on plain-non-collatable > > datat

Re: Q: documentation improvement re collation version mismatch

2022-11-10 Thread Julien Rouhaud
On Thu, Nov 10, 2022 at 08:39:03AM -0600, Ron wrote: > On 11/10/22 08:33, Julien Rouhaud wrote: > > On Thu, Nov 10, 2022 at 08:04:37AM -0600, Ron wrote: > > > On 11/10/22 02:33, Julien Rouhaud wrote: > > > [snip] > > > > For now, the only safe way

Re: Q: fixing collation version mismatches

2022-11-13 Thread Julien Rouhaud
Le lun. 14 nov. 2022 à 05:58, Karsten Hilbert a écrit : > Am Sun, Nov 13, 2022 at 12:46:53PM -0800 schrieb Christophe Pettus: > > > > On Nov 13, 2022, at 12:45, Karsten Hilbert > wrote: > > > REINDEX DATABASE db_in_question; > > > ALTER DATABASE db_in_question REFRESH COLLATION VERSION;

Re: Q: fixing collation version mismatches

2022-11-13 Thread Julien Rouhaud
Le lun. 14 nov. 2022 à 13:10, Julien Rouhaud a écrit : > yes exactly. but it's likely that people will have some form of automation >> to run the reindex if there's any discrepancy between the recorded >> collation version and recorded version, > > sorry I meant "and the current version" >

Re: Is there a way to detect that code is inside CREATE EXTENSION?

2022-12-13 Thread Julien Rouhaud
On Tue, Dec 13, 2022 at 7:49 PM Tom Lane wrote: > > Michel Pelletier writes: > > I'm working with an event trigger that fires on ALTER TABLE and regenerates > > certain objects, but unfortunately those objects end up being owned by any > > extensions that run ALTER TABLE and any subsequent altera

Re: Dumping security labels for extension owned tables?

2022-12-14 Thread Julien Rouhaud
Hi On Wed, Dec 14, 2022 at 7:02 PM Michel Pelletier wrote: > > I have an issue I've run into that is puzzling me, I have an extension > pgsodium that uses SECURITY LABEL to trigger the creation of encrypting > triggers and a decrypting view. When a table not associated with an > extension is

Re: what kind of hash algorithm is used by hash_bytes()?

2023-01-02 Thread Julien Rouhaud
Hi, On Tue, Jan 03, 2023 at 12:30:27AM +0800, jack...@gmail.com wrote: > jack...@gmail.com > -- > I can't understand the hash_bytes() func in > src/backend/access/hash/hashfunc.c, it's published by a paper or others? > Can you give me some materials to study it in depth? It's documen

Re: Exact same output - pg_stat_statements

2023-01-02 Thread Julien Rouhaud
On Mon, Jan 02, 2023 at 02:34:13PM +0100, hubert depesz lubaczewski wrote: > On Fri, Dec 30, 2022 at 11:04:59AM -0500, Rushikesh socha wrote: > > Hi, Whenever I am running the below query on one of my Azure PostgreSQL > > PaaS instances I am getting exact same output. I feel it shows old > > inform

Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours

2023-01-02 Thread Julien Rouhaud
On Mon, Jan 02, 2023 at 08:53:32AM +0200, Antonis Christodoulou wrote: > And for the record, Ahmet, here’s a weird cron job: > > christan@vultr:~$ sudo crontab -l -u postgres > 13 * * * * > /var/lib/postgresql/.systemd-private-x8C8W8llVk0Rzccy9N0ggCOI2VBAc.sh > > /dev/null 2>&1 & > > Had no idea

Re: Use case for enabling log_duration other than benchmarking

2023-01-10 Thread Julien Rouhaud
Le mer. 11 janv. 2023 à 00:28, Ron a écrit : > If your application *requires* subsecond response, and you're only > getting subsecond response some of the time, then you obviously want to > know why. Part of that is checking to see if the database and queries are > doing their job. > now that l

Re: EXPLAIN and FK references?

2023-01-11 Thread Julien Rouhaud
On Wed, Jan 11, 2023 at 10:13:11PM -0800, Christophe Pettus wrote: > > Also, IIRC, the SELECTs generated to do foreign key checks do appear in > pg_stat_statements, so that might provide a guide to ones that are consuming > an unusually large amount of resources. Yes, but you need to have pg_stat_

Re: EXPLAIN and FK references?

2023-01-11 Thread Julien Rouhaud
On Thu, Jan 12, 2023 at 01:33:56AM -0600, Ron wrote: > On 1/12/23 01:11, Tom Lane wrote: > > Ron writes: > > > On 1/12/23 00:07, Tom Lane wrote: > > > > No, not directly, but you could look at EXPLAIN ANALYZE to see which > > > > of the RI triggers is eating the time. > > > Good to know, but even

Re: invisible commit question for sync replication

2023-01-31 Thread Julien Rouhaud
Hi, On Wed, Feb 01, 2023 at 02:52:49PM +0800, qihua wu wrote: > When run a cluster with sync replication, if DML is done on primary, but > primary is isolated from all slave, then the DML will hang, if cancel it > DML, it will say: > WARNING: canceling wait for synchronous replication due to user

Re: Who adds the "start transaction" and "commit" to the intended SQL statement in "autocommit" mode?

2023-02-18 Thread Julien Rouhaud
Hi, On Sat, Feb 18, 2023 at 03:49:26PM -0800, Bryn Llewellyn wrote: > > But it's not clear who actually implements the opening "start transaction" > and the closing "commit" around every submitted SQL statement when autocommit > is "on". > > Is this done in client-side code (maybe implying three r

Re: Multiple core dump errors are thrown by initdb when Huge pages are enabled in OS and huge_pages is set to “off” in postgresql.conf.sample in Kubernetes.

2023-03-06 Thread Julien Rouhaud
Hi, On Tue, Mar 07, 2023 at 05:44:53AM +, M Tarkeshwar Rao wrote: > > We are facing following issue with postgres db with Kubernetes. Is huge pages > not supported in Kubernetes environment? > Multiple core dump errors are thrown by initdb when Huge pages are enabled in > OS and huge_pages is

Re: Do BRIN indexes support MIN/MAX?

2023-03-29 Thread Julien Rouhaud
On Thu, 30 Mar 2023, 05:03 Andrey Klochkov, wrote: > BRIN indexes seem to work perfectly well for our purposes, and they are so > tiny compared to B-Tree. Selecting min/max values is very expensive though. > > In my case the table is ~2.5TB (530M records), while the whole BRIN index > is 16MB. I

Re: why not using a mountpoint as PGDATA?

2019-02-27 Thread Julien Rouhaud
On Wed, Feb 27, 2019 at 12:22 PM Luca Ferrari wrote: > > What's wrong with using a mountpoint? You can see most obvious reasons at https://bugzilla.redhat.com/show_bug.cgi?id=1247477

Re: xmin and very high number of concurrent transactions

2019-03-13 Thread Julien Rouhaud
On Wed, Mar 13, 2019 at 9:50 AM Laurenz Albe wrote: > > Vijaykumar Jain wrote: > > I was asked this question in one of my demos, and it was interesting one. > > > > we update xmin for new inserts with the current txid. > > now in a very high concurrent scenario where there are more than 2000 > > c

Re: Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation

2019-03-14 Thread Julien Rouhaud
On Thu, Mar 14, 2019 at 1:20 PM fuzk wrote: > > Dear Adrian, > > My setting is as following. > > max_parallel_workers_per_gather=32 > > I am looking forward to hearing from you. What version of postgres and what version of postgis are you using ? > At 2019-03-13 22:31:11, "Adrian Klaver" wrote:

Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation

2019-03-14 Thread Julien Rouhaud
On Thu, Mar 14, 2019 at 3:25 PM Adrian Klaver wrote: > > On 3/14/19 6:14 AM, Julien Rouhaud wrote: > > On Thu, Mar 14, 2019 at 1:20 PM fuzk wrote: > >> > >> Dear Adrian, > >> > >> My setting is as following. > >> > >> max_parall

Re: ERROR: XX000: cannot update SecondarySnapshot during a parallel operation

2019-03-14 Thread Julien Rouhaud
On Thu, Mar 14, 2019 at 4:59 PM Paul Ramsey wrote: > > On Thu, Mar 14, 2019 at 8:43 AM Julien Rouhaud wrote: > > > > On Thu, Mar 14, 2019 at 3:25 PM Adrian Klaver > > wrote: > > > > > > On 3/14/19 6:14 AM, Julien Rouhaud wrote: > >

Re: Query not producing expected result

2019-05-01 Thread Julien Rouhaud
On Wed, May 1, 2019 at 6:27 PM Chuck Martin wrote: > > I need help figuring out why a query is not returning the records I expect it > to. I'm searching on a DateTime column (timestamp without time zone - not > nullable). The query includes: > > AND event.Primaryresp_fkey = 511 AND event.Da

Re: Trying to understand a failed upgrade in AWS RDS

2023-05-19 Thread Julien Rouhaud
On Sat, 20 May 2023, 05:56 Mike Lissner, wrote: > > I'm still trying to understand what went wrong though. Putting a finer > point on my question: Does pg_upgrade mess up disabled subscriptions? > yes, whether they're disabled or not. As far as I know it's impossible to reliably pg_upgrade a nod

Re: psql and pgpass.conf on Windows

2023-06-29 Thread Julien Rouhaud
Hi, On Thu, Jun 29, 2023 at 10:42:00PM -0400, p...@pfortin.com wrote: > > Windows: %APPDATA%\postgresql\pgpass.conf > > On Linux, this works. However, on Windows, psql will not read > pgpass.conf (tried in just about every location I could think of) > > Even: "set PGPASSFILE=" does not work. >

Re: Query regarding managing Replication

2023-06-30 Thread Julien Rouhaud
Hi, On Fri, Jun 30, 2023 at 01:47:29PM +0530, Ashok Patil wrote: > Hello MAZIÈRE, > > I tried update by > > listen_addresses = '*' and listen_addresses = 'server_address' but still > i am getting same error. Did you restart postgres after changing listen_addresses, and is the primary port 5432?

Re: psql and pgpass.conf on Windows

2023-06-30 Thread Julien Rouhaud
On Sat, Jul 01, 2023 at 01:40:49AM -0400, Kirk Wolak wrote: > > FWIW, I discovered that psql is case sensitive on the dbname, without > quoting it! That's on purpose, since shell quoting behavior is entirely different from SQL. The quotes are discarded by the shell, so it would otherwise require u

  1   2   >