Re: (When) can a single SQL statement return multiple result sets?

2024-04-15 Thread Merlin Moncure
On Mon, Apr 15, 2024 at 10:24 AM Jan Behrens wrote: > On Wed, 10 Apr 2024 19:02:48 -0400 > Tom Lane wrote: > > > > > Here, "DELETE FROM magic" returns multiple result sets, even though it > > > is only a single SQL statement. > > > > Right, so it's kind of a case that you have to support.

Re: (When) can a single SQL statement return multiple result sets?

2024-04-10 Thread Merlin Moncure
On Wed, Apr 10, 2024 at 4:22 PM Jan Behrens wrote: > Hello, > > While writing a PostgreSQL client library for Lua supporting > Pipelining (using PQsendQueryParams), I have been wondering if there > are any single SQL commands that return multiple result sets. It is > indeed possible to create

Re: Timing out A Blocker Based on Time or Count of Waiters

2024-03-25 Thread Merlin Moncure
On Fri, Mar 22, 2024 at 11:25 AM Fred Habash wrote: > Facing an issue where sometimes humans login to a database and run DDL > statements causing a long locking tree of over 1000 waiters. As a > workaround, we asked developers to always start their DDL sessions > with 'SET lock_timeout = 'Xs'. >

Re: PostgreSQL as advanced job queuing system

2024-03-25 Thread Merlin Moncure
On Mon, Mar 25, 2024 at 4:43 AM Dominique Devienne wrote: > On Sat, Mar 23, 2024 at 3:13 AM Merlin Moncure wrote: > >> On Fri, Mar 22, 2024 at 6:58 AM ushi wrote: >> >>> the idea to implement a job queuing system using PostgreSQL. >>> >> >> I wro

Re: PostgreSQL as advanced job queuing system

2024-03-22 Thread Merlin Moncure
On Fri, Mar 22, 2024 at 6:58 AM ushi wrote: > Hello List, > > i am playing with the idea to implement a job queuing system using > PostgreSQL. To meet requirements the system needs to offer some advanced > features compared to "classic" queuing systems: > > - users can create new queues at any

Re: Clarification regarding managing advisory locks in postgresql

