Re: Need some assistance on stored procedures execution using libpq in C

2024-04-25 Thread Pavel Stehule
rvers). You can check code there https://github.com/postgres/postgres/blob/master/contrib/dblink/dblink.c Regards Pavel > > > Regards, > Sasmit Utkarsh > +91-7674022625 > > > On Thu, Apr 25, 2024 at 8:26 PM Pavel Stehule > wrote: > >> Hi >> >> čt 25.

Re: Need some assistance on stored procedures execution using libpq in C

2024-04-25 Thread Pavel Stehule
Hi čt 25. 4. 2024 v 12:57 odesílatel Sasmit Utkarsh napsal: > Hi PostgreSQL Team, > > I'm trying to execute the stored procedure(details along with the program > in the attachment) to fetch the records from the table for the inputs given > in the code as well. I have already created the

Re: PL/pgSQL techniques better than bash for dynamic DO?

2024-04-09 Thread Pavel Stehule
út 9. 4. 2024 v 18:33 odesílatel Ron Johnson napsal: > PG 9.6.11, if relevant, migrating to PG 14 Real Soon Now. > > I must purge the oldest X period of records from 70 tables, every Sunday. > The field name, interval (X days or months) and date (CURRENT_DATE or > CURRENT_TIMESTAMP) varies for

Re: Pgxs - How to reference another extension

2024-03-11 Thread Pavel Stehule
Hi po 11. 3. 2024 v 14:48 odesílatel Michał Kłeczek napsal: > > > On 11 Mar 2024, at 14:08, Artur Zakirov wrote: > > On Mon, 11 Mar 2024 at 13:26, Michał Kłeczek wrote: > > > > On 11 Mar 2024, at 11:41, Michał Kłeczek wrote: > > Hi, > > I am trying to create an extension that delegates some

Re: pl/pgsql outside the DB, (i.e. on the terminal) possible ?

2024-03-07 Thread Pavel Stehule
čt 7. 3. 2024 v 16:59 odesílatel Christophe Pettus napsal: > > > > On Mar 7, 2024, at 06:56, Achilleas Mantzios - cloud < > a.mantz...@cloud.gatewaynet.com> wrote: > > So, I ask, have there been any efforts to bring PL/PGSQL to the terminal? > > Strictly speaking, of course, you can use PL/pgSQL

Re: Fastest way to clone schema ~1000x

2024-02-25 Thread Pavel Stehule
aring schema-per-test vs database-per-test: > https://ibb.co/CW5w2MW > > - Emiel > > > On Mon, Feb 26, 2024 at 1:36 PM Pavel Stehule > wrote: > >> Hi >> >> po 26. 2. 2024 v 7:28 odesílatel Emiel Mols napsal: >> >>> Hello, >>> >>>

Re: Fastest way to clone schema ~1000x

2024-02-25 Thread Pavel Stehule
Hi po 26. 2. 2024 v 7:28 odesílatel Emiel Mols napsal: > Hello, > > To improve our unit and end-to-end testing performance, we are looking to > optimize initialization of around 500-1000 database *schemas* from a > schema.sql file. > > Background: in postgres, you cannot change databases on >

Re: Nested-Internal Functions

2024-01-18 Thread Pavel Stehule
Hi čt 18. 1. 2024 v 13:31 odesílatel Rossana Ocampos napsal: > Effectively I had to create the function externally, I am in the process > of migrating from Oracle to Postgresql and I have many cases of > encapsulated functions and transactions. > Thank you very much for the return. > Rossana

Re: Add support for data change delta tables

2024-01-15 Thread Pavel Stehule
po 15. 1. 2024 v 11:27 odesílatel PavelTurk napsal: > > On 1/15/24 12:17 PM, Pavel Stehule wrote: > > > > po 15. 1. 2024 v 11:11 odesílatel PavelTurk > napsal: > >> >> On 1/15/24 12:05 PM, Pavel Stehule wrote: >> >> Hi >> >> po 15. 1

Re: Add support for data change delta tables

2024-01-15 Thread Pavel Stehule
po 15. 1. 2024 v 11:11 odesílatel PavelTurk napsal: > > On 1/15/24 12:05 PM, Pavel Stehule wrote: > > Hi > > po 15. 1. 2024 v 11:00 odesílatel PavelTurk > napsal: > >> Hello all, >> >> >> Currently PostgreSQL doesn't support data change d

Re: Add support for data change delta tables

