Re: Psql wants to use IP6 when connecting to self using tcp...

2021-06-24 Thread Tom Lane
"Peter J. Holzer" writes: > On 2021-06-23 20:33:33 -0400, Tom Lane wrote: >> It's quite odd that nslookup isn't agreeing with glibc's name >> resolution code. > AFAIK nslookup uses only DNS. Glibc uses all methods in nsswitch.conf. Ah, right. So looking at a Fedora 34 installation, I see in /et

Re: Psql wants to use IP6 when connecting to self using tcp...

2021-06-24 Thread Peter J. Holzer
On 2021-06-23 20:33:33 -0400, Tom Lane wrote: > Jerry LeVan writes: > > bigbox has a freshly installed Fedora 34 system and it runs postgresql 13.3 > > > the following are being run ON bigbox > > > nslookup bigbox returns the correct ipv4 address > > nslookup bigbox.skynet returns the correct i

Re: OSX: migrating Postgres db from one Mac to another

2021-06-24 Thread Adrian Klaver
On 6/24/21 6:53 AM, Carlo Poso wrote: Hello, my Mac unfortunately crashed. I have a Time Machine backup. Using the Migration Assistant on a new Mac allowed me to get all my documents back, but unfortunately Postgres is not able to start. So I was trying to manually set-up my Postgres db. Here a

Re: OSX: migrating Postgres db from one Mac to another

2021-06-24 Thread Tom Lane
Carlo Poso writes: > The message I get after entering the PW is "could not connect to server: > Connection refused Is the server > running on host "localhost" (::1) and accepting TCP/IP connections on port > 5432? could not connect to server: Connection refused Is the server running > on host "loc

Re: insert ..... returning problem

2021-06-24 Thread Michael Ivanov
I was just trying to use it similar to oracle handling in "returning COLUMN into :VAR" So in postgres I should not explicitly specify destination variable for 'returning' value in query itself, but rather retrieve the result from PGresult returned by PQexec(). ok, thanks for clarification! On 2

Re: How much data does server side "loread" return?

2021-06-24 Thread Laurenz Albe
On Thu, 2021-06-24 at 15:24 +0200, Thorsten Schöning wrote: > I need to read some large object and am wondering how much data > "loread" returns in case it successfully reads at all AND the object > contains at least as much data as requested. > > In that case, does "loread" always return the requ

Re: removing "serial" from table definitions.

2021-06-24 Thread Tom Lane
Marc Mamin writes: > Yes, I undersand that serial is just a hint at table creation time, but is > there a place in catalog where we can see if the table was created using > 'serial' ? No. Where the docs say "these are equivalent", they mean that very literally. > The difference we see between

Re: OSX: migrating Postgres db from one Mac to another

2021-06-24 Thread Carlo Poso
Thanks. The message I get after entering the PW is "could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) an

Re: insert ..... returning problem

2021-06-24 Thread Laurenz Albe
On Thu, 2021-06-24 at 16:25 +0300, Michael Ivanov wrote: > > > I'm trying to insert a record returning column value using the following > > > query: > > > > > >INSERT INTO t_load (load_id, load_type) VALUES (:id, :typ) returning > > > load_idx INTO :idx > > > > > > But when I try to prepare

RE: removing "serial" from table definitions.

2021-06-24 Thread Marc Mamin
>serial is not an actual data type -- it is essentially an integer with a >default and an automatically created sequence. See: >> >>https://www.postgresql.org/docs/13/datatype-numeric.html#DATATYPE-SERIA >>L > >Yes, I undersand that serial is just a hint at table creation time, but is >there a pl

Re: OSX: migrating Postgres db from one Mac to another

2021-06-24 Thread Дмитрий Иванов
# -*- coding: utf-8 -*- ## # # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2021, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # # config.py - Core application configuration se

OSX: migrating Postgres db from one Mac to another

2021-06-24 Thread Carlo Poso
Hello, my Mac unfortunately crashed. I have a Time Machine backup. Using the Migration Assistant on a new Mac allowed me to get all my documents back, but unfortunately Postgres is not able to start. So I was trying to manually set-up my Postgres db. Here are the steps: - install a fresh copy of

Re: insert ..... returning problem

2021-06-24 Thread Sándor Daku
On Thu, 24 Jun 2021 at 15:25, Michael Ivanov wrote: > Hallo, no. > > I am using postgres c library, namely I'm calling PQexec() > > Best regards, > > On 24.06.2021 16:14, Laurenz Albe wrote: > > On Thu, 2021-06-24 at 12:31 +0300, Michael Ivanov wrote: > >> I'm trying to insert a record returning

