Re: load fom csv

2024-09-18 Thread Rob Sargent
...@gmail.com> wrote:I'll echo vars and see if something looks strange.THanks.On Tue, Sep 17, 2024 at 3:46 PM Rob Sargent <robjsarg...@gmail.com> wrote: > On Sep 17, 2024, at 12:25 PM, Adrian Klaver <adrian.kla...@aklaver.com> wrote: > > On 9/17/24 09:21, Andy Har

Re: load fom csv

2024-09-17 Thread Rob Sargent
> On Sep 17, 2024, at 12:25 PM, Adrian Klaver wrote: > > On 9/17/24 09:21, Andy Hartman wrote: >> The command work outside of powershell yes > > Then you are going to need to use whatever debugging tools PowerShell has > available to step through the script to figure out where the problem

Re: Manual query vs trigger during data load

2024-09-13 Thread Rob Sargent
> On Sep 13, 2024, at 10:57 AM, Adrian Klaver wrote: > > On 9/13/24 07:50, Adrian Klaver wrote: >>> On 9/13/24 02:58, Juan Rodrigo Alejandro Burgos Mella wrote: >>> Hello, I find it unlikely that the trigger will work properly, since the >>> reserved fields of the OLD subset have no value in

Re: Ghost data from failed FDW transactions?

2024-08-28 Thread Rob Sargent
> On Aug 28, 2024, at 10:18 AM, Jacob Biesinger > wrote: > > But to go deeper, we use the javascript knex adapter and some > application-level transaction management that automatically retries a > transaction N times when it encounters serialization errors. On this > particular endpoint, th

Re: can stored procedures with computational sql queries improve API performance?

2024-07-10 Thread Rob Sargent
> On Jul 9, 2024, at 7:21 PM, Krishnakant Mane wrote: > >  >> On 7/10/24 06:44, Guyren Howe wrote: >>> On Jul 9, 2024, at 17:58, Krishnakant Mane wrote: >>> Hello. >>> >>> I have a straight forward question, but I am just trying to analyze the >>> specifics. >>> >>> So I have a set of que

Re: Transaction issue

2024-06-20 Thread Rob Sargent
> On Jun 20, 2024, at 7:05 AM, Rich Shepard wrote: > > On Thu, 20 Jun 2024, Karsten Hilbert wrote: > >> Shot in the dark: are you be any chance using tab-completion >> when running the SELECT before the COMMIT ? > > Karsten, > > Nope. I prepare DDL, DML, and DQL scripts in emacs, then run

Re: Transaction issue

2024-06-19 Thread Rob Sargent
On 6/19/24 15:55, David G. Johnston wrote: On Wednesday, June 19, 2024, Adrian Klaver wrote: On 6/19/24 14:33, Rich Shepard wrote: On Wed, 19 Jun 2024, Adrian Klaver wrote: I should have added to previous post: What is the exact command string you are us

Re: Manual Failover

2024-06-19 Thread Rob Sargent
On 6/19/24 09:03, Yongye Serkfem wrote: Hello Engineers, I am facing an issue with the manual failover of the standby to the master role. I was able to promote the standby and got it out of recovery mode. How do I direct applications to point to the standby which has assumed the role of the

Re: UPDATE with multiple WHERE conditions

2024-06-12 Thread Rob Sargent
On 6/12/24 15:48, Ron Johnson wrote: On Wed, Jun 12, 2024 at 5:28 PM Rich Shepard wrote: I have a table with 3492 rows. I want to update a boolean column from 'false' to 'true' for 295 rows based on the value of another column. Is there a way to access a file with those conditio

Re: Purpose of pg_dump tar archive format?

2024-06-04 Thread Rob Sargent
On 6/4/24 13:15, Ron Johnson wrote: On Tue, Jun 4, 2024 at 2:55 PM Rob Sargent wrote: On 6/4/24 11:40, Shaheed Haque wrote: > > We use it. I bet lots of others do too. > > Of course.  There are lots of small, real, useful databases in the wild.

Re: Purpose of pg_dump tar archive format?

2024-06-04 Thread Rob Sargent
On 6/4/24 11:40, Shaheed Haque wrote: We use it. I bet lots of others do too. Of course.  There are lots of small, real, useful databases in the wild.

Re: How to reference a DB with a period in its name ?

2024-03-29 Thread Rob Sargent
On 3/29/24 15:36, David Gauthier wrote: Ya, I kind of agree on the >1 DB connections not allowed.  It (perl/DBI) does allow for >1 active DB handles (objects).  But of course those handles/objects have different names and that's how to work with the different ones (not a DB prefix like what