2024-01-15 Thread Pavel Stehule
Hi po 15. 1. 2024 v 11:00 odesílatel PavelTurk napsal: > Hello all, > > > Currently PostgreSQL doesn't support data change delta tables. For example, > it doesn't support this type of query: > > SELECT * FROM NEW TABLE ( > INSERT INTO phone_book > VALUES ( 'Peter Doe', '555-2323' ) >

Re: Emitting JSON to file using COPY TO

2023-11-27 Thread Pavel Stehule
Hi po 27. 11. 2023 v 14:27 odesílatel David G. Johnston < david.g.johns...@gmail.com> napsal: > On Monday, November 27, 2023, Dominique Devienne > wrote: > >> There's even a JSON mode. >> By miracle, would the JSON output mode recognize JSON[B] values, and >> avoid the escaping? >> > > I agree

Re: Accessing system information functions

2023-09-25 Thread Pavel Stehule
Hi po 25. 9. 2023 v 19:51 odesílatel Rob Sargent napsal: > > > On Sep 25, 2023, at 5:05 AM, Johnson, Bruce E - (bjohnson) < > john...@pharmacy.arizona.edu> wrote: > >  Environment: Ubuntu 22.04 lts, postgres 15 installed via postgres.org > repository > > > I am attempting to use the system

Re: The same prepared query yield "-1" the first six times and then "-1.0"

2023-08-21 Thread Pavel Stehule
po 21. 8. 2023 v 19:52 odesílatel Edoardo Panfili < edoardo.panf...@iisgubbio.edu.it> napsal: > > > > Il giorno 21 ago 2023, alle ore 18:45, Tom Lane ha > scritto: > > > > "David G. Johnston" writes: > >> Otherwise, I agree this seems like a bug, probably in the JDBC driver, > >> though one

Re: Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-17 Thread Pavel Stehule
Hi čt 17. 8. 2023 v 16:48 odesílatel Karsten Hilbert napsal: > > Even I used postgreSQL Large Objects by referring this link to store and > retrieve large files (As bytea not working) > https://www.postgresql.org/docs/current/largeobjects.html > > But even now I am unable to fetch the data at

Re: PostgreSQL and GUI management

2023-08-15 Thread Pavel Stehule
út 15. 8. 2023 v 20:38 odesílatel Adrian Klaver napsal: > On 8/15/23 08:08, Jason Long wrote: > > Hello, > > Does PostgreSQL have a graphical environment for management or is it > > only managed through CLI? > > There are, but make your life easier and learn to use psql: > >

Re: PostgreSQL and GUI management

2023-08-15 Thread Pavel Stehule
út 15. 8. 2023 v 17:16 odesílatel Pavel Stehule napsal: > Hi > > út 15. 8. 2023 v 17:09 odesílatel Jason Long napsal: > >> Hello, >> Does PostgreSQL have a graphical environment for management or is it only >> managed through CLI? >> &

Re: PostgreSQL and GUI management

2023-08-15 Thread Pavel Stehule
Hi út 15. 8. 2023 v 17:09 odesílatel Jason Long napsal: > Hello, > Does PostgreSQL have a graphical environment for management or is it only > managed through CLI? > https://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools Regards Pavel > > Thank you. >

Re: Using "exit" to bring "goto" functionality.

2023-07-10 Thread Pavel Stehule
Hi > As it happens, Oracle's PL/SQL has a "goto" statement. But PL/pgSQL does > not. (I assume that this is because "goto" is considered a bad thing.) But > PL/SQL programmers do use it. However, the doc section: > The reason why PL/pgSQL has not "goto" statement is mainly technological.

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Pavel Stehule
FUNCTION oracle.to_char(text) > RETURNS text AS $$ > SELECT $1 > $$ LANGUAGE sql IMMUTABLE STRICT; > > This version will be preferred and fix this issue. On second thought, the > behavior can be a little bit different than before. > > I have a question. Why do you use the t

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Pavel Stehule
čt 6. 7. 2023 v 16:16 odesílatel gzh napsal: > Thank you very much for taking the time to reply to my question. > I added oracle to search_path, but it didn't work. > > postgres=# show search_path; > search_path > - > "$user", public, oracle,

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Pavel Stehule
ssue. On second thought, the behavior can be a little bit different than before. I have a question. Why do you use the to_char(string) function? Instead to_char('text') you can write only 'text'. > > > At 2023-07-06 19:21:24, "Pavel Stehule" wrote: > > Hi > > čt 6. 7

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Pavel Stehule
Hi čt 6. 7. 2023 v 11:19 odesílatel gzh napsal: > Hi, > > > I upgraded the version of PostgreSQL from 12.6 to 12.13, > > when I execute the sql below , the to_char function caused the following > error. > > > ---SQL-- > > select TO_CHAR('100'); > > > ERROR:

Re: How to show current schema of running queries in postgresql 13

2023-06-26 Thread Pavel Stehule
> 回复的原邮件 ---- > 发件人 Pavel Stehule > 日期 2023年06月26日 17:51 > 收件人 陈锡汉 > 抄送至 pgsql-general@lists.postgresql.org > 主题 Re: How to show current schema of running queries in postgresql 13 > > > po 26. 6. 2023 v 9:19 odesílatel Pavel Stehule > napsal: > >> H

Re: How to show current schema of running queries in postgresql 13

2023-06-26 Thread Pavel Stehule
po 26. 6. 2023 v 9:19 odesílatel Pavel Stehule napsal: > Hi > > > > no, there is nothing for this purpose. > > you can use application_name > > so user can do > > SET search_path=MySchema; > SET application_name = 'MySchema'; > SELECT * FROM ... &

Re: How to show current schema of running queries in postgresql 13

2023-06-26 Thread Pavel Stehule
Hi po 26. 6. 2023 v 8:39 odesílatel 陈锡汉 napsal: > Hello,I use multi-schemas in one database in Postgres,such as > > ``` > Postgres(instance) > MyDB >public >MySchema1 > table1 > table2 >MySchema2 > table1 > table2 >MySchema3 > table1 > table2 > ```

Re: 2 master 3 standby replication

2023-06-23 Thread Pavel Stehule
Hi pá 23. 6. 2023 v 10:37 odesílatel Atul Kumar napsal: > Hi, > > Please help me with the query I raised. > > Currently there is not any community based multi master solution. Regards Pavel Stehule > > Regards. > > On Fri, 23 Jun 2023, 00:12 Atul Kumar, wrote: &g

Re: Profiling a function call

2023-05-21 Thread Pavel Stehule
ne 21. 5. 2023 v 13:30 odesílatel Jan Wieck napsal: > On 5/20/23 00:36, Tiffany Thang wrote: > > Hi, > > I have a function that has been executing for a long time and not > > returning any results. Wait event=NULL so it seems like it is still > > executing and not waiting on any specific

Re: Records, Types, and Arrays

2023-05-19 Thread Pavel Stehule
Hi pá 19. 5. 2023 v 8:59 odesílatel Raymond Brinzer napsal: > Sorry, I should have noted this as well: > > "One should also realize that when a PL/pgSQL function is declared to > return type record, this is not quite the same concept as a record > variable, even though such a function might use

Re: Packed raster data in postgresql?

2023-05-16 Thread Pavel Stehule
Hi út 16. 5. 2023 v 19:09 odesílatel Ron napsal: > On 5/16/23 10:03, Elstermann, Mike wrote: > > Hello all, > > > > is it possible to store also packed raster data (e.g. jpg, lzw tiff, ...) > in PostgreSQL? > > > You can store any binary data you want in columns of type "bytea". > or you can

Re: function signature allow "default" keyword

2023-05-15 Thread Pavel Stehule
Hi út 16. 5. 2023 v 5:11 odesílatel jian he napsal: > > > On Mon, May 15, 2023 at 5:00 PM Thomas Kellerer wrote: > >> jian he schrieb am 15.05.2023 um 10:33: >> > >> > function idea. >> > allow function calling using the default keyword for any of the input >> arguments. >> > >> > example:

Re: Call a Normal function inside a Trigger Function

2023-04-16 Thread Pavel Stehule
Hi ne 16. 4. 2023 v 20:47 odesílatel FOUTE K. Jaurès napsal: > Can I have an example please? Or a link > > On Sun, 16 Apr 2023, 17:08 Pavel Stehule, wrote: > >> Hi >> >> >> ne 16. 4. 2023 v 16:15 odesílatel FOUTE K. Jaurès >> napsal: >> >

Re: Call a Normal function inside a Trigger Function

2023-04-16 Thread Pavel Stehule
Hi ne 16. 4. 2023 v 16:15 odesílatel FOUTE K. Jaurès napsal: > Hello, > > Is it possible to call a function inside a trigger function ? > Any idea or link are welcome. Thanks in advance > sure, there is not any limit. Regards Pavel > > Best Regards > -- > Jaurès FOUTE >

Re: TEXT column > 1Gb

2023-04-11 Thread Pavel Stehule
Hi út 11. 4. 2023 v 19:42 odesílatel Joe Carlson napsal: > Hello, > > I’ve recently encountered the issue of trying to insert more than 1 Gb > into a TEXT column. While the docs say TEXT is unlimited length, I had been > unaware of the 1Gb buffer size limitations. > I think so this is some

Re: Schemas and Search Path

2023-03-20 Thread Pavel Stehule
Hi po 20. 3. 2023 v 17:08 odesílatel DAVID ROTH napsal: > Is there any practical limit on the number of schemas in a database? > Will the number of schemas in a user's search path impact performance? > Sure, it should have an impact. When you use an unqualified identifier, then the identifier

Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?

2023-03-16 Thread Pavel Stehule
čt 16. 3. 2023 v 11:52 odesílatel Dominique Devienne napsal: > On Thu, Mar 16, 2023 at 11:15 AM Pavel Stehule > wrote: > >> čt 16. 3. 2023 v 9:55 odesílatel Dominique Devienne >> napsal: >> >>> On Thu, Mar 16, 2023 at 9:23 AM Pavel Stehule >>> wro

Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?

2023-03-16 Thread Pavel Stehule
čt 16. 3. 2023 v 9:55 odesílatel Dominique Devienne napsal: > On Thu, Mar 16, 2023 at 9:23 AM Pavel Stehule > wrote: > >> čt 16. 3. 2023 v 9:18 odesílatel Dominique Devienne >> napsal: >> >>> [...] depends on what you value in a particular situat

Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?

2023-03-16 Thread Pavel Stehule
čt 16. 3. 2023 v 9:18 odesílatel Dominique Devienne napsal: > On Thu, Mar 16, 2023 at 6:48 AM Laurenz Albe > wrote: > >> As we wrote, some of us think that cursors are useful, and we tried to >> explain why we think that. If you don't think that cursors are useful, >> don't use them. We are

Re: Behavior of PL/pgSQL function following drop and re-create of a table that it uses

2023-03-08 Thread Pavel Stehule
st 8. 3. 2023 v 22:29 odesílatel Bryn Llewellyn napsal: > t...@sss.pgh.pa.us wrote: > > david.g.johns...@gmail.com wrote: > > So I found where this difference in behavior is at least explicitly noted: > > /* > * If it's a named composite type (or domain over one), find the typcache > * entry and

Re: Converting row elements into a arrays?

2023-03-03 Thread Pavel Stehule
pá 3. 3. 2023 v 21:51 odesílatel Merlin Moncure napsal: > 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

Re: A performance issue in ROW_NUMBER() OVER(ORDER BY NULL) [27 times slow than OVER()] V14.5

2023-02-19 Thread Pavel Stehule
po 20. 2. 2023 v 0:26 odesílatel David Rowley napsal: > On Mon, 20 Feb 2023 at 10:18, Tom Lane wrote: > > I don't see it at all. Comparing your two test queries on released > > branches, I see maybe 2x penalty for the ORDER BY NULL, not 30x. > > (In HEAD there's only about 13% penalty.) I

Re: Order of rows in simple "select r from table_fn()"

2023-02-14 Thread Pavel Stehule
Hi > It adds an uncomfortable amount of clutter. > > ** Is it essential for correctness? ** > > It's annoying that the use of "return next" prevents the pattern that each > "print line" follows from being encapsulated into a procedure. But it is > what it is, yes? > RETURN NEXT, RETURN QUERY

Re: Language options for GIN index support functions

2023-02-06 Thread Pavel Stehule
Hi út 7. 2. 2023 v 3:49 odesílatel Phillip Diffley napsal: > Hello, > > The support functions and operator methods needed to extend a GIN index > are documented in C syntax > . Do > these functions need to be implemented in C, or

Re: plpgsql: ambiguous column reference in ON CONFLICT clause

2023-02-06 Thread Pavel Stehule
po 6. 2. 2023 v 19:02 odesílatel David G. Johnston < david.g.johns...@gmail.com> napsal: > On Monday, February 6, 2023, Torsten Förtsch > wrote: > >> >> After reading this I am wondering if the current behavior is actually a >> bug. >> > > Arguably it is a bug, and a known one at that if you

Re: No function matches the given name and argument types.

2023-01-16 Thread Pavel Stehule
Hi po 16. 1. 2023 v 18:42 odesílatel arons napsal: > Why the error happen is clear to me, in the example is also easy to see > that the 7th parameter is the problem. > But I'm searching a more general way to find easily which of the parameter > is the problem. > Suppose you have a function with

Re: Intervals and ISO 8601 duration

2023-01-13 Thread Pavel Stehule
so 14. 1. 2023 v 6:32 odesílatel Peter J. Holzer napsal: > On 2023-01-13 17:07:17 -0700, Martin L. Buchanan wrote: > > Just tried casting interval to bytea to see the binary layout, but that > direct > > cast is not allowed. > > A cast generally doesn't just reinterpret the same bit pattern as a

Re: gexec from command prompt?

2023-01-12 Thread Pavel Stehule
čt 12. 1. 2023 v 18:25 odesílatel Ron napsal: > Postgresql 12.11 > > This might be more of a bash question, or it might be a psql vs engine > problem. > > I want to run this query using psql from a bash prompt: > select format('SELECT ''%s'', MIN(part_date) FROM %s;', table_name, > table_name) >

Re: Changing displayed time zone in RAISE NOTICE output?

2023-01-12 Thread Pavel Stehule
čt 12. 1. 2023 v 17:27 odesílatel Adrian Klaver napsal: > On 1/12/23 08:22, Pavel Stehule wrote: > > > > > > čt 12. 1. 2023 v 16:39 odesílatel Adrian Klaver > > mailto:adrian.kla...@aklaver.com>> napsal: > > > > On 1/11/23 21:25, Ron wrote: >

Re: Changing displayed time zone in RAISE NOTICE output?

2023-01-12 Thread Pavel Stehule
čt 12. 1. 2023 v 16:39 odesílatel Adrian Klaver napsal: > On 1/11/23 21:25, Ron wrote: > > On 1/11/23 15:06, Adrian Klaver wrote: > > > > > Hmm. I'd have sworn this didn't work when I tried it: > > Did you do?: > > DO $$ > BEGIN > RAISE NOTICE '%', clock_timestamp() at timezone 'UTC'; > END$$;

Re: plpgsql_check_function issue after upgrade

2022-12-06 Thread Pavel Stehule
Hi for record - the problem was probably in using plpgsql_check together with PL debugger (plugin_debugger). Both extensions use the PLpgSQL DBG API, but this API is not designed to be used by more extensions. plpgsql_check has implemented some workaround, but it should be loaded last if this

Re: plpgsql_check_function issue after upgrade

2022-12-05 Thread Pavel Stehule
ut? > > On Mon, 5 Dec, 2022, 5:51 pm Pavel Stehule, > wrote: > >> >> >> út 29. 11. 2022 v 17:28 odesílatel Pavel Stehule >> napsal: >> >>> >>> >>> út 29. 11. 2022 v 16:37 odesílatel shashidhar Reddy < >>> shashi

Re: plpgsql_check_function issue after upgrade

2022-12-05 Thread Pavel Stehule
út 29. 11. 2022 v 17:28 odesílatel Pavel Stehule napsal: > > > út 29. 11. 2022 v 16:37 odesílatel shashidhar Reddy < > shashidharreddy...@gmail.com> napsal: > >> Plogsql check version is 2.2 and one more finding is before calling the >> function if we dr

Re: plpgsql_check_function issue after upgrade

2022-12-05 Thread Pavel Stehule
Regards Pavel > > On Mon, 5 Dec, 2022, 1:36 pm Pavel Stehule, > wrote: > >> >> >> po 5. 12. 2022 v 8:42 odesílatel shashidhar Reddy < >> shashidharreddy...@gmail.com> napsal: >> >>> Pavel, >>> >>> Below is the

Re: plpgsql_check_function issue after upgrade

2022-12-05 Thread Pavel Stehule
-dbg > I am sorry, I don't anything > > On Mon, Dec 5, 2022 at 11:28 AM Pavel Stehule > wrote: > >> Hi >> >> >> po 5. 12. 2022 v 6:49 odesílatel shashidhar Reddy < >> shashidharreddy...@gmail.com> napsal: >> >>> Pavel, >>>

Re: plpgsql_check_function issue after upgrade

2022-12-04 Thread Pavel Stehule
ogramCrash please, don't use top-post style in this mailing list https://en.wikipedia.org/wiki/Posting_style Regards Pavel > On Wed, Nov 30, 2022 at 10:04 AM Pavel Stehule > wrote: > >> >> >> st 30. 11. 2022 v 5:28 odesílatel Pavel Stehule >> napsal: >>

Re: plpgsql_check_function issue after upgrade

2022-11-29 Thread Pavel Stehule
st 30. 11. 2022 v 5:28 odesílatel Pavel Stehule napsal: > > > st 30. 11. 2022 v 1:38 odesílatel shashidhar Reddy < > shashidharreddy...@gmail.com> napsal: > >> I have tried updating after upgrade but that wasn't working, so I have >> dropped and recreated the

Re: plpgsql_check_function issue after upgrade

2022-11-29 Thread Pavel Stehule
what is version od plpgsql_check on Postgres 12, what is version of plpgsql_check on Postgres 13 (with version of minor release)? Can you send backtrace? https://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Linux/BSD > > On Tue, 29 Nov, 2022, 9:58 pm

Re: plpgsql_check_function issue after upgrade

2022-11-29 Thread Pavel Stehule
om> wrote: > >> Hello Pavel, >> >> This is the function causing the issue on all servers, and also i noticed >> when I use *plpgsql_check_function *in any function I am facing the same >> issue. >> >> >> On Tue, Nov 29, 2022 at 6:43 PM Pavel Stehule &g

Re: plpgsql_check_function issue after upgrade

2022-11-29 Thread Pavel Stehule
Hi út 29. 11. 2022 v 13:49 odesílatel shashidhar Reddy < shashidharreddy...@gmail.com> napsal: > Hello, > > Recently we have upgraded postgres from version 12 to 13 and upgraded > plpgsql_check > to the latest version but after upgrade when calling the below function > causing postgres

Re: unrecognized node type: 350

2022-11-17 Thread Pavel Stehule
t - it does not sense on the production server. > On Thu, 17 Nov, 2022, 7:28 pm Pavel Stehule, > wrote: > >> >> >> čt 17. 11. 2022 v 13:32 odesílatel shashidhar Reddy < >> shashidharreddy...@gmail.com> napsal: >> >>> If I remove plpgsql_chec

Re: unrecognized node type: 350

2022-11-17 Thread Pavel Stehule
by DROP EXTENSION plpgsql_check (only this way). plpgsql_check is just language checker. Why it is called by your application? > ^ > > On Thu, Nov 17, 2022 at 11:52 AM shashidhar Reddy < > shashidharreddy...@gmail.com> wrote: > >

Re: unrecognized node type: 350

2022-11-16 Thread Pavel Stehule
Thu, 17 Nov, 2022, 10:55 am Pavel Stehule, > wrote: > >> >> >> čt 17. 11. 2022 v 6:18 odesílatel shashidhar Reddy < >> shashidharreddy...@gmail.com> napsal: >> >>> Pavel, >>> >>> Plpgsql_check configured under postures 13 lib. >>

Re: unrecognized node type: 350

2022-11-16 Thread Pavel Stehule
What is result of "show plpgsql_check.mode" ? > On Thu, 17 Nov, 2022, 8:44 am Pavel Stehule, > wrote: > >> >> >> st 16. 11. 2022 v 19:52 odesílatel Tom Lane napsal: >> >>> Pavel Stehule writes: >>> > st 16. 11. 2022 v 19:01 odesí

Re: unrecognized node type: 350

2022-11-16 Thread Pavel Stehule
st 16. 11. 2022 v 19:52 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > st 16. 11. 2022 v 19:01 odesílatel shashidhar Reddy < > > shashidharreddy...@gmail.com> napsal: > >>> I could see an error in syslogs, I am not sure what it means. > >&

Re: unrecognized node type: 350

2022-11-16 Thread Pavel Stehule
Hi st 16. 11. 2022 v 19:01 odesílatel shashidhar Reddy < shashidharreddy...@gmail.com> napsal: > Extension version is 2.2. Is anything need to be done? To fix this issue? > > On Wed, 16 Nov, 2022, 10:06 pm Tom Lane, wrote: > >> shashidhar Reddy writes: >> > I could see an error in syslogs, I

Re: programmatically retrieve details of a custom Postgres type

2022-11-10 Thread Pavel Stehule
pá 11. 11. 2022 v 5:02 odesílatel Konstantin Izmailov napsal: > Hello, > I was unable to find how to get column names, sizes and types for a given > composite type. > > Example. For a type defines as: > CREATE TYPE inventory_item AS ( > name text, > supplier_id integer, > price numeric >

Re: how to install plprofiler

2022-10-29 Thread Pavel Stehule
so 29. 10. 2022 v 9:25 odesílatel shashidhar Reddy < shashidharreddy...@gmail.com> napsal: > Pavel, > > After Uninstall plprofiler where can find this to install again. > https://github.com/bigsql/plprofiler/blob/master/doc/installation.md > On Sat, 29 Oct, 2022, 1

Re: how to install plprofiler

2022-10-29 Thread Pavel Stehule
Hi so 29. 10. 2022 v 8:44 odesílatel shashidhar Reddy < shashidharreddy...@gmail.com> napsal: > Hello, > > I am in a process of upgrading postgresql 12 to version 13, when I am > testing it getting the below error > could not load library $carlib/plprofiler >

Re: Re: Re: Re: Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-11 Thread Pavel Stehule
e it will increase the > cost of the project(All SQL that contains a LIMIT clause needs to be > analyzed and checked). > > Is there no other way to solve the problem? > I don't know about any alternative Regards Pavel > > > > > At 2022-10-11 13:24:12, "Pavel Stehu

Re: Re: Re: Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-10 Thread Pavel Stehule
ent. The common trick in these cases is using OFFSET 0 clause like SELECT * FROM (SELECT * FROM foo LIMIT 1000 OFFSET 0) s LIMIT 10. > > > > > At 2022-10-11 12:13:47, "Pavel Stehule" wrote: > > > > út 11. 10. 2022 v 6:05 odesílatel gzh napsal: >

Re: Re: Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-10 Thread Pavel Stehule
ly useless in this case, Postgres does not have any logic for removing it. Postgres doesn't try to fix developer's mistakes. > > > > > At 2022-10-11 11:32:48, "Pavel Stehule" wrote: > > > > út 11. 10. 2022 v 5:13 odesílatel gzh napsal: > >> Hi, Tom

Re: Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-10 Thread Pavel Stehule
út 11. 10. 2022 v 5:13 odesílatel gzh napsal: > Hi, Tom > Thank you for your reply. > > > When you're asking for help, please don't give us vague statements > > > like "doesn't seem to work". > > I understand. > > > > Did the plan (including rowcount > > > estimates) change at all? To what?

Re: Same query, same data different plan

2022-10-10 Thread Pavel Stehule
po 10. 10. 2022 v 15:12 odesílatel Julien Rouhaud napsal: > On Mon, Oct 10, 2022 at 04:05:42PM +0300, Kostas Papadopoulos wrote: > > Hi, > > > > Yes, I ran ANALYZE in both databases. > This can be a common case. Check your configuration: work_mem, shared_buffers, effective_cache_size,

Re: What ist the standard setting of FETCH_COUNT?

2022-09-19 Thread Pavel Stehule
Hi po 19. 9. 2022 v 11:10 odesílatel Tiaswin napsal: > What is the standard default setting for fetch_count and where can I > find the current setting? > [pavel@localhost pspg-master]$ psql Assertions: on psql (16devel) Type "help" for help. (2022-09-19 11:11:47) postgres=# \set AUTOCOMMIT =

Re: unable to install pldebugger

2022-09-12 Thread Pavel Stehule
Hi po 12. 9. 2022 v 15:19 odesílatel shashidhar Reddy < shashidharreddy...@gmail.com> napsal: > Hello, > > 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 >

Re: « The PL/pgSQL interpreter parses the function's source text and produces an internal binary instruction tree... »

2022-07-28 Thread Pavel Stehule
pá 29. 7. 2022 v 4:57 odesílatel Bryn Llewellyn napsal: > > *t...@sss.pgh.pa.us wrote:* > > x...@thebuild.com wrote: > > This isn't a bug. > > > It's actually a feature… > > Having said that, there are certainly aspects of what happens when in > plpgsql that don't have a lot of justification

Re: Queries in another user's tables

2022-07-24 Thread Pavel Stehule
Hi ne 24. 7. 2022 v 9:38 odesílatel napsal: > Hello friends, I have a database base01 that belongs to user01 and on the > other hand a datebase base02 that belongs to user02. I need user01 to make > a query "SELECT * FROM base02.yourtable;" > > How can you get this? > see

Re: PostgreSQL 14.4 ERROR: out of memory issues

2022-07-18 Thread Pavel Stehule
po 18. 7. 2022 v 20:26 odesílatel Aleš Zelený napsal: > > po 18. 7. 2022 v 16:25 odesílatel Tom Lane napsal: > >> =?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= writes: >> > after some time, I've found a process consuming over 1GB of memory" >> > -bash-4.2$ grep RssAnon /proc/*/status | sort -nk2 | tail >>

Re: PostgreSQL 14.4 ERROR: out of memory issues

2022-07-14 Thread Pavel Stehule
čt 14. 7. 2022 v 21:26 odesílatel Aleš Zelený napsal: > > st 13. 7. 2022 v 2:20 odesílatel Michael Paquier > napsal: > >> On Mon, Jul 11, 2022 at 10:50:23AM +0200, Aleš Zelený wrote: >> > So far, it has happened three times (during a single week) from the >> 14.3 -> >> > 14.4 upgrade, before

Re: PostgreSQL 14.4 ERROR: out of memory issues

2022-07-11 Thread Pavel Stehule
Hi It's looks like memory leak ErrorContext: 8192 total in 1 blocks; 7928 free (5 chunks); 264 used > Grand total: 1456224 bytes in 195 blocks; 378824 free (165 chunks); > 1077400 used > 2022-07-02 14:48:07 CEST [3930]: [3-1] user=,db=,host=,app= ERROR: out of > memory > 2022-07-02 14:48:07

Re: Seems to be impossible to set a NULL search_path

2022-07-05 Thread Pavel Stehule
út 5. 7. 2022 v 20:18 odesílatel Adrian Klaver napsal: > On 7/5/22 11:12 AM, Bryn Llewellyn wrote: > > The section "Writing SECURITY DEFINER Functions Safely": > > > > > https://www.postgresql.org/docs/current/sql-createfunction.html#id-1.9.3.67.10.2 > > > > > Finally, what do you think of a

Re: plpgsql_check issue while upgrading from postgres version 12 to 13.7

2022-07-03 Thread Pavel Stehule
Hi ne 3. 7. 2022 v 11:39 odesílatel shashidhar Reddy < shashidharreddy...@gmail.com> napsal: > Hello, > > Need help on below error after upgrading the postgres from version to 12 > to 13.7 I am trying to execute update_extensions.sql script and it throws > an error stating > ERROR: extension

Re: User's responsibility when using a chain of "immutable" functions?

2022-06-29 Thread Pavel Stehule
st 29. 6. 2022 v 8:29 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > st 29. 6. 2022 v 7:46 odesílatel Tom Lane napsal: > >> ... that result has discouraged most people from spending much > >> time on mechanically checking such things. If you declar

Re: User's responsibility when using a chain of "immutable" functions?

2022-06-29 Thread Pavel Stehule
st 29. 6. 2022 v 7:46 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > st 29. 6. 2022 v 6:28 odesílatel Bryn Llewellyn > napsal: > >> Moreover, this "hermetic" property of a to-be-immutable function can be > >> established only by human analysis

Re: User's responsibility when using a chain of "immutable" functions?

2022-06-28 Thread Pavel Stehule
st 29. 6. 2022 v 6:28 odesílatel Bryn Llewellyn napsal: > *david.g.johns...@gmail.com wrote:* > > > *x...@thebuild.com wrote:* > > b...@yugabyte.com wrote: > > Should I simply understand that when I have such a dynamic dependency > chain of "immutable" functions, and should I drop and

Re: Operators on ranges with a domain subtype do not implicitly cast operands of the domain's base type

2022-06-17 Thread Pavel Stehule
pá 17. 6. 2022 v 17:26 odesílatel Daniel Popowich napsal: > On Thu, Jun 16, 2022 at 4:26 PM Tom Lane wrote: > >> Daniel Popowich writes: >> > -- domain with underlying type of integer (what constraints we might >> > -- place on the integer values are not germane to the issue so >>

Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"

2022-06-13 Thread Pavel Stehule
po 13. 6. 2022 v 21:02 odesílatel Bryn Llewellyn napsal: > *pavel.steh...@gmail.com wrote:* > > *b...@yugabyte.com napsal:* > > Does the “Tip” call-out box, from which the “Subject” here is copied, and > the larger story that I copied below, apply even when the executable > section of the

Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"

2022-06-13 Thread Pavel Stehule
Hi po 13. 6. 2022 v 7:45 odesílatel Bryn Llewellyn napsal: > Does the “Tip” call-out box, from which the “Subject” here is copied, and > the larger story that I copied below, apply even when the executable > section of the block statement in question does nothing at all that could > be rolled

Re: Restricting user to see schema structure

2022-05-12 Thread Pavel Stehule
pá 13. 5. 2022 v 5:42 odesílatel Bryn Llewellyn napsal: > *david.g.johns...@gmail.com wrote:* > > *b...@yugabyte.com wrote:* > > However, the design decision that, way back when, leads to this outcome > does surprise me. The principle of least privilege insists that (in the > database regime)

Re: Question on cast string to date

2022-05-09 Thread Pavel Stehule
út 10. 5. 2022 v 6:28 odesílatel 正华吕 napsal: > Hi, > > I test the following SQL in pg15dev (seems same behavior as the > previous version). > > select '2020701'::date; > date > > 0202-07-01 >(1 row) > >At the first glance, the result seems quite strange. >

Re: FOR integer loop bug?

2022-04-08 Thread Pavel Stehule
pá 8. 4. 2022 v 19:56 odesílatel Adrian Klaver napsal: > Postgres 14.2 > > In commenting on a SO question I came across the below. > > Given: > > CREATE OR REPLACE FUNCTION public.for_loop_test() > RETURNS void > LANGUAGE plpgsql > AS $function$ > BEGIN > FOR i IN 1..10 LOOP >

Re: Reg. GET STACKED DIAGNOSTICS values to be stored in a single variable

2022-04-07 Thread Pavel Stehule
Hi čt 7. 4. 2022 v 11:58 odesílatel Maheswaran R napsal: > Sir/madam, > While exception handling, we have to write multiple repeated lines in each > function to handle the GET STACKED DIAGNOSTICS values. it would be better > if all items in the diagnostics may be assigned to a single >

Re: PSQL bug?

2022-03-17 Thread Pavel Stehule
Hi čt 17. 3. 2022 v 11:35 odesílatel Dominique Devienne napsal: > Made a typo, using } instead of ) to test a weird table name, and got > disconnected. Normal? --DD > > ddevienne=> create table "t |" ( id int}; > ddevienne(> ); > server closed the connection unexpectedly > This probably