OSX: migrating Postgres db from one Mac to another

2021-06-24 Thread Carlo Poso
Hello, my Mac unfortunately crashed. I have a Time Machine backup. Using the Migration Assistant on a new Mac allowed me to get all my documents back, but unfortunately Postgres is not able to start. So I was trying to manually set-up my Postgres db. Here are the steps: - install a fresh copy

RE: removing "serial" from table definitions.

2021-06-24 Thread Marc Mamin
From: Joe Conway [mailto:m...@joeconway.com] >Sent: Donnerstag, 24. Juni 2021 14:47 >To: Marc Mamin ; pgsql-general > >Subject: Re: removing "serial" from table definitions. > >On 6/24/21 8:33 AM, Marc Mamin wrote: >> Hi, >> >> Is there a way to change a data type from serial to int? >> >> I t

Re: insert ..... returning problem

2021-06-24 Thread Michael Ivanov
Hallo, no. I am using postgres c library, namely I'm calling PQexec() Best regards, On 24.06.2021 16:14, Laurenz Albe wrote: > On Thu, 2021-06-24 at 12:31 +0300, Michael Ivanov wrote: >> I'm trying to insert a record returning column value using the following >> query: >> >>INSERT INTO t_lo

How much data does server side "loread" return?

2021-06-24 Thread Thorsten Schöning
Hi all, I need to read some large object and am wondering how much data "loread" returns in case it successfully reads at all AND the object contains at least as much data as requested. In that case, does "loread" always return the requested amount of data or does one need to always loop when cal

Re: insert ..... returning problem

2021-06-24 Thread Laurenz Albe
On Thu, 2021-06-24 at 12:31 +0300, Michael Ivanov wrote: > I'm trying to insert a record returning column value using the following > query: > >INSERT INTO t_load (load_id, load_type) VALUES (:id, :typ) returning > load_idx INTO :idx > > But when I try to prepare the query I'm getting the f

insert ..... returning problem

2021-06-24 Thread Michael Ivanov
Greetings! I'm trying to insert a record returning column value using the following query: INSERT INTO t_load (load_id, load_type) VALUES (:id, :typ) returning load_idx INTO :idx But when I try to prepare the query I'm getting the following error: PREPARE p1515544c0001 AS insert into

Re: second CTE kills perf

2021-06-24 Thread Nicolas Seinlet
Hi, thanks for all. I replaced row_number() with some computed int which speeds up a lot the query. ‐‐‐ Original Message ‐‐‐ On Tuesday, June 22nd, 2021 at 15:53, Tom Lane wrote: > Nicolas Seinlet nico...@seinlet.com writes: > > > I'm trying to understand this behaviour and the limi

Re: removing "serial" from table definitions.

2021-06-24 Thread Joe Conway
On 6/24/21 8:33 AM, Marc Mamin wrote: Hi, Is there  a way to change a data type from serial to int? I tried with :   ALTER TABLE "admin".db_jobs ALTER COLUMN id TYPE int USING id::int; But this seems not to change anything, as if Posgres woud consider the statement as a no-op. serial is n

Re: removing "serial" from table definitions.

2021-06-24 Thread Johannes Paul
>From what I know, serial is just used to setup a table but it is then converted to int in the table. Therefore, you probably cannot remove it since it is not there any more anyway. To setup table with int instead of serial, you could use this: CREATE SEQUENCE table_name_id_seq; CREATE TABLE tab

removing "serial" from table definitions.

2021-06-24 Thread Marc Mamin
Hi, Is there a way to change a data type from serial to int? I tried with : ALTER TABLE "admin".db_jobs ALTER COLUMN id TYPE int USING id::int; But this seems not to change anything, as if Posgres woud consider the statement as a no-op. My problem is that "serial" is not exported with pg_dump.

Re: Postgres PANIC when it could not open file in pg_logical/snapshots directory

2021-06-24 Thread Vijaykumar Jain
On Thu, Jun 24, 2021, 9:28 AM Mike Yeap wrote: > Hi Vijay, thanks for the tests, it's very helpful. > > Just that, isn't it too extreme when one of the processes having problems > accessing a snap file, it causes all other processes to be terminated? > After all, most of the other processes do no

Re: [SPAM] Re: How to hash a large amount of data within Postgres?

2021-06-24 Thread Thorsten Schöning
Guten Tag Tomas Vondra, am Donnerstag, 24. Juni 2021 um 00:56 schrieben Sie: > Not sure where you searched, but there definitely are interfaces to read > chunks of data from large objects - see this: That wasn't the point, but the lack of HASH-functions working with such read blocks of larger dat