Re: After 10 -> 15 upgrade getting "cannot commit while a portal is pinned" on one python function

2024-03-27 Thread Rob Sargent
On 3/27/24 17:05, Jeff Ross wrote: On 3/27/24 15:44, Tom Lane wrote: Perhaps "pinned" in the error message means "open"? No, it means "pinned" ... but I see that plpython pins the portal underlying any PLyCursor object it creates. Most of our PLs do that too, to prevent a portal from disapp

Re: Dropping a temporary view?

2024-03-20 Thread Rob Sargent
On 3/20/24 10:51, Celia McInnis wrote: The view is being used in some web query software that multiple people will be accessing and the contents of the view depend on what the person is querying, so I think that temporary views or tables are a good idea. I change to non-temporary views or ta

Re: Insert with Jsonb column hangs

2024-03-09 Thread Rob Sargent
> On Mar 9, 2024, at 9:01 AM, kuldeep singh wrote: > >  > Copy may not work in our scenario since we need to join data from multiple > tables & then convert it to json using row_to_json . This json data > eventually needs to be stored in a target table . >> Wait. You're getting the data

Re: Unable to get PostgreSQL 15 with Kerberos (GSS) working

2024-02-29 Thread Rob Sargent
On 2/29/24 01:18, Matthew Dennison wrote: Here's the results: psql: error: connection to server at "hostname.mydomain.net" (::1), port 5432 failed: GSSAPI continuation error: Unspecified GSS failure. Minor code may provide more information: No Kerberos credentials available (default cache:

Re: Need Assistance: Command to display procedures does not work

2024-02-28 Thread Rob Sargent
> On Feb 28, 2024, at 8:53 AM, Sasmit Utkarsh wrote: > > Hi Postgresql Team, > > Getting error while executing the below \df command to list the > procedures/functions. whereas query gives the appropriate results Please > assist on how to troubleshoot this. > > [sutkars...@dxctravel.svcs.e

Re: "reverse" (?) UPSERT -- how to ?

2024-02-17 Thread Rob Sargent
> On Feb 17, 2024, at 8:24 AM, Karsten Hilbert wrote: > > Dear list members, > > maybe I am overlooking something. > > PostgreSQL offers UPSERT functionality by way of > >INSERT INTO ... ON CONFLICT ... DO UPDATE ...; > > Consider this pseudo-code schema > >table master >

Re: Mimic ALIAS in Postgresql?

2024-01-22 Thread Rob Sargent
On 1/17/24 16:25, Jim Nasby wrote: On 1/16/24 6:41 PM, Rob Sargent wrote: On 1/16/24 17:39, Jim Nasby wrote: On 1/16/24 4:57 PM, Rob Sargent wrote:     Or perhaps you have to beef the sed up to use word boundaries just     in case. I'm not a Java web developer... 😁 You need to a

Re: Tips on troubleshooting slow DELETE (suspect cascades)

2024-01-18 Thread Rob Sargent
> On Jan 18, 2024, at 9:46 AM, Adrian Klaver wrote: > > On 1/18/24 08:37, Jim Vanns wrote: >> Hi Tom/Adrian. >> I should have already stated I did begin with EXPLAIN but given they >> don't easily work with (the internals) stored/procedures, it wasn't >> useful in this case. Also, I keep havi

Re: Mimic ALIAS in Postgresql?

2024-01-16 Thread Rob Sargent
On 1/16/24 17:39, Jim Nasby wrote: On 1/16/24 4:57 PM, Rob Sargent wrote:     Or perhaps you have to beef the sed up to use word boundaries just     in case. I'm not a Java web developer... 😁 You need to adjust you glasses if that's what you see me as. Reality is that bas

Re: Mimic ALIAS in Postgresql?

2024-01-16 Thread Rob Sargent
On 1/16/24 17:03, Ron Johnson wrote: On Tue, Jan 16, 2024 at 5:57 PM Rob Sargent wrote: On 1/16/24 15:39, Ron Johnson wrote: On Tue, Jan 16, 2024 at 5:31 PM Rob Sargent wrote: On 1/16/24 10:20, Ron Johnson wrote: Some RDBMSs have CREATE ALIAS, which allows you

Re: Mimic ALIAS in Postgresql?

2024-01-16 Thread Rob Sargent
On 1/16/24 15:39, Ron Johnson wrote: On Tue, Jan 16, 2024 at 5:31 PM Rob Sargent wrote: On 1/16/24 10:20, Ron Johnson wrote: Some RDBMSs have CREATE ALIAS, which allows you to refer to a table by a different name (while also referring to it by the original name). We have

Re: Mimic ALIAS in Postgresql?

2024-01-16 Thread Rob Sargent
On 1/16/24 10:20, Ron Johnson wrote: Some RDBMSs have CREATE ALIAS, which allows you to refer to a table by a different name (while also referring to it by the original name). We have an application running on DB2/UDB which (for reasons wholly unknown to me, and probably also to the current de

Re: Postgres Database Service Interruption

2024-01-16 Thread Rob Sargent
On 1/16/24 09:29, Bablu Kumar Nayak wrote: Dear PostgreSQL Team, I am writing to inform you that our PostgreSQL database service is currently down. We are experiencing an unexpected interruption, and we are seeking your expertise to help us resolve this issue promptly. We would greatly appr

Re: postgres sql assistance

2024-01-16 Thread Rob Sargent
On 1/16/24 06:00, Raul Giucich wrote: Hi Arun, can you share the sql used for this insert. Visually it seems some character are affecting the data. Best regards, Raul Raul, the OP attached the sq.

Re: Read write performance check

2023-12-19 Thread Rob Sargent
On 12/19/23 12:14, veem v wrote: Thank you for the confirmation.  So at first, we need to populate the base tables with the necessary data (say 100million rows) with required skewness using random functions to generate the variation in the values of different data types. Then in case of row b

Re: Fwd: Disable autocommit inside dbeaver

2023-12-06 Thread Rob Sargent
On 12/6/23 20:45, arun chirappurath wrote: Hi All, Is there a way we can disable autocommit option inside query writing area? Not by choosing auto commit from drop down menu. Thanks, Arun maybe "begin; ; commit;"

Re: postgres keeps having blocks

2023-10-18 Thread Rob Sargent
On 10/18/23 10:15, Adrian Klaver wrote: On 10/18/23 04:27, Shaozhong SHI wrote: My postgres is playing up. I terminated session that is causing blocks many time. New block appears. Endless. What should I do? Provide more information. 1) Postgres version. 2) Define what blocks means. 3)

