Re: Joins of data-modifying CTE with the target table

2023-04-19 Thread Adrian Klaver
n don't notice that the order total doesn't include the new item until it hits production. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Joins of data-modifying CTE with the target table

2023-04-19 Thread Adrian Klaver
able is the only thing you have to work on. Thank you! -- Adrian Klaver adrian.kla...@aklaver.com

Re: COPY RETURNING?

2023-04-19 Thread Adrian Klaver
le for it to contain some rows, I guess, but I'm not sure the COPY protocol supports returning rows, nor what the syntax would be to have a COPY RETURNING form of COPY. Thanks for any insights. --DD -- Adrian Klaver adrian.kla...@aklaver.com

Re: Request for information about postgres version 15.2 stability

2023-04-18 Thread Adrian Klaver
. looking forward to hearing from you. Best Regards. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Call a Normal function inside a Trigger Function

2023-04-16 Thread Adrian Klaver
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 -- Adrian Klaver adrian.kla...@aklaver.com

Re: PL/pgSQL's "open cur for execute" provides workarouned... Re: cursors with prepared statements

2023-04-16 Thread Adrian Klaver
On 4/16/23 11:02, Bryn Llewellyn wrote:> statement fails but doing this using PL/pgSQL succeeds. What's going on under the covers? Pretty sure: https://www.postgresql.org/docs/current/spi.html -- Adrian Klaver adrian.kla...@aklaver.com

Re: FW: Error!

2023-04-15 Thread Adrian Klaver
e programs working correctly, that's it. Five question: Just a Postgresql 15. Thanks! for your attention! and collaboration! Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows *From: *Adrian Klaver <mailto:adrian.kla...@aklaver.com> *Sent: *Saturday,

Re: FW: Error!

2023-04-15 Thread Adrian Klaver
loading various versions of postgresql that are in the link that you sent me.' Or did you just download for the fun of it and not actually install. How many versions of Postgres do you have installed now? Thanks! Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Wind

Re: FW: Error!

2023-04-15 Thread Adrian Klaver
hat should I do to fix this once and for all???. Thanks! -- Adrian Klaver adrian.kla...@aklaver.com

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-15 Thread Adrian Klaver
On 4/15/23 03:46, Peter J. Holzer wrote: On 2023-04-14 10:44:08 -0700, Adrian Klaver wrote: On 4/14/23 9:31 AM, Peter J. Holzer wrote: On 2023-04-13 10:07:09 -0500, Ron wrote: On 4/13/23 09:44, Sebastien Flaesch wrote: Is there an easy way to convert JSON data containing ASP.NET AJAX

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Adrian Klaver
+1 Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- Adrian Klaver adrian.kla...@aklaver.com

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-14 Thread Adrian Klaver
y interpretation is strictly by convention between the sender and the receiver. This looks like "milliseconds since the Unix epoch: $ date -d @1672692813.062 Mon 02 Jan 2023 02:53:33 PM CST Thus: select to_timestamp(cast(1672692813062 as bigint))::timestamp; ITYM: select to_timestamp(1672692813062/1000.0); hp -- Adrian Klaver adrian.kla...@aklaver.com

Re: cursor with hold must be save to disk?

2023-04-14 Thread Adrian Klaver
going to guess the cursor query is holding a large amount of data. To get a more specific answer you will need to provide: 1) Postgres version. 2) The complete DECLARE command being used. 3) An indication of the amount of data being retrieved. 4) The actual time for a 'long time'.

Re: Unexpected behavior when combining `generated always` columns and update rules

2023-04-13 Thread Adrian Klaver
same thing. That your '...actually computed on insertion,...' meant not just for an INSERT but for any change in the data. In other words when the original query actually ran. Ciprian. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Unexpected behavior when combining `generated always` columns and update rules