2024-02-08 Thread Merlin Moncure
On Thu, Jan 25, 2024 at 4:44 AM Sasmit Utkarsh wrote: > Okay Thanks. Also please help me understand the below scenarios > > From the above statement, I understand is (please correct if I'm wrong > here), When we fork a client process, each process gets its own database > connection or

Re: Moving to Postgresql database

2024-01-17 Thread Merlin Moncure
On Tue, Jan 16, 2024 at 11:05 AM Dominique Devienne wrote: > On Tue, Jan 16, 2024 at 5:07 PM Adrian Klaver > wrote: > >> On 1/16/24 00:06, Dominique Devienne wrote: >> > On Mon, Jan 15, 2024 at 5:17 AM veem v > > > wrote: >> > Is any key design/architectural

Re: Help needed for the resolution of memory leak

2024-01-17 Thread Merlin Moncure
On Wed, Jan 17, 2024 at 1:14 PM Sasmit Utkarsh wrote: > Hi Merlin et al. > > Below are some couple of observations attached as an "overview_of_code" > and other attachments "function_def_other_details" and leak sanitizer > report. Please assist with some clarifications given in overview_of_code

Re: Help needed for the resolution of memory leak

2024-01-16 Thread Merlin Moncure
On Tue, Jan 16, 2024 at 9:10 AM Sasmit Utkarsh wrote: > Hi Merlin et al. > > I have tried to have the above change added in the missing places. Still, > I see the below leaks reported by the address sanitizer. Please see > the attachments for the leak reported and the function definition

Re: Help needed for the resolution of memory leak

2024-01-15 Thread Merlin Moncure
On Mon, Jan 15, 2024 at 11:32 AM Sasmit Utkarsh wrote: > Hi Team, > > I am trying to test a code which basically tries to read some data from > postgresql db in a loop through a function SQL_get_tpf_rw() whose > definition and other details are shared in the attached file along with the > memory

Re: Help understand why DELETE is so slow

2023-12-04 Thread Merlin Moncure
On Mon, Dec 4, 2023 at 3:43 PM Ping Yao wrote: > > Hi Merlin, > > Thank you for the comment. I think we do. What I found odd here is the > Query Plan (with analyze) clearly shows the actual execution to be very > quick, that's why I don't think it's an index problem. What do you think? > I'm

Re: Help understand why DELETE is so slow

2023-12-04 Thread Merlin Moncure
On Fri, Dec 1, 2023 at 11:48 AM Ping Yao wrote: > Hello All. > > First timer here, long time user though. Thank you in advance. > > Can someone help me understand why my simple DELETE query is so slow to > run? > Not familiar with citus to diagnose any citus issues. Having said that, can you

Re: Prepared statements versus stored procedures

2023-11-20 Thread Merlin Moncure
On Mon, Nov 20, 2023 at 4:07 AM Laurenz Albe wrote: > On Sun, 2023-11-19 at 17:30 +, Simon Connah wrote: > > I was reading about prepared statements and how they allow the server to > > plan the query in advance so that if you execute that query multiple > times > > it gets sped up as the

Re: Postgres Out Of Memory Crash

2023-11-06 Thread Merlin Moncure
On Thu, Nov 2, 2023 at 4:13 AM Avi Weinberg wrote: > Hi experts, > > > > I'm using Patroni Postgres installation and noticed that twice already > postgres crashed due to out of memory. I'm using logical replication with > around 30-40 active subscribers on this machine. The machine has 128GB

Re: PgAmin view

2023-10-27 Thread Merlin Moncure
On Thu, Oct 26, 2023 at 5:56 AM Shaozhong SHI wrote: > If a PgAmin view is created and tables it queries are missing, what will > happen? > > If a PdAmin view is created, and it may take 20 hours to complete, what > will happen? > > Would views automatically run, when you start the PgAmin? >

Re: psql \r and \e -- what does clearing the query buffer actually do?

2023-10-23 Thread Merlin Moncure
On Mon, Oct 23, 2023 at 1:50 PM Tom Lane wrote: > Merlin Moncure writes: > > \r (clear 'query buffer'): Other than dutifully reporting that the query > > buffer has been cleared, I cannot for the life of me detect any > observable > > behavior. > > Uh ... sure

psql \r and \e -- what does clearing the query buffer actually do?

2023-10-23 Thread Merlin Moncure
Hello all, Couple things -- after unintentionally running a query for the (what feels like-) millionth time, it suggested a review of psql query editing behaviors. Starting with, \r (clear 'query buffer'): Other than dutifully reporting that the query buffer has been cleared, I cannot for the

Re: Inheritance in PostgreSQL

2023-10-18 Thread Merlin Moncure
On Wed, Oct 18, 2023 at 7:43 AM Thomas Kellerer wrote: > Merlin Moncure schrieb am 18.10.2023 um 03:20: > > The only thing you can't really do in SQL easily without writing > > nasty triggers are things like, 'this table must be linked from one > > and only one of these

Re: Inheritance in PostgreSQL

2023-10-17 Thread Merlin Moncure
On Tue, Oct 17, 2023 at 5:36 PM Jeff Laing wrote: > “Don’t use table inheritance” IS on that page > Yeah, inheritance probably would have been removed a long time ago except that it was underneath the partitioning feature. The basic idea of implementing polymorphic record storage essentially

Re: Ad hoc SETOF type definition?

2023-09-27 Thread Merlin Moncure
On Tue, Sep 26, 2023 at 1:15 PM Tom Lane wrote > it clear that the type exists independently of the function. (Our > behavior of automatically making composite types for tables seems to > me to have been a rather unfortunate choice.) > I really like this behavior and exploit it heavily, in

Re: Large scale reliable software system

2023-06-27 Thread Merlin Moncure
On Mon, Jun 26, 2023 at 6:49 PM B M wrote: > Dear all, > > After greeting, > > I taught PostgreSQL myself and developed a small scale experimental > software system using PostgreSQL in the back-end. > > I would like to know your advices to develop a large scale reliable > software system using

Re: Question about where to deploy the business logics for data processing

2023-06-12 Thread Merlin Moncure
On Thu, Jun 8, 2023 at 10:22 PM Nim Li wrote: > I wonder if anyone in the community has gone through changes like this? I > mean ... moving the business logics from PL/SQL within the database to the > codes in NestJS framework, and reply on only the TypeORM to manage the > update of the

Re: Composite type: Primary Key and validation

2023-06-05 Thread Merlin Moncure
On Mon, Jun 5, 2023 at 12:08 PM Laurenz Albe wrote: > On Mon, 2023-06-05 at 17:06 +0200, Lorusso Domenico wrote: > > A composite type is useful because I've to add all these information on > many tables and because > > it more easy to pass all these informations to functions that have to >

Re: CTE, lateral or jsonb_object_agg ?

2023-05-22 Thread Merlin Moncure
On Sat, May 20, 2023 at 9:43 AM Marcos Pegoraro wrote: > I have a table like pg_settings, so records have name and value. > This select is really fast, just 0.1 or 0.2 ms, but it runs millions of > times a day, so ... > > Then all the time I have to select up to 10 of these records but the >

Re: what happens if a failed transaction is not rolled back?

2023-04-24 Thread Merlin Moncure
On Mon, Apr 24, 2023 at 8:41 PM Tom Lane wrote: > Merlin Moncure writes: > > Hm. I also noticed when looking at this that aborted transactions with > > savepoints are not subjected to the idle_in_transaction timeout which is > a > > bit surprising. > > Hm

Re: what happens if a failed transaction is not rolled back?

2023-04-24 Thread Merlin Moncure
On Mon, Apr 24, 2023 at 4:20 PM Tom Lane wrote: > "David G. Johnston" writes: > > On Mon, Apr 24, 2023 at 12:56 PM David Wheeler > > wrote: > >> Now I’m curious. Does it have the same impact on performance that an > idle > >> in transaction connection has? Eg does it prevent vacuum? Does it

Re: Converting row elements into a arrays?

2023-03-03 Thread Merlin Moncure
On Thu, Mar 2, 2023 at 3:47 PM Ron wrote > I'm used to the bog standard COUNT, AVG, MIN, MAX, SUM. It didn't occur to > me that there would be others... > wait until you find out you can write your own: CREATE OR REPLACE FUNCTION agg_leftagg(l TEXT, r anyelement) returns text as $$ BEGIN

Re: Sequence vs UUID

2023-02-09 Thread Merlin Moncure
On Wed, Feb 8, 2023 at 5:33 AM Peter J. Holzer wrote: > On 2023-02-08 14:48:03 +0530, veem v wrote: > > So wanted to know from experts here, is there really exists any scenario > in > > which UUID really cant be avoided? > > Probably not. The question is usually not "is this possible" but "does

Re: Sequence vs UUID

2023-02-07 Thread Merlin Moncure
On Mon, Feb 6, 2023 at 1:22 PM Peter J. Holzer wrote: > On 2023-02-06 20:04:39 +0100, Julian Backes wrote: > > I don't really understand what you mean by 'performance'. To me it is not > > surprising that incrementing (I know it is not just incrementing) a > > 64bit integer is faster than

Re: Sequence vs UUID

2023-01-26 Thread Merlin Moncure
On Thu, Jan 26, 2023 at 1:18 PM veem v wrote: > Hello, We were trying to understand whether we should use UUID or Sequence > in general for primary keys. In many of the blogs(one is below) across > multiple databases, I saw over the internet and all are mostly stating the > sequence is better as

Re: '{"x": 42, "y": null}'::jsonb != '{"x": 42}'::jsonb ... Really?

2022-06-07 Thread Merlin Moncure
On Sat, Jun 4, 2022 at 12:37 AM Tom Lane wrote: > Bryn Llewellyn writes: > > I'm going to try to think like this: > > The number of possible spellings of the names of keys in a JSON object > is some flavor of infinite. So including this in an object: > > "k": null > > really is saying

Re: [EXT] Re: Accessing composite type elements

2022-06-02 Thread Merlin Moncure
On Thu, Jun 2, 2022 at 12:05 PM Garfield Lewis wrote: > > Binary representations are not too well documented :-(. However, > > looking at record_send() helps here. > > will have a look… > > > > Right, with the additional proviso that -1 "length" indicates a null > > field value. > > Thx, Tom…

Re: How to explicitly lock and unlock tables in pgsql?

2022-03-18 Thread Merlin Moncure
On Thu, Mar 17, 2022 at 2:52 AM Laurenz Albe wrote: > > On Wed, 2022-03-16 at 20:30 +, Shaozhong SHI wrote: > > Table locks present a barrier for progressing queries. > > > > How to explicitly lock and unlock tables in pgsql, so that we can guarantee > > the progress of running scripts? > >

Re: Couldn't cast to record[]

2022-03-04 Thread Merlin Moncure
On Thu, Mar 3, 2022 at 4:01 AM Suresh Kumar R wrote: > > Hi, I created an table with composite type array as datatype for one column. > When I query that table I need the pg_typeof(column) as record[] instead of > composite_type[]. > I tried creating a separate function and returning record[],

Re: Strange results when casting string to double

2022-02-19 Thread Merlin Moncure
On Sat, Feb 19, 2022 at 8:35 AM Tomas Pospisek wrote: > > On 18.02.22 22:42, Peter J. Holzer wrote: > > > If there has been a glibc update (or a postgresql update) in those 480 > > days (Ubuntu 14.04 is out of its normal maintenance period but ESM is > > still available) the running processes may

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-15 Thread Merlin Moncure
On Sun, Feb 13, 2022 at 4:00 AM Pavel Stehule wrote: > > > > ne 13. 2. 2022 v 10:45 odesílatel Guyren Howe napsal: >> >> >> The MySQL autocomplete is designed without context filtering. Maybe we can >> have this implementation too (as alternative) >> >> so using all column names + all table

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-10 Thread Merlin Moncure
On Thu, Feb 10, 2022 at 10:54 AM Merlin Moncure wrote: > On Wed, Feb 9, 2022 at 11:15 PM Guyren Howe wrote: > >> >> > >>- *Also nested function definitions, so top-level functions can be >> built out of local auxiliary functions.* >>- *

Re: Can we go beyond the standard to make Postgres radically better?

2022-02-10 Thread Merlin Moncure
On Wed, Feb 9, 2022 at 11:15 PM Guyren Howe wrote: > Postgres has since the outset gone beyond the SQL standard in many ways : > types, inheritance, programmability, generality are all well beyond what > SQL used to mandate and still well beyond the current standard. > > There are huge developer

Re: Can Postgres beat Oracle for regexp_count?

2022-02-03 Thread Merlin Moncure
On Wed, Feb 2, 2022 at 4:26 PM Tom Lane wrote: > > "David G. Johnston" writes: > > Given we don't have a regexp_count function this isn't surprising... > > FYI, it's there in HEAD. > > In the meantime, you could possibly do something like > > =# select count(*) from regexp_matches('My High

Re: pg_try_advisory_lock is waiting?

2022-01-31 Thread Merlin Moncure
On Fri, Jan 28, 2022 at 6:34 PM Mladen Gogala wrote: > > On 1/28/22 19:08, Tom Lane wrote: > > I doubt it. I think the FOR UPDATE in the sub-select is blocked > because the other session has an uncommitted update on the row > it wants to lock. This command won't reach the pg_try_advisory_lock >

Re: Counting the number of repeated phrases in a column

2022-01-27 Thread Merlin Moncure
On Thu, Jan 27, 2022 at 11:56 AM wrote: > Le 27/01/2022 à 18:35, Merlin Moncure a écrit : > > select distinct array_to_string(v[a:b], ' ') phrase, count(*) as occurrences > > from > > ( > >select array_agg(t) v > >from > >( > >

Re: Counting the number of repeated phrases in a column

2022-01-27 Thread Merlin Moncure
On Thu, Jan 27, 2022 at 11:09 AM Rob Sargent wrote: > > On 1/27/22 10:03, Merlin Moncure wrote: > > On Wed, Jan 26, 2022 at 5:23 PM Merlin Moncure wrote: > > with s as (select 'Hello World Hello World' as sentence) > select > phrase, > array_upper(string_to_ar

Re: Counting the number of repeated phrases in a column

2022-01-27 Thread Merlin Moncure
On Wed, Jan 26, 2022 at 5:23 PM Merlin Moncure wrote: > > with s as (select 'Hello World Hello World' as sentence) > select > phrase, > array_upper(string_to_array((select sentence from s), phrase), 1) - > 1 as occurrances > from > ( > select array_to_string

Re: Counting the number of repeated phrases in a column

2022-01-26 Thread Merlin Moncure
On Tue, Jan 25, 2022 at 11:10 AM Shaozhong SHI wrote: > > There is a short of a function in the standard Postgres to do the following: > > It is easy to count the number of occurrence of words, but it is rather > difficult to count the number of occurrence of phrases. > > For instance: > > A

Re: Can we use sql language to create a function in Postgres?

2022-01-05 Thread Merlin Moncure
On Wed, Jan 5, 2022 at 5:27 AM Shaozhong SHI wrote: > > Any online documentation or examples for using Oracle SQL in Postgres? FYI there are commercial offerings (in particular, EDB, which I am not affiliated with) that minimize compatibility concerns with oracle. If doing this by hand,

Re: The tragedy of SQL

2021-09-16 Thread Merlin Moncure
On Wed, Sep 15, 2021 at 7:31 PM FWS Neil wrote: > On Sep 15, 2021, at 2:44 PM, Merlin Moncure wrote: > > I think you ought to recognize that many people on this list make > > money directly from managing that complexity :-). > > I did not intend to disparage anyone. Peo

Re: The tragedy of SQL

2021-09-15 Thread Merlin Moncure
On Tue, Sep 14, 2021 at 3:16 PM FWS Neil wrote: > > > On Sep 14, 2021, at 11:10 AM, Michael Nolan wrote: > > > > I started programming in 1967, and over the last 50+ years I've programmed > > in more languages than I would want to list. I spent a decade writing in > > FORTRAN on a GA 18/30

Re: The tragedy of SQL

2021-09-14 Thread Merlin Moncure
On Tue, Sep 14, 2021 at 9:01 AM Rob Sargent wrote: > > ORMs a function of poor development culture and vendor advocacy, not > > the fault of SQL. If developers don't understand or are unwilling to > > use joins in language A, they won't in language B either. > > Back in the day, within IBM there

Re: The tragedy of SQL

2021-09-14 Thread Merlin Moncure
On Tue, Sep 14, 2021 at 12:32 AM Guyren Howe wrote: > If I had $5 million to invest in a startup, I would hire as many of the core > Postgres devs as I could to make a new database with all the sophistication > of Postgres but based on Datalog (or something similar). (Or maybe add > Datalog to

Re: Doubt on pgbouncer

2021-07-07 Thread Merlin Moncure
On Sat, Jul 3, 2021 at 10:36 AM Rama Krishnan wrote: > > > Hi Team, > > How can I split read and write queries using pgbouncer Check out pgbouncer-rr. I haven't used it, but it may do what you need. merlin

Re: Primary keys and composite unique keys(basic question)

2021-04-05 Thread Merlin Moncure
On Mon, Apr 5, 2021 at 9:37 PM Rob Sargent wrote: > > It's a small thing, but UUIDs are absolutely not memorizable by > humans; they have zero semantic value. Sequential numeric identifiers > are generally easier to transpose and the value gives some clues to > its age (of course, in security

Re: Primary keys and composite unique keys(basic question)

2021-04-05 Thread Merlin Moncure
On Fri, Apr 2, 2021 at 3:40 AM Laurenz Albe wrote: > > On Thu, 2021-04-01 at 21:28 -0500, Merlin Moncure wrote: > > I would never use UUIDS for keys though. > > That makes me curious for your reasons. > > I see the following disadvantages: > > - A UUID requir

Re: Primary keys and composite unique keys(basic question)

2021-04-05 Thread Merlin Moncure
On Thu, Apr 1, 2021 at 10:26 PM Rob Sargent wrote: > > On 4/1/21 8:28 PM, Merlin Moncure wrote: > > > > This is one of the great debates in computer science and it is not > > settled. There are various tradeoffs around using a composite key > > derived from

Re: Primary keys and composite unique keys(basic question)

2021-04-01 Thread Merlin Moncure
On Wed, Mar 31, 2021 at 3:36 AM Mohan Radhakrishnan wrote: > > Hello, > We have UUIDs in our tables which are primary keys. But in some > cases > we also identify a composite unique key apart from the primary key. > > My assumption is that there should be a unique key index created

Re: Binary encoding of timetz type

2021-03-22 Thread Merlin Moncure
On Tue, Mar 16, 2021 at 1:31 PM Ruslan wrote: > > Hi folks, > > Apologies if it's the wrong place to ask. I have a question for postgres > developers. > > I wrote parser for COPY binary encoding. Everything is great but one thing > worries me. It seems like the time offset field has reversed

Re: Postgres Analog of Oracle APPEND hint

2021-03-05 Thread Merlin Moncure
On Thu, Feb 25, 2021 at 10:26 AM Rumpi Gravenstein wrote: > > Unfortunately, I am not looking to load from an external source. My process > is moving data from source PostgreSQL tables to target PostgreSQL tables. INSERT INTO ...SELECT ... is one of the fastest ways possible to move data

Re: New "function tables" in V13 documentation

2020-11-09 Thread Merlin Moncure
On Sun, Nov 8, 2020 at 3:57 PM Thomas Kellerer wrote: > > In case someone is interested: there is a little discussion going on on > Reddit whether the new format of presenting functions in V13 is a step > backwards: > > >

Re: DB running out of memory issues after upgrade

2020-02-18 Thread Merlin Moncure
On Tue, Feb 18, 2020 at 12:10 PM Nagaraj Raj wrote: > > Below are the same configurations ins .conf file before and after updagrade > > show max_connections; = 1743 > show shared_buffers = "4057840kB" > show effective_cache_size = "8115688kB" > show maintenance_work_mem = "259MB" > show

Re: WaitForMultipleObjects in C Extension

2020-01-14 Thread Merlin Moncure
On Tue, Jan 14, 2020 at 1:39 AM İlyas Derse wrote: > > Hi guys I need your experiences. I made an Extension in C. When I stop the > query on PostgreSQL,I want to control my extension's result with use cases in > C.So I think , I should use WaitForMultipleObjects. Is there a like a >

Re: How to prevent POSTGRES killing linux system from accepting too much inserts?

2019-12-18 Thread Merlin Moncure
On Wed, Dec 18, 2019 at 3:53 AM James(王旭) wrote: > > Hello, >> >> I encountered into this kernel message, and I cannot login into the Linux >> system anymore: >> >> >> >>> Dec 17 23:01:50 hq-pg kernel: sh (6563): drop_caches: 1 >>> >>> Dec 17 23:02:30 hq-pg kernel: INFO: task sync:6573 blocked

Re: PostgreSQL && data types in ESQL/C

2019-11-07 Thread Merlin Moncure
On Wed, Nov 6, 2019 at 12:32 AM Matthias Apitz wrote: > Hello, > > On our project roadmap to port our LMS (Library Management System) from > Sybase/Oracle to PostgreSQL we are now in the phase of addressing the > ESQL/C and C++ code parts (some million lines of code). > > I wrote a small ESQL/C

Re: question about array indexing

2019-11-04 Thread Merlin Moncure
On Mon, Nov 4, 2019 at 10:05 AM Szymon Lipiński wrote: > > Hey, > I'm wondering if this isn't a bug somewhere in the parser. I had to add > additional parenthesis around the regexp_split_to_array. > > > $ with x as (select 'a b c' a) > select > regexp_split_to_array(a, ' ') > from x; > >

Re: Automatically parsing in-line composite types

2019-10-31 Thread Merlin Moncure
On Wed, Oct 30, 2019 at 5:41 PM Andres Freund wrote: > > Hi, > > On 2019-10-29 14:33:00 -0400, Tom Lane wrote: > > Mitar writes: > > > I think RowDescription should be extended to provide full recursive > > > metadata about all data types. That would be the best way to do it. > > > > [ shrug...

Re: Automatically parsing in-line composite types

2019-10-30 Thread Merlin Moncure
On Wed, Oct 30, 2019 at 11:15 AM Mitar wrote: > > Hi! > > On Wed, Oct 30, 2019 at 8:37 AM Merlin Moncure wrote: > > Check out libpqtypes: https://github.com/pgagarinov/libpqtypes > > Interesting. I have looked at the code a bit but I do not find how it > determines t

Re: Automatically parsing in-line composite types

2019-10-30 Thread Merlin Moncure
On Tue, Oct 29, 2019 at 12:58 PM Mitar wrote: > > Hi! > > On Tue, Oct 29, 2019 at 9:06 AM Fabio Ugo Venchiarutti > wrote: > > You can use subqueries and array_agg() to deepen your output tree all > > the way to a stack overflow, a single _to_json() call at the > > top will recursively traverse

Re: perf tuning for 28 cores and 252GB RAM

2019-06-18 Thread Merlin Moncure
On Mon, Jun 17, 2019 at 6:46 PM Jeff Janes wrote: > > On Mon, Jun 17, 2019 at 4:51 PM Michael Curry wrote: >> >> I am using a Postgres instance in an HPC cluster, where they have generously >> given me an entire node. This means I have 28 cores and 252GB RAM. I have to >> assume that the very

Re: Where **not** to use PostgreSQL?

2019-03-01 Thread Merlin Moncure
On Thu, Feb 28, 2019 at 6:24 AM Chris Travers wrote: > > On Thu, Feb 28, 2019 at 1:09 PM Pavel Stehule wrote: >> >> Hi >> >> čt 28. 2. 2019 v 12:47 odesílatel Thomas Güttler >> napsal: >>> >>> Hi experts, >>> >>> where would you suggest someone to **not** use PostgreSQL? > > > Hard question.

Re: libpq PQexecParams & value placeholders

2018-12-20 Thread Merlin Moncure
On Fri, Dec 14, 2018 at 6:09 AM Oleg wrote: > > On Fri, Dec 14, 2018 at 02:47:12PM +0300, Dmitry Igrishin wrote: > > пт, 14 дек. 2018 г. в 14:33, Oleg : > > > > > > Hi, all. > > > > > > Do we really need a numeric value placeholders like $1 in command string? > > It's a syntax defined at the

Re: plpgsql and intarray extension; int[] - int[] operator does not exist ?

2018-11-19 Thread Merlin Moncure
On Mon, Nov 19, 2018 at 4:36 PM Tom Lane wrote: > > Merlin Moncure writes: > > On Mon, Nov 19, 2018 at 11:56 AM Tom Lane wrote: > >> The search_path in the trigger probably doesn't include public. > >> You could add a "SET search_path = whatever" clause

Re: plpgsql and intarray extension; int[] - int[] operator does not exist ?

2018-11-19 Thread Merlin Moncure
On Mon, Nov 19, 2018 at 11:56 AM Tom Lane wrote: > > "Day, David" writes: > > Any suggestions as to why the int[] operations are not understood in the > > trigger context.? > > The search_path in the trigger probably doesn't include public. > You could add a "SET search_path = whatever" clause

Re: Postgres 11 procedures and result sets

2018-10-02 Thread Merlin Moncure
On Mon, Oct 1, 2018 at 6:57 PM Tom Lane wrote: > Jan Kohnert writes: > > I have a question regarding the new stored procedures in Postgres 11 (I > > tested > > beta4): > > I'd like to know if it is somehow possible to get a (or possibly more) > > result > > set from selects within the SP, as

Re: Logical locking beyond pg_advisory

2018-09-17 Thread Merlin Moncure
On Sun, Sep 16, 2018 at 3:53 PM marcelo wrote: > > I need a mechanism of "logical locking" more ductile than the pg_advisory > family. > I'm thinking of a table ("lock_table") that would be part of the database, > with columns > * tablename varchar - name of the table "locked" > * rowid

Re: JSONB filed with default JSON from a file

2018-08-13 Thread Merlin Moncure
On Mon, Aug 13, 2018 at 12:56 PM mrcasa bengaluru wrote: >> >> I assume that you could declare the column as >> >> address jsonb not null default 'your json here'::jsonb; > > > Thanks! However, this involves writing the entire JSON in the schema file > looks inconvenient. I was hoping I would be

Re: check_function_bodies not doing much

2018-08-07 Thread Merlin Moncure
On Tue, Aug 7, 2018 at 2:31 PM Tom Lane wrote: > > Marcelo Lacerda writes: > > I was trying to get postgres to warn me that I'm referencing a table that > > it doesn't exists inside a function so I was told on the IRC to check the > > setting "check_function_bodies", however when I use it in a

Re: Multiple PostgreSQL instances on one machine

2018-06-11 Thread Merlin Moncure
On Fri, Jun 8, 2018 at 3:29 PM Tony Sullivan wrote: > > I am trying to consolidate some machines in my server room particularly in > the testing environment and I was hoping someone could point me in the > right direction. > > I currently have three machines running PostgreSQL for testing

Re: Locks analysis after-the-fact

2018-05-01 Thread Merlin Moncure
On Fri, Apr 27, 2018 at 2:55 AM, Olivier Macchioni wrote: > Hello all, > > PostgreSQL version 9.4.17 > > We have a number of queries running on the same DB from many systems. Among > other things, we need to INSERT / UPDATE on a table based on external events > -

Re: Rationale for aversion to the central database?

2018-04-27 Thread Merlin Moncure
On Sun, Apr 8, 2018 at 4:39 PM, Guyren Howe wrote: > I am a Rails developer at a medium-large size company. I’ve mostly worked at > smaller companies. I’ve some exposure to other web development communities. > > When it comes to databases, I have universally encountered the

Re: Asynchronous Trigger?

2018-04-27 Thread Merlin Moncure
On Thu, Mar 29, 2018 at 5:29 PM, Cory Tucker wrote: > Is it possible to have the execution of a trigger (or any function) not > block the completion of the statement they are associated with? > > A pattern I had hoped to implement was to do a quick update of rows that >

Re: is pg_advisory_lock() suitable for long runs

2018-04-03 Thread Merlin Moncure
On Sat, Mar 31, 2018 at 1:49 PM, Radoslav Nedyalkov wrote: > Hi all, > it's very simple and intuitive case but let me describe first. > 1. session 1 calls pg_advisory_lock(1234) and succeeds. > 2. session 2 calls pg_advisory_lock(1234) and stops on waiting. > All fine BUT

Re: PGSQL 10, many Random named DB

2018-01-25 Thread Merlin Moncure
On Thu, Jan 25, 2018 at 3:38 AM, Durumdara wrote: > Dear Members! > > Thank you for the suggestions. > Yes, the sysadmin allowed incoming connections from net. > We will check your list when we are there. Don't bother. We have a confirmed attack, time to take immediate

Re: why SSD is slower than HDD SAS 15K ?

2018-01-15 Thread Merlin Moncure
On Mon, Jan 15, 2018 at 7:38 AM, Neto pr wrote: > Hello all, > Someone help me analyze the two execution plans below (Explain ANALYZE > used), is the query 9 of TPC-H benchmark [1]. > I'm using two servers HP Intel Xeon 2.8GHz/4-core - Memory 8GB. O.S. > Debian8, using EXT4

Re: Segmentation fault with core dump

2018-01-10 Thread Merlin Moncure
On Wed, Jan 10, 2018 at 11:08 AM, Tom Lane wrote: > Glauco Torres writes: >> (gdb) bt >> #0 ckpt_buforder_comparator (pa=pa@entry=0x7f6fa9ef4b2c, >> pb=pb@entry=0x1be06d2d06644) >> at bufmgr.c:4137 >> #1 0x00801268 in med3 (a=0x7f6fa9ef4b2c

Re: help with generation_series in pg10

2018-01-10 Thread Merlin Moncure
On Mon, Jan 8, 2018 at 11:19 PM, Adrian Klaver wrote: > On 01/08/2018 05:25 PM, Márcio A. Sepp wrote: >> >> >> Hi, >> >> >> In pg10 generation series doesn't work like in 9.5. >> Ex. in 9.5: >> z=# select generate_series(1, 10), generate_series(1, 5); >>