Re: why generated columsn cannot be used in COPY TO?

2023-10-06 Thread Rob Sargent
> On Oct 6, 2023, at 7:47 AM, Tom Lane wrote: > > Luca Ferrari writes: >> I'm wondering why in COPY TO (file or program) I cannot use generated >> columns: since I'm pushing data out of the table, why they are not >> allowed? > > There's a comment about that in copy.c: > > * We don't includ

Re: Right version of jdbc

2023-09-28 Thread Rob Sargent
On 9/28/23 09:41, Raivo Rebane wrote: Now I changed the Postgres Server to version 15 and making Tomcat 9.0 project. Now I am using postgresql-42.6.0.jar driver, but Tomcat gives error : java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/mushroom_database What

Re: Right version of jdbc

2023-09-25 Thread Rob Sargent
On 9/25/23 06:38, Raivo Rebane wrote: Hi, now I use -               org.postgis         postgis-jdbc         1.3.3                 org.postgresql         postgresql         42.5.4       But I got error - Exception in thread "main" java.lang.NoSuchMethodError: 'org.postgresql.core.Encoding

Re: Accessing system information functions

2023-09-25 Thread Rob Sargent
On Sep 25, 2023, at 5:05 AM, Johnson, Bruce E - (bjohnson) wrote: Environment: Ubuntu 22.04 lts, postgres 15 installed via postgres.org repository I am attempting to use the system information functions here: https://www.postgresql.org/docs/15/functions-info.html I’m logged on as the pos

Re: Accessing system information functions

2023-09-25 Thread Rob Sargent
On Sep 25, 2023, at 5:05 AM, Johnson, Bruce E - (bjohnson) wrote: Environment: Ubuntu 22.04 lts, postgres 15 installed via postgres.org repository I am attempting to use the system information functions here: https://www.postgresql.org/docs/15/functions-info.html I’m logged on as the pos

Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL

2023-09-08 Thread Rob Sargent
On 9/7/23 23:51, Sai Teja wrote: Thank you so much for all your responses. I just tried with Hash, GIN etc But it didn't worked. And I think it is because of "Xpath" expression which I used in the index create command. But is there any alternative way to change this Xpath? Since I need to p

Re: Ynt: Pgbackrest Restore Error - Segmentation fault (core dumped)

2023-09-06 Thread Rob Sargent
On 9/6/23 11:27, pgdba pgdba wrote: I removed  it but I keep getting the same error OK.  The custom here is to put your response at the bottom  of short messages ("bottom post") or intermixed with original as appropriate on