2023-04-13 Thread Adrian Klaver
the rule action. So at the time of the rule action x.d is still 10. What this points out is that you will lead a simpler life if you use triggers instead of rules. Ciprian. -- Adrian Klaver adrian.kla...@aklaver.com

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-13 Thread Adrian Klaver
reSQL to convert an AJAX Date from JSON or do I have to do this by hand? By hand as this is a MS/ASP thing: https://weblogs.asp.net/bleroy/dates-and-json not a JSON thing. Seb ---- -- Adrian Klaver adrian.kla...@aklaver.com

Re: Guidance on INSERT RETURNING order

2023-04-12 Thread Adrian Klaver
ng a sequence. bye, //mirabilos -- Adrian Klaver adrian.kla...@aklaver.com

Re: FW: Error!

2023-04-12 Thread Adrian Klaver
lp me solve this error that does not allow me to move forward, sorry for the inconveniences. Thanks again, best regards! Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows *From: *Adrian Klaver <mailto:adrian.kla...@aklaver.com> *Sent: *Wednesday, April 12,

Re: Guidance on INSERT RETURNING order

2023-04-12 Thread Adrian Klaver
about to insert). [Be Careful with GENERATED ALWAYS pks to OVERRIDE] HTH -- Adrian Klaver adrian.kla...@aklaver.com

Re: FW: Error!

2023-04-12 Thread Adrian Klaver
n what I want to develop for my project. I hope you can find the person responsible for these abnormalities. Thanks! Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows -- Adrian Klaver adrian.kla...@aklaver.com

Re: Performance issue after migration from 9.4 to 15

2023-04-12 Thread Adrian Klaver
l.org/docs/current/pgupgrade.html Statistics Because optimizer statistics are not transferred by pg_upgrade, you will be instructed to run a command to regenerate that information at the end of the upgrade. You might need to set connection parameters to match your new cluster. -- Adr

Re: subscribe

2023-04-12 Thread Adrian Klaver
On 4/12/23 07:00, Mike Bayer wrote: What is it you are trying to do? -- Adrian Klaver adrian.kla...@aklaver.com

Re: Guidance on INSERT RETURNING order

2023-04-11 Thread Adrian Klaver
) SELECT data FROM (VALUES ('a', 1), ('b', 2), ('c', 3)) as vv(data, num) ORDER BY num RETURNING id Or with i as (INSERT INTO t(data) VALUES ('a', 1), ('b', 2), ('c', 3) returning id) select i.id from i order by id; Sorry fo

Re: Guidance on INSERT RETURNING order

2023-04-11 Thread Adrian Klaver
('b'), ('c') RETURNING id but we were recently made aware that there is no guarantee on the order of the returned columns. 1) Because returned data in SQL is inherently unordered. 2) What would you order by, id or data or both? Sorry for the long email, Thanks Federico

Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Adrian Klaver
que violation with the inserted data. It's a quick and dirty way to avoid queries that look for potential violations ahead of time, basically 'Ask forgiveness' vs 'Get permission'. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Postgresql Upgrade from 10 to 14

2023-04-09 Thread Adrian Klaver
service? 3) The hardware specifications for the machine? 4) How was the upgrade done? 5) An example of a slow query with the output of EXPLAIN 6) What version of the JDBC driver? -- Adrian Klaver adrian.kla...@aklaver.com

Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-08 Thread Adrian Klaver
expected, as after all the command is: INSERT INTO ... While I am expecting the insert is never executed in the first place when that row already exist (as identified by it primary key). So the update execute without error. I hope the pesudo code above is enough to clarify the difference? Cheers, Louis Tian -- Adrian Klaver adrian.kla...@aklaver.com

Re: doc sql-grant.html Synopsis error?

2023-04-08 Thread Adrian Klaver
fy the function name as IN SCHEMA is not available in that form of the command. -- Achilleas Mantzios IT DEV - HEAD IT DEPT Dynacom Tankers Mgmt -- Adrian Klaver adrian.kla...@aklaver.com

Re: pg_ctlcluster is not stopping cluster