Re: Couldn't cast to record[]

2022-03-03 Thread Pavel Stehule
Hi čt 3. 3. 2022 v 11:01 odesílatel Suresh Kumar R napsal: > 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

Re: 2 phase commit with FDW

2022-02-18 Thread Pavel Stehule
Hi pá 18. 2. 2022 v 14:24 odesílatel Mladen Gogala napsal: > On 2/17/22 13:10, Mladen Gogala wrote: > > Hi! > > I am getting the following error when trying to PREPARE transaction which > updates both local and foreign table: > > 2/17/22 > 12:48:00:657 EST] 0128 RegisteredRes E

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

2022-02-13 Thread Pavel Stehule
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 names + aliases.column names (when > we know defined alias) > > Another

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

2022-02-13 Thread Pavel Stehule
ne 13. 2. 2022 v 9:29 odesílatel Peter J. Holzer napsal: > On 2022-02-13 01:11:16 +0100, Andreas 'ads' Scherbaum wrote: > > On 12/02/2022 22:34, Peter J. Holzer wrote: > > > On 2022-02-12 22:09:25 +0100, Andreas 'ads' Scherbaum wrote: > > > > On 12/02/2022 20:50, Peter J. Holzer wrote: > > > > >

Re: Postgres Version Upgrade to 14.1 error

2022-02-03 Thread Pavel Stehule
Hi pá 4. 2. 2022 v 7:02 odesílatel rob stan napsal: > Hello, > > We have "pgq" extensions on our clusters when I am trying to upgrade from > 9.6.24 to 14.1 with pg_upgrade --link method, i am getting error; > > > First i was getting this error ; > > could not load library

Re: psql does not provide proper response

2022-01-20 Thread Pavel Stehule
čt 20. 1. 2022 v 19:50 odesílatel Bryn Llewellyn napsal: > > shishaozh...@gmail.com wrote: > > > > I do not know what happened. > > > > psql does not provide proper response anymore. > > > > I typed the following and see nothing. > > > > user=# select * from

Re: plpgsql function problem whith creating temp table - not correctly using search_path ?

2022-01-11 Thread Pavel Stehule
út 11. 1. 2022 v 16:51 odesílatel napsal: > ‌Hi, Thank you for pointing this part of the documentation. > It's actually works with EXECUTE 'INSERT INTO my_table VALUES((random() * > 100)::INT);'; INSTEAD OF INSERT INTO my_table VALUES((random() * 100)::INT); > And it's possible to suppose that

  1   2   3   4   5   >