Re: Pgbackrest Restore Error - Segmentation fault (core dumped)

2023-09-06 Thread Rob Sargent
On 9/6/23 05:08, pgdba pgdba wrote: Hello, when I restore with Pgbackrest, I get the following error, I couldn't find a solution when I researched, can you support? postgres@dev-test:~$ pgbackrest --config=/etc/pgbackrest/pgbackrest.conf --stanza=db3 --log-level-console=info --type=immediate

Re: Read only user permission

2023-08-23 Thread Rob Sargent
On 8/23/23 13:23, Hellen Jiang wrote: Sorry it is a typo in the email. My readonly role is dbreadonly. It works well so far except no access to new tables created by read write role. It has access to new tables created by admin role. I granted dbreadonly as the following: -- Read-only role

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

2023-08-21 Thread Rob Sargent
On 8/21/23 11:17, Edoardo Panfili wrote: Use the type appropriate getter, not getString, to retrieve the value of the underlying real typed column. I know, but in this occasion I need to use text value. Otherwise, I agree this seems like a bug, probably in the JDBC driver, though one pertain

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-17 Thread Rob Sargent
On 8/17/23 07:35, Sai Teja wrote: Hi Team, 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 once from large objects sele

Re: Converting sql anywhere to postgres

2023-08-16 Thread Rob Sargent
> On Aug 16, 2023, at 1:35 PM, Adrian Klaver wrote: > > On 8/16/23 12:01, Rob Sargent wrote: >> On 8/16/23 12:30, Guyren Howe wrote: >>> For some reason, I was thinking the rule could see just the fields from the >>> command, but you’re right; a rule won’t wo

Re: Converting sql anywhere to postgres

2023-08-16 Thread Rob Sargent
On 8/16/23 12:30, Guyren Howe wrote: For some reason, I was thinking the rule could see just the fields from the command, but you’re right; a rule won’t work. Sorry. Guyren G Howe On Aug 15, 2023 at 23:22 -0700, Russell Rose | Passfield Data Systems , wrote: I have just had a quick look at rul

Re: PostgreSQL and GUI management

2023-08-15 Thread Rob Sargent
On 8/15/23 12:57, Adrian Klaver wrote: On 8/15/23 11:43, Rob Sargent wrote: On 8/15/23 12:38, Adrian Klaver wrote: 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

Re: PostgreSQL and GUI management

2023-08-15 Thread Rob Sargent
On 8/15/23 12:38, Adrian Klaver wrote: 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: https://www.postgresql.org/docs/current/app-psql.html

Re: Dynamically accessing columns from a row type in a trigger

2023-08-14 Thread Rob Sargent
So the less obvious solution that works is to create a temporary table. A little verbose, but I get to keep the types. `CREATE TEMPORARY TABLE _ ON COMMIT DROP AS SELECT OLD.*;` _ as a table name makes things a little easier to type. Rhys Peace & Love | Live Long & Prosper If the connectio

Re: Fatal Error : Invalid Memory alloc request size 1236252631

2023-08-14 Thread Rob Sargent
On 8/14/23 09:29, Sai Teja wrote: Could anyone please suggest any ideas to resolve this issue. I have increased the below parameters but still I'm getting same error. work_mem, shared_buffers Out of 70k rows in the table only for the few rows which is of large size (700MB) getting the issue.

Re: Effects of dropping a large table

2023-07-19 Thread Rob Sargent
On 7/19/23 17:15, David Rowley wrote: On Wed, 19 Jul 2023 at 07:41, Rob Sargent wrote: You might consider deleting portions of the table in separate (consecutive) batches (maybe 5% per delete). And then truncate table is not logged so that might be an alternative. Can you explain why this

Re: Effects of dropping a large table

2023-07-18 Thread Rob Sargent
On 7/18/23 11:58, Devin Ivy wrote: Hi all, I'm hoping to ensure I understand the implications of dropping a large table and the space being reclaimed by the database and/or OS.  We're using pg v14. This table is quite large with a primary key and one additional index—all together these are o

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

2023-06-09 Thread Rob Sargent
> On Jun 8, 2023, at 8:21 PM, Nim Li wrote: > > Hello. > > We have a PostgreSQL database with many tables, as well as foreign table, > dblink, triggers, functions, indexes, etc, for managing the business logics > of the data within the database. We also have a custom table for the purpose

Re: speed up full table scan using psql