2023-04-07 Thread Adrian Klaver
udo -u postgres /usr/bin/pg_ctlcluster 13 main stop -- -m fast depending on which cluster you want to shut down. /usr/lib/postgresql/15/bin/postgres "-D" "/var/lib/postgresql/13/main" "-c" "config_file=/etc/postgresql/15/main/postgresql.conf"

Re: pg_ctlcluster is not stopping cluster

2023-04-07 Thread Adrian Klaver
g_lsclusters to determine what is actually running. Then do sudo -u postgres /usr/bin/pg_ctlcluster main stop -- -m fast -D /var/lib/postgresql/13/main stop -m fast for whatever version is running. -- Adrian Klaver adrian.kla...@aklaver.com

Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-07 Thread Adrian Klaver
--+--- 0 | foo | t Cheers, Louis Tian -- Adrian Klaver adrian.kla...@aklaver.com

Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-07 Thread Adrian Klaver
ted something like: insert into person (id, name, is_active) values(0, , true) I'm would not like the server making those guesses on my behalf. , Cheers, Louis Tian -------- -- Adrian Klaver adrian.kla...@aklaver.com

Re: UPSERT in Postgres

2023-04-06 Thread Adrian Klaver
*Question* This there a way to do an upsert proper prior to PG15? *Feature Request* Given that UPSERT is an *idempotent* operator it is extremely useful. Would love to see an UPSERT command in PostgreSQL so one can 'upsert' properly and easily. Regards, Louis Tian -- Adrian Klaver adrian.kla...@aklaver.com

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-04 Thread Adrian Klaver
uot; is correct in this case. It does not refer to the number of returned values. -- Erik -- Adrian Klaver adrian.kla...@aklaver.com

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 12:00, Erik Wienhold wrote: On 03/04/2023 18:37 CEST Adrian Klaver wrote: On 4/3/23 09:21, Erik Wienhold wrote: On 03/04/2023 17:36 CEST Adrian Klaver wrote: On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 09:21, Erik Wienhold wrote: On 03/04/2023 17:36 CEST Adrian Klaver wrote: On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb @@ jsonpath → boolean Returns the result of a JSON path predicate check for the specified

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-03 Thread Adrian Klaver
On 4/3/23 08:11, Erik Wienhold wrote: On 02/04/2023 17:40 CEST Adrian Klaver wrote: That is a long way from: jsonb @@ jsonpath → boolean Returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken into account. If the result is

Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

2023-04-02 Thread Adrian Klaver
red --+-- 1| f 2| f 3| t 4| t 5| t (5 rows) That is a long way from: jsonb @@ jsonpath → boolean Returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken into account. If the result is not Boolean, then NULL is returned. -- Erik -- Adrian Klaver adrian.kla...@aklaver.com

Re: COPY and custom datestyles. Or some other technique?

2023-03-29 Thread Adrian Klaver
On 3/29/23 16:31, Adrian Klaver wrote: On 3/29/23 16:24, Ron wrote: Postgresql 13.10 $ psql -h myhost.example.com -X dba \ -c "\copy ${tbl} from '/var/lib/pgsql/Rdb/${tbl}.csv' WITH DELIMITER '|';" ERROR:  date/time field value out of range: &qu

Re: COPY and custom datestyles. Or some other technique?

2023-03-29 Thread Adrian Klaver
5 PDT to move the data into final table. There are 550+ tables, so something that I can do once on this end would make my life a lot easier. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Using CTID system column as a "temporary" primary key

2023-03-29 Thread Adrian Klaver
. 2) 0 can be a valid sequence value: test(5432)=# create sequence zero_test start 0 minvalue 0; CREATE SEQUENCE test(5432)=# select * from zero_test ; last_value | log_cnt | is_called +-+--- 0 | 0 | f Then what do you do? -- Adrian Klaver adrian.kla

Re: Using CTID system column as a "temporary" primary key

2023-03-29 Thread Adrian Klaver
On 3/29/23 09:43, Peter J. Holzer wrote: On 2023-03-29 07:59:54 -0700, Adrian Klaver wrote: On 3/29/23 07:19, Sebastien Flaesch wrote: INSERT statements must not use the serial column, so you have to list all columns of the table and provide only the values of the non-serial columns. With

Re: Using CTID system column as a "temporary" primary key

2023-03-29 Thread Adrian Klaver
ucture that receives the row. ... Seb -------- -- Adrian Klaver adrian.kla...@aklaver.com

Re: How are the SELECT queries reconstructed in pg_views

2023-03-28 Thread Adrian Klaver
On 3/28/23 13:23, Adrian Klaver wrote: On 3/28/23 06:43, Julius de Bruijn wrote: Hi, I haven't been able to find exactly what changes PostgreSQL does when reconstructing the query, but I've successfully been able to create views where the resulting query differs from what I wrote

Re: How are the SELECT queries reconstructed in pg_views

2023-03-28 Thread Adrian Klaver
n Software Engineer https://www.prisma.io/ -- Adrian Klaver adrian.kla...@aklaver.com

Re: Cluster table based on grand parent?

2023-03-28 Thread Adrian Klaver
table grandchild (id int generated always as identity primary key, parent int not null references child(id) on delete cascade, name text not null, unique(parent, name)); CREATE TABLE ``` -- Adrian Klaver adrian.kla...@aklaver.com

Re: Plans for ON DELETE CASCADE? Which index is used, if at all?

2023-03-28 Thread Adrian Klaver
--+-----+---+- (0 rows) -- Adrian Klaver adrian.kla...@aklaver.com

Re: Convert pg_constraint.conkey array to same-order array of column names

2023-03-24 Thread Adrian Klaver
On 3/24/23 9:44 AM, Dominique Devienne wrote: On Fri, Mar 24, 2023 at 5:40 PM Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: On 3/24/23 03:28, Dominique Devienne wrote: > On Thu, Mar 23, 2023 at 4:20 PM Adrian Klaver mailto:adrian.kla...

Re: Convert pg_constraint.conkey array to same-order array of column names

2023-03-24 Thread Adrian Klaver
On 3/24/23 03:28, Dominique Devienne wrote: On Thu, Mar 23, 2023 at 4:20 PM Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: On 3/23/23 04:12, Dominique Devienne wrote: > CROSS JOIN LATERAL UNNEST(cnstr.conkey) WITH ORDINALITY AS cols(value, rank)

Re: How to install vacuumlo on a client?

2023-03-23 Thread Adrian Klaver
at OS command line run: vacuumlo -V -- Adrian Klaver adrian.kla...@aklaver.com

Re: Convert pg_constraint.conkey array to same-order array of column names

2023-03-23 Thread Adrian Klaver
= pg_attribute.attrelid; array_agg - {category,line_id,category} -- Adrian Klaver adrian.kla...@aklaver.com

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

2023-03-22 Thread Adrian Klaver
ow it's possible to navigate to the last result in the set without knowing how many there are. Maybe that fact is there internally—but with no explicit SQL or PL/pgSQL exposure of the value. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Getting error while upgrading postgres from version 12 to 13

2023-03-21 Thread Adrian Klaver
o indicate which directory path has which PG_VERSION value. While you are at it do: /usr/lib/postgresql/13/bin/pg_upgrade -V and post the version returned. On Tue, 21 Mar, 2023, 8:09 pm Adrian Klaver, <mailto:adrian.kla...@aklaver.com>> wrote: On 3/21/23 03:29, sha

Re: Getting error while upgrading postgres from version 12 to 13

2023-03-21 Thread Adrian Klaver
are running.  Showing that psql itself works on both running clusters would be a good start.  Show inputs, not just outputs those inputs creates. David J. -- Shashidhar -- Adrian Klaver adrian.kla...@aklaver.com

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

2023-03-20 Thread Adrian Klaver
PostgreSQL server does not implement an OPEN statement for cursors; a cursor is considered to be open when it is declared. However, ECPG, the embedded SQL preprocessor for PostgreSQL, supports the standard SQL cursor conventions, including those involving DECLARE and OPEN statements." https://www.postgresql.org/docs/current/plpgsql-cursors.html "Rather than executing a whole query at once, it is possible to set up a cursor that encapsulates the query, and then read the query result a few rows at a time. One reason for doing this is to avoid memory overrun when the result contains a large number of rows. (However, PL/pgSQL users do not normally need to worry about that, since FOR loops automatically use a cursor internally to avoid memory problems.) A more interesting usage is to return a reference to a cursor that a function has created, allowing the caller to read the rows. This provides an efficient way to return large row sets from functions." As to portal, entering it in the documentation search leads to a first result of: https://www.postgresql.org/docs/current/protocol-flow.html Do a page search for portal. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Getting error while upgrading postgres from version 12 to 13

2023-03-18 Thread Adrian Klaver
untu 12.14-1.pgdg18.04+1) Please help me on this issue. -- Shashidhar -- Shashidhar -- Adrian Klaver adrian.kla...@aklaver.com

Re: Can't connect to server

2023-03-18 Thread Adrian Klaver
/Her/Hers *Full-Time MBA Candidate 2023* *Graduate Assistant - Admission Team * Broad College of Business Michigan State University *C*: (517) 329 - 5793 *E*: wuchi...@msu.edu *WHO WILL MAKE BUSINESS HAPPEN?* *SPARTANS WILL.* -- Adrian Klaver adrian.kla...@aklaver.com

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

2023-03-16 Thread Adrian Klaver
e goal posts. What starts out with: "(Anyway, without anything like Oracle PL/SQL's packages, you have no mechanism to hold the opened cursor variable between successive server calls.) Is it fair to say that the PL/pgSQL refcursor is useful, at best, only in very special use-cases?" evolves into deep dive into all thing cursors. -- Adrian Klaver adrian.kla...@aklaver.com

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

2023-03-15 Thread Adrian Klaver
and read result #n2. So I was looking for a convincing example. Huh? You provided your own example earlier: "Of course, it all falls into place now. I can see how I could write a client app in, say, Python to write a humongous report to a file by fetching manageably-sized chunks, time and again until done with a function like my "g()" here, from a cursor that I'd opened using a function like my "f()"." -- Adrian Klaver adrian.kla...@aklaver.com

Re: How to behive if I remove password from postgres role

2023-03-15 Thread Adrian Klaver
on method and not a password. Once you are in you can alter the postgres user to have a proper password. Regards, Raivo -- Adrian Klaver adrian.kla...@aklaver.com

Re: Table scan on 15.2

2023-03-15 Thread Adrian Klaver
t of distinct values from the IN clause and their count (1000 total values). 1 1 1 1 1 1 1 2 2 2 3 4 6 7 7 10 10 11 12 14 14 22 22 23 23 25 29 29 34 39 50 56 67 75 137 258 -- Adrian Klaver adrian.kla...@aklaver.com

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

2023-03-14 Thread Adrian Klaver
rocedure()". That top-of-stack subprogram can invoke other subprograms and so on ad infinitum. But eventually the whole stack empties and control passes back to the client. But all that falls away now with the exampe I showed in place. -- Adrian Klaver adrian.kla...@aklaver.com

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

2023-03-14 Thread Adrian Klaver
." Is it fair to say that the PL/pgSQL refcursor is useful, at best, only in very special use-cases? -- Adrian Klaver adrian.kla...@aklaver.com

Re: Issues Scaling Postgres Concurrency

2023-03-14 Thread Adrian Klaver
ore. 1) https://wiki.postgresql.org/wiki/Slow_Counting 2) Are you using connection pooling? I would appreciate any insights or advice on how to optimize Postgres for high concurrency scenarios. Thank you in advance for your help! -- Adrian Klaver adrian.kla...@aklaver.com

Re: Problems connecting to the server

2023-03-14 Thread Adrian Klaver
rompted to supply when setting up pgAdmin4. Have a good dayЗнімок екрана 2023-03-13 о 17.23.14.png -- Adrian Klaver adrian.kla...@aklaver.com

Re: Properly handle OOM death?

2023-03-13 Thread Adrian Klaver
ineer Alaska Volcano Observatory Geophysical Institute - UAF 2156 Koyukuk Drive Fairbanks AK 99775-7320 Work: 907-474-5172 cell:  907-328-9145 -- Adrian Klaver adrian.kla...@aklaver.com

Re: Help? Unexpected PostgreSQL compilation failure using generic compile script

2023-03-12 Thread Adrian Klaver
? If anyone can help - even if it's to tell me I'm an idiot for missing one or more incredibly basic things somehow - I would be very grateful. Many thanks. Regards, M. -- Adrian Klaver adrian.kla...@aklaver.com

Re: garbage data back

2023-03-06 Thread Adrian Klaver
is your friend. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Fwd: garbage data back

2023-03-06 Thread Adrian Klaver
"ID") AS "FileKey"\ Because "Orders"."ID" is different then "Order Items"."ID"? Wait, then why are the Item IDs different? -- Adrian Klaver adrian.kla...@aklaver.com

Re: garbage data back

2023-03-06 Thread Adrian Klaver
. select "FileKey", "OrderItemID" from "vw_rptInvc_Permits" where "FileKey" LIKE '%1317' image.png I'm stumped. Any guesses? What is the view definition? Is there a table named vw_rptInvc_Permits? -- Adrian Klaver adrian.kla...@aklaver.com

Re: what's hsitoric MVCC Snapshot?

2023-03-05 Thread Adrian Klaver
On 3/5/23 07:58, Adrian Klaver wrote: On 3/5/23 06:49, jack...@gmail.com wrote: Here are the comments in src/include/utils/snapshot.h. /* * For normal MVCC snapshot this contains the all xact IDs that are in * progress, unless the snapshot was taken during recovery in which case * it's

Re: what's hsitoric MVCC Snapshot?

2023-03-05 Thread Adrian Klaver
ack...@gmail.com -- Adrian Klaver adrian.kla...@aklaver.com

Re: Tempory table is not getting created inside Function in postgres.

2023-02-27 Thread Adrian Klaver
        DO $$ DECLARE I missed it the first time, you are embedding a DO inside the function. 1) Pretty sure that is not going to work. Especially as you are changing languages. 2) Why are you doing that? 3) Either incorporate everything into one function or create separate stand alone funct

Re: Tempory table is not getting created inside Function in postgres.

2023-02-27 Thread Adrian Klaver
e can any one help me why in the function i am not able to create the temp table. what is alternative You are running this in pgAdmin4 Query Tool, correct? Is Autocommit set? Have you tried this in psql? -- Adrian Klaver adrian.kla...@aklaver.com

Re: pg_get_functiondef(), trailing spaces and + sign

2023-02-27 Thread Adrian Klaver
    +  AS $function$ +  begin + return bar * 1.0; +  end;  +  $function$    + (1 row) -- Adrian Klaver

Re: pg_get_functiondef(), trailing spaces and + sign

2023-02-27 Thread Adrian Klaver
    +  AS $function$ +  begin + return bar * 1.0; +  end;  +  $function$    + (1 row) -- Adr

Re: pg_upgradecluster transfering only a portion of the data

2023-02-27 Thread Adrian Klaver
On 2/27/23 09:10, Adrian Klaver wrote: On 2/27/23 09:05, Dávid Suchan wrote: Please use Reply All Ccing list My bad, \l+ lists databases and their respective sizes- I used that and also pg_size_pretty(), the result size was the same - before it was 20gb for the biggest db, after it was

Re: pg_upgradecluster transfering only a portion of the data

2023-02-27 Thread Adrian Klaver
that table. -- Adrian Klaver adrian.kla...@aklaver.com

Re: pg_upgradecluster transfering only a portion of the data

2023-02-27 Thread Adrian Klaver
was "success" 4) I did not, I presume it is there, the question is why only 700 mb was transferred If you have not connected how could you do the \l and row count? 5) would it be inside main pg log? Or some special one? Dňa po 27. 2. 2023, 17:14 Adrian Klaver <mailto:adrian.kla..

Re: pg_upgradecluster transfering only a portion of the data

2023-02-27 Thread Adrian Klaver
On 2/27/23 08:48, Tom Lane wrote: Adrian Klaver writes: On 2/27/23 08:36, Tom Lane wrote: If it was based on something like "du", perhaps the measurement was fooled by the fact that most of the data files will be hard-linked between the old and new clusters. Does that happen w

Re: pg_upgradecluster transfering only a portion of the data

2023-02-27 Thread Adrian Klaver
On 2/27/23 08:36, Tom Lane wrote: Adrian Klaver writes: On 2/27/23 07:44, Dávid Suchan wrote: After a successful prompt finished, I checked the database and the size went from originally 20gb (in 9.6) to 700~ mb (in 14) while the disk space available shrank by about 2gb meaning that there is

Re: pg_upgradecluster transfering only a portion of the data

2023-02-27 Thread Adrian Klaver
, what would be the best practice when upgrading pg version with huge amounts of data(could be a terabyte)? -- Adrian Klaver adrian.kla...@aklaver.com

Re: Debugging postgres on Windows - could not open directory "/lib"

2023-02-24 Thread Adrian Klaver
On 2/23/23 17:16, Cathy Xie wrote: On Thu, Feb 23, 2023 at 1:21 AM Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: On 2/21/23 17:18, Cathy Xie wrote: > > > On Wed, Feb 22, 2023 at 6:54 AM Adrian Klaver mailto:adrian.kla...@aklaver.com>

Re: Debugging postgres on Windows - could not open directory "/lib"

2023-02-22 Thread Adrian Klaver
On 2/21/23 17:18, Cathy Xie wrote: On Wed, Feb 22, 2023 at 6:54 AM Adrian Klaver Hi Adrian, Thanks for your email! 1) How did you build it? I installed ActivateState Perl, Bison, and Flex. Then I ran the command ```build Debug``` under directory postgres/src/tools/msvc 2

Re: Debugging postgres on Windows - could not open directory "/lib"

2023-02-21 Thread Adrian Klaver
on how to fix this issue. 1) How did you build it? 2) Open pgsql.sln in a text editor and report the results here. Best regards, Cathy -- Adrian Klaver adrian.kla...@aklaver.com

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Adrian Klaver
On 2/20/23 19:22, p...@pfortin.com wrote: On Mon, 20 Feb 2023 15:24:23 -0800 Adrian Klaver wrote: It just dawned on me you might be doing all of this through the pgAdmin4 GUI. Sorry for any confusion... I get it now... A team member uses pgAdmin4 to load separate table(s) into his DB

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Adrian Klaver
On 2/20/23 11:36, p...@pfortin.com wrote: On Mon, 20 Feb 2023 11:06:34 -0800 Adrian Klaver wrote: On 2/20/23 10:27, p...@pfortin.com wrote: [Still a newbie; but learning fast...] Hi, Notwithstanding the man page, my take is that the DROP DATABASE statement needs to be eliminated at

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Adrian Klaver
On 2/20/23 11:36, p...@pfortin.com wrote: On Mon, 20 Feb 2023 11:06:34 -0800 Adrian Klaver wrote: On 2/20/23 10:27, p...@pfortin.com wrote: [Still a newbie; but learning fast...] Hi, A remote team member is helping out by dumping some of his tables via pgAdmin4 on Windows. My DB is on

Re: pg_dump'ed file contains "DROP DATABASE"

2023-02-20 Thread Adrian Klaver
w data you want then you are fine. Otherwise you will need to be more specific about what you are trying to achieve. [1] 3 types of tables: ~40%=8.5M rows; ~40%=33M rows; ~20%=varying sizes Thanks, Pierre -- Adrian Klaver adrian.kla...@aklaver.com

Re: pg_reload_conf()

2023-02-20 Thread Adrian Klaver
anted the appropriate SET privilege. However, these settings never change in a session after it is started. If you change them in postgresql.conf, send a SIGHUP signal to the postmaster to cause it to re-read postgresql.conf. The new values will only affect subsequently-launched session

Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread Adrian Klaver
On 2/16/23 10:21, Dominique Devienne wrote: On Thu, Feb 16, 2023 at 6:58 PM Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: "... which would be either impossible or too slow to base any RLS policy on." and "At time point, changing the legacy

Re: DELETE trigger, direct or indirect?

2023-02-16 Thread Adrian Klaver
On 2/16/23 10:28, Dominique Devienne wrote: On Thu, Feb 16, 2023 at 6:51 PM Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: You have two tables with list in their name, so are rows deleted from both. Just to be clear enity_list should actually be entity_list? Als

Re: Vacuum full issue

2023-02-16 Thread Adrian Klaver
limitation like that? I'm guessing this has to do with whatever condition caused then to decide to do VACUUM FULL in the first place. Why did they do the VACUUM FULL? Thanks Ramakrishnan -- Adrian Klaver adrian.kla...@aklaver.com

Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread Adrian Klaver
r would need to know the context in which it was triggered, i.e. directly (then update the other model), or indirectly (don't update, the change is boomerang'ing around from our own change). Any thoughts? --DD PS: At time point, changing the legacy code base is not really an option... -- Adrian Klaver adrian.kla...@aklaver.com

Re: DELETE trigger, direct or indirect?

2023-02-16 Thread Adrian Klaver
columns are mutually exclusive. Sounds like that might work, no? -- Adrian Klaver adrian.kla...@aklaver.com

Re: DELETE trigger, direct or indirect?

2023-02-16 Thread Adrian Klaver
On 2/16/23 08:55, David G. Johnston wrote: On Thu, Feb 16, 2023 at 9:46 AM Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: On 2/16/23 05:23, Dominique Devienne wrote: > Hi. This is a bit unusual. We have a foreign key between two tables, > with ON DEL

Re: DELETE trigger, direct or indirect?

2023-02-16 Thread Adrian Klaver
E in the "child table", or whether the deletion is coming from the "parent table" CASCADEd to the child table. Thanks, --DD -- Adrian Klaver adrian.kla...@aklaver.com

Re: Automatic aggressive vacuum on almost frozen table takes too long

2023-02-16 Thread Adrian Klaver
the fix anyway. Just in case, I'm using Postgresql version: 11.11. Besides the above you are missing 8 releases of other fixes. autovacuum_vacuum_cost_delay: 2ms autovacuum_vacuum_cost_limit: 8000 Thank you. BR, Mikhael -- Adrian Klaver adrian.kla...@aklaver.com

Re: Quoting issue from ODBC

2023-02-14 Thread Adrian Klaver
though the Access log says the statement was only run once and Postgres says ERROR, I see no other evidence of it. I can't fathom how that can happen. ¯\_(ツ)_/¯ On the other hand, there are some real errors in the log. I'll put that in another post. Brad -- Adrian Klaver adrian.kla...@aklaver.com

Re: HOWTO? Permissions for user to access a single db

2023-02-13 Thread Adrian Klaver
g any restrictions imposed by pg_hba.conf). I didn't think it was a pg_hba.conf issue because via SSH tunnel they appear inside linux as if localhost (I think?). After you stop laughing/crying, can anyone guide me? Huge thx -Damian -- Adrian Klaver adrian.kla...@aklaver.com

<    5   6   7   8   9   10   11   12   13   14   >