2023-05-30 Thread Rob Sargent
On 5/30/23 22:25, Lian Jiang wrote: hi, I am using psql to periodically dump the postgres tables into json files which are imported into snowflake. For large tables (e.g. 70M rows), it takes hours for psql to complete. Using spark to read the postgres table seems not to work as the postgres r

Re: Would PostgreSQL 16 native transparent data encryption support database level encryption?

2023-05-18 Thread Rob Sargent
On 5/18/23 11:49, Ron wrote: On 5/18/23 10:54, Stephen Frost wrote: Greetings, * Tony Xu (tony...@rubrik.com) wrote: The FAQ (copied below) mentioned that native transparent data encryption might be included in 16. Is it fair to assume that it will support database level encryption, that is, w

Re: Regarding SSL Enablement in PostgreSQL Database on different port

2023-05-02 Thread Rob Sargent
On 5/2/23 13:15, Tomas Pospisek wrote: Oh, I think your idea to use pgbouncer to take care of the SSL termination is elegant. I don't think me I'd characterize it as a hack if properly set up. Why do you consider it a hack? *t Let me guess:  postgres IS NOT listening on the other port, pgb

Re: Postgres query doesn't accept double quote around schema name in query statement

2023-04-27 Thread Rob Sargent
> On Apr 27, 2023, at 12:40 PM, Michael Xu wrote: > >  > Hi, > > By default, pgsql accepts double quotes around schema's name in a query, e.g. > select * from "ads"."MyTableName". In our env, it throws 42P01:relation > "ads.MyTableName" does not exist. It is okay if no double quote around s

Re: Guidance on INSERT RETURNING order

2023-04-12 Thread Rob Sargent
This would be a nice solution… but the PK could be always generated, or not even sequential (UUIDs for example). If you’re developing schema-first the application would not even (need to) know about how the IDs are generated as it’s the DB that generates them. AIUI the OP’s an SQLAlchemy devel

Re: TEXT column > 1Gb

2023-04-12 Thread Rob Sargent
On 4/12/23 15:03, Joe Carlson wrote: On Apr 12, 2023, at 12:21 PM, Rob Sargent wrote: On 4/12/23 13:02, Ron wrote: /Must/ the genome all be in one big file, or can you store them one line per table row? The assumption in the schema I’m using is 1 chromosome per record. Chromosomes are

Re: TEXT column > 1Gb

2023-04-12 Thread Rob Sargent
On 4/12/23 13:02, Ron wrote: /Must/ the genome all be in one big file, or can you store them one line per table row? Not sure what OP is doing with plant genomes (other than some genomics) but the tools all use files and pipeline of sub-tools.  In and out of tuples would be expensive.  Very,v

Re: TEXT column > 1Gb

2023-04-12 Thread Rob Sargent
On 4/12/23 11:24, Benedict Holland wrote: For documents that long I would seriously consider using large objects and refencing them with their OIDs. Text fields get put in a special location within the database. It's similar (possibly exactly) to using large objects. Also, you can potentially c

Re: TEXT column > 1Gb

2023-04-12 Thread Rob Sargent
On 4/12/23 08:59, Joe Carlson wrote: I’m curious what you learned. I’ve been tripping over the buffer allocation issue when either splitting input text into chunks or aggregating chunks in selects. I’ve decided that I need to move this to client side. The use case is genomics. Extracting subs

Re: Guidance on INSERT RETURNING order

2023-04-11 Thread Rob Sargent
Can your client retain a hashmap of md5,data pairings, allowing the lookup on the way back using the returned data and supplied id? When using unique columns or similar, that's something that is done, but if there are no unique columns in the value no match can be done reliably with the sourc

Re: Guidance on INSERT RETURNING order

2023-04-11 Thread Rob Sargent
On 4/11/23 14:37, Federico wrote: The problem here is not having the auto increment id in a particular order, is that there is apparently no correlation with the position of an element in the values clause with the id generated. That's the reason for using the sentinel column in the general solu

Re: TEXT column > 1Gb

2023-04-11 Thread Rob Sargent
On 4/11/23 11:41, Joe Carlson wrote: 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. We can debate whether or not saving something this big in

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

2023-04-09 Thread Rob Sargent
On 4/9/23 19:55, Louis Tian wrote: Hi Alban, "I am not expecting an error here", by "here" I means when doing a TRUE UPSERT (an upsert current does not exist in Postgres). I am NOT referring to an "Insert on conflict do update" (which despite its intention and wide acceptance is not fully equi

Re: Cluster table based on grand parent?

2023-03-28 Thread Rob Sargent
On 3/28/23 10:28, Dominique Devienne wrote: On Tue, Mar 28, 2023 at 6:06 PM Ron wrote: You can only get from parent to grandchild via//child.id to grandchild.parent, so why not cluster grandchild on grandchild.parent? Hi. I don't understand your question. Yes, of

Re: psql \copy with multi-line query

2023-03-24 Thread Rob Sargent
On 3/24/23 17:14, David G. Johnston wrote: On Fri, Mar 24, 2023 at 4:04 PM Rob Sargent wrote: Using version 13 psql on version 14 server and having trouble sending a multi-line select in the \copy.  I don't see any remark about this in the man page. The copy meta-command c

psql \copy with multi-line query

2023-03-24 Thread Rob Sargent
Using version 13 psql on version 14 server and having trouble sending a multi-line select in the \copy.  I don't see any remark about this in the man page. \copy ( select a.mrn, a.relationship,a.relation_mrn,a.provided_relationship from actual_and_inf_rel_part1_unique_clean a join family_ids f

Re: Converting row elements into a arrays?

2023-03-02 Thread Rob Sargent
On 3/2/23 14:49, Ron wrote: On 3/2/23 15:45, Rob Sargent wrote: On 3/2/23 13:58, Ron wrote: Postgresql 12.13 Given the sample below, I'm looking for how to generate this output.  It's like GROUP BY, but generating an array instead of an aggreate number.  f1 | f2_array +-

Re: Converting row elements into a arrays?

2023-03-02 Thread Rob Sargent
On 3/2/23 13:58, Ron wrote: Postgresql 12.13 Given the sample below, I'm looking for how to generate this output.  It's like GROUP BY, but generating an array instead of an aggreate number.  f1 | f2_array +- 1 | {1,2,3}   2 | {1,2,3,4}   3 | {1,2} The ultimate goal is to somehow

Re: Quit currently running query

2023-02-28 Thread Rob Sargent
On 2/28/23 03:53, Albert Cornelius wrote: How can I quit a currently running query? I've issued a query and my server does not respond anymore. Is there another solution than using kill -9? can you open another psql session to your server?

curiosity in default column header

2023-02-24 Thread Rob Sargent
riftehr=> select ascii(substring('sadb', 2,1));  ascii ---     97 (1 row) riftehr=> select 24::bit(8);    bit --  00011000 (1 row) riftehr=> select ascii(substring('sadb', 2,1))::bit(8);   ascii --  0111 (1 row) Why is the last one headed "ascii" and not "bit"?

Re: Query plan for "id IS NULL" on PK

2023-02-14 Thread Rob Sargent
On 2/14/23 15:43, Peter J. Holzer wrote: On 2023-02-14 15:36:32 -0700, Rob Sargent wrote: But if the query is supposed to be generic and re-used in a situation where id could be null, wouldn't the null id records be fetched every time? No, they will never be fetched because of the AND

Re: Query plan for "id IS NULL" on PK

2023-02-14 Thread Rob Sargent
On 2/14/23 15:30, David G. Johnston wrote: On Tue, Feb 14, 2023 at 3:25 PM Rob Sargent wrote: When will id be null in a primary key? The OP seems to be aware of this... "We cannot change the query being executed. Is there any way we can make the query planner ignore `OR (id IS

Re: Query plan for "id IS NULL" on PK

2023-02-14 Thread Rob Sargent
On 2/14/23 15:04, Ben Chrobot wrote: Hello, Long time listener, first time caller. We have a large table (~470 million rows) with integer primary key id (not null) on a Postgres 14.5 cluster. A third-party tool is attempting to perform a SELECT-based full table copy in preparation for log-ba

pro services list

2023-02-14 Thread Rob Sargent
Is this the place for suggestions for postgres.org? I had occasion yesterday to visit the page of available support companies.  I see it's sorted alphabetically.  Does that tend to favour the "A"s?  Thinking of Yellow Page (tangible, phone company version) listings like " knife sharpening"

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

2023-02-13 Thread Rob Sargent
On 2/13/23 21:35, Damian Carey wrote: Tom, Rob & Adrian, I understand exactly what each of you are getting at, but instead of fumbling and further wasting your time I'm going to get a freelancer to smash out a suitable setup sans beginner mistakes. It's a pretty basic problem for a learned co

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

2023-02-13 Thread Rob Sargent
On 2/13/23 16:14, Damian Carey wrote: Thx Tom Fine advice that I will follow up. One tiny thing without wasting (too much) more of your time. In the working "promiscuous" version they get access the VPS as the same linux user that my product is running on, and superuser PG access. In the fa

Re: psql "\d" no longer working

2023-02-12 Thread Rob Sargent
I doubt that is the problem as the issue is the column in the table not finding the table. pg_class.relhasoids no longer exists 12+, so the post from Georg is probably pointing in the right direction. Ah, yes.  My client machine at compute centre has to be told to put version 14 on the p

psql "\d" no longer working

2023-02-12 Thread Rob Sargent
Seems I've lost the table definition meta-command riftehr=> \d actual_and_inf_rel_clean_final ERROR:  column c.relhasoids does not exist LINE 1: ..., c.relhasindex, c.relhasrules, c.relhastriggers, c.relhasoi... while listing tables still works riftehr=> \dt act* List of rela

Re: Quoting issue from ODBC

2023-02-07 Thread Rob Sargent
On 2/7/23 17:23, David G. Johnston wrote: On Tue, Feb 7, 2023 at 5:20 PM Brad White wrote: For example, this is the literal code in VBA Access: connection.Execute "UPDATE [" & strTable & "] SET [" & strTable & "].[InsertFlag] = Null" _     & " WHERE ((([" & strTable & "].[Inser

Re: Sequence vs UUID

2023-02-02 Thread Rob Sargent
> On Feb 2, 2023, at 1:26 PM, Benedict Holland > wrote: > >  > No idea at all. We had the data for the insert and had to insert it again. It > was extremely confusing but oh boy did it wreck our systems. > > Thanks, > Ben Someone has a baked-in uuid in a script I suspect. >

Re: nextval per counted

2023-01-27 Thread Rob Sargent
On 1/27/23 14:31, David G. Johnston wrote: On Fri, Jan 27, 2023 at 2:25 PM Rob Sargent wrote: On 1/27/23 14:20, David G. Johnston wrote: On Fri, Jan 27, 2023 at 1:59 PM Rob Sargent wrote: I'm trying to craft SQL to invoke a sequence nextval once per grouped

Re: nextval per counted

2023-01-27 Thread Rob Sargent
On 1/27/23 14:20, David G. Johnston wrote: On Fri, Jan 27, 2023 at 1:59 PM Rob Sargent wrote: I'm trying to craft SQL to invoke a sequence nextval once per grouped value. This seems like a very unusual usage of nextval/sequences... with cleanup as (   select DISTINCT e.ma

nextval per counted

2023-01-27 Thread Rob Sargent
I'm trying to craft SQL to invoke a sequence nextval once per grouped value. So far I have this: with husb as( select e.ma, count(distinct coalesce(e.pa, nextval('egogen')::text)) as mates from emp_all_by3 e group by e.ma order by mates ) select mates, count(*) from husb

Re: Sequence vs UUID

2023-01-27 Thread Rob Sargent
> So forget about performance issues (there will ALWAYS be need for faster > systems). The ease and functionality with UUID > is so mutch better. Sequence keys are a terrible idea! > > // GH > Wow. I am not alone >

Re: Sequence vs UUID

2023-01-26 Thread Rob Sargent
On 1/26/23 14:36, Merlin Moncure wrote: 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

Re: Tools for moving normalized data around

2023-01-18 Thread Rob Sargent
On 1/18/23 13:15, Gavan Schneider wrote: On 19 Jan 2023, at 6:47, Peter wrote: Now I want to grab some part of the data, on a certain condition (let's say all records belonging to user 'Bob', if there is a "user" table somewhere at the tree-bottom), and move it to another database with the very

Re: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?

2023-01-18 Thread Rob Sargent
On 1/18/23 09:38, HECTOR INGERTO wrote: I wanted to understand the underlying issue. I use ZFS snapshots instead of a “correct” backup because with only two machines it allows me to have backups in the main machine and in the secondary too that acts as hotspare at the same time. To accompli

Re: Why is a Read-only Table Gets Autovacuumed "to prevent wraparound"

2023-01-16 Thread Rob Sargent
On 1/16/23 14:18, Ron wrote: On 1/16/23 07:11, Laurenz Albe wrote: On Mon, 2023-01-16 at 07:48 -0500, Fred Habash wrote: This is a puzzle I have not been able to crack yet. We have a single-page table with 28 rows that is purely read-only. There isn't a way in postgres to make a table RO, but

Re: What is the best setup for distributed and fault-tolerant PG database?

2023-01-04 Thread Rob Sargent
On 1/4/23 06:26, Age Apache wrote: Dear PG experts, I am new to postgres, and I am also not a DBA. I am a solo developer who is trying to evaluate what database to use for my hybrid multi-tenancy sub-apps i.e. users of the application will be authorised to use part or whole of the application

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

2023-01-01 Thread Rob Sargent
On 1/1/23 14:48, Adrian Klaver wrote: On 1/1/23 13:11, Antonis Christodoulou wrote: Hello Adrian, No it’s not open, but the database itself has very simple credentials (I am just starting with PostgreSQL). What’s weird about the logs? Not the logs the ps output. I would expect to see somethi

Re: integer square root function proposed

2022-12-17 Thread Rob Sargent
On 12/17/22 20:40, Martin L. Buchanan wrote: Dear Rob and all readers: Generating prime numbers is one example where you use integer square root in the inner loop, going from integer to integer. Calculating an integer square root from an integer input may have a more efficient algorithm than

Re: integer square root function proposed

2022-12-17 Thread Rob Sargent
On 12/17/22 19:39, Martin L. Buchanan wrote: Dear PostgreSQL colleagues: I have just joined this, my first PG mailing list. Reading the documentation I found no built-in function for integer square root, requiring a sequence of: floor(sqrt(foo))::integer to go from an integer to the integer

Re: collect2: error: ld returned 1 exit status

2022-11-26 Thread Rob Sargent
header files for libpq5 (PostgreSQL library), the package is broken. -- With kindest regards, William.⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org⠈⠳⣄ I’m confused. Is that  ‘package is broken’ coming from dpkg. 

Re: collect2: error: ld returned 1 exit status

2022-11-26 Thread Rob Sargent
On Nov 26, 2022, at 4:17 PM, William Torrez Corea wrote:On Sat, Nov 26, 2022 at 5:00 PM Rob Sargent <robjsarg...@gmail.com> wrote:On Nov 26, 2022, at 3:43 PM, William Torrez Corea <willitc9...@gmail.com> wrote:I am using libpq: the C application programmer's interface to Postgr

Re: collect2: error: ld returned 1 exit status

2022-11-26 Thread Rob Sargent
> On Nov 26, 2022, at 3:43 PM, William Torrez Corea > wrote: > >  > I am using libpq: the C application programmer's interface to PostgreSQL. > > Compile the code: > >> sudo cc -o testprog testprog1.o testprog2.o -L/usr/local/pgsql/lib -lpq > > But i get the following error: > >> collect

Re: An I/O error occured while sending to the backend

2022-11-16 Thread Rob Sargent
On 11/16/22 00:37, gzh wrote: Thank you very much for your advice. What I don't understand is that there is no problem when executing ① alone or ② alone, the error occurs when ① and ② are executed together . It works well when i let the application sleep after ① for 10 seconds before executin

Re: reviving "custom" dump

2022-11-10 Thread Rob Sargent
On 11/10/22 23:29, David G. Johnston wrote: On Thu, Nov 10, 2022 at 11:13 PM Rob Sargent wrote: Short version: Does a current version of postgres tolerate ascii dumps from older versions? I've been charged with reviving an old project.  I have a dump dated July of 2021

Re: reviving "custom" dump

2022-11-10 Thread Rob Sargent
On 11/10/22 23:29, Tom Lane wrote: Rob Sargent writes: Short version: Does a current version of postgres tolerate ascii dumps from older versions? We intend it to. Have you got an actual problem? regards, tom lane I have to lay out options in the morning.  Thanks

reviving "custom" dump

2022-11-10 Thread Rob Sargent
Short version: Does a current version of postgres tolerate ascii dumps from older versions? I've been charged with reviving an old project.  I have a dump dated July of 2021 which file tells me is a "PostgreSQL custom database dump V1.13-0".  If our compute centre won't roll me a V12(?) postgr

Re: Setting up replication on Windows, v9.4

2022-11-07 Thread Rob Sargent
On 11/7/22 13:59, Brad White wrote: > v9.4 has been EOL for 2 years 9 months. As I said, the next step will be to upgrade. It would make sense to upgrade first, since "there have been some big advances since then which make replication much easier" But when we upgraded, the app stopped w

Re: copy file from a client app to remote postgres isntance

2022-11-07 Thread Rob Sargent
On 11/7/22 10:51, Вадим Самохин wrote: Well, actually, just ordinary 3 tier architecture. Simple UI connected via restful API with backend written in php, which copies some data in a remote database, that's pretty much it. пн, 7 нояб. 2022 г. в 20:30, Rob Sargent : On 11/7/22

  1   2   3   4   5   6   7   >