escape vs. bytea in config

2023-03-07 Thread Mathias Mayrhofer
Dear Supportlist, I came across the "bytea_output" configuration variable inside postgresql.conf. It seems to be affecting the "digest" function, but in a way I cannot understand. When my postgresql 14 server executes the digest function, it considers the "bytea_output" variable, but the out

Re: escape vs. bytea in config

2023-03-07 Thread Laurenz Albe
On Tue, 2023-03-07 at 11:53 +0100, Mathias Mayrhofer wrote: > -- /etc/postgresql/14/main/postgresql.conf > -- bytea_output = 'escape' > > db=> select encode(digest('mtmayr', 'sha256'), 'escape'); > ┌┐ > │

Re: escape vs. bytea in config

2023-03-07 Thread Peter J. Holzer
On 2023-03-07 11:53:29 +0100, Mathias Mayrhofer wrote: > I came across the "bytea_output" configuration variable inside > postgresql.conf. > It seems to be affecting the "digest" function, but in a way I cannot > understand. No, it just affects the way bytea values are displayed. The return valu

psql \conninfo in tabular form?

2023-03-07 Thread Ron
v13.10 Instead of a sentence like this: You are connected to database "postgres" as user "postgres" via socket in "/var/run/postgresql" at port "5433". I'd rather have something tabular like:    keyword  |   value +---   database  | postgres   user      | postgr

Re: psql \conninfo in tabular form?

2023-03-07 Thread Erik Wienhold
> On 07/03/2023 18:58 CET Ron wrote: > > v13.10 > > Instead of a sentence like this: > You are connected to database "postgres" as user "postgres" via socket in > "/var/run/postgresql" at port "5433". > > I'd rather have something tabular like: >    keyword  |   value > +-

Re: garbage data back

2023-03-07 Thread Brad White
David, Thanks! 'EXPLAIN ANALYZE' is very slick. Promises to be very helpful. As soon as I saw the output, it was obvious where my problem was. Brad. On Mon, Mar 6, 2023 at 2:30 PM David G. Johnston wrote: > On Mon, Mar 6, 2023 at 1:18 PM Brad White wrote: > >> >> As you can see here, when att

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

2023-03-07 Thread Bryn Llewellyn
I copied my self-contained testcase, and its output (using PG Version 15.2), at the end. I read the doc section "43.11. PL/pgSQL under the Hood": www.postgresql.org/docs/15/plpgsql-implementation.html Is my mental model, describe

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

2023-03-07 Thread David G. Johnston
On Tue, Mar 7, 2023 at 1:24 PM Bryn Llewellyn wrote: > create table s.t(k serial primary key, v text); > create function s.f(k_in in int) > select s.f(1); > text, function is now compiled with that type resolution fixed. I think mostly attributable to: > The mutable nature of record variables p

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

2023-03-07 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> create table s.t(k serial primary key, v text); >> create function s.f(k_in in int) >> select s.f(1); > > text, function is now compiled with that type resolution fixed. > I think mostly attributable to: > > > The mutable n

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

2023-03-07 Thread David G. Johnston
On Tue, Mar 7, 2023 at 5:52 PM Bryn Llewellyn wrote: > > Regard a DDL on any object that an application uses as unsafe while the > app is in use. You must terminate all client-sessions before doing such a > DDL and re-start them only when all such DDLs are done successfully. > > No. If you simpl

could not bind IPv4 address "127.0.0.1": Address already in use

2023-03-07 Thread Siddharth Jain
Hi All, I am trying to run Postgres 14 on a Mac OS. I installed Postgres from EDB and ran initdb and it gave me this: ❯ initdb The files belonging to this database system will be owned by user "xxx". This user must also own the server process. The database cluster will be initialized with locale

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

2023-03-07 Thread David G. Johnston
(adding back the list) On Tue, Mar 7, 2023 at 8:24 PM David G. Johnston wrote: > On Tue, Mar 7, 2023 at 7:54 PM Bryn Llewellyn wrote: > >> >> > This is what I expected actually, though I can't point to exactly why. > >> >> Where can I read what I need in order to understand the difference here,

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

2023-03-07 Thread David G. Johnston
Forwarding this to the list; Note the potential bug found at the end. My actual follow-on reply notes the lack of documentation regarding the composite cache-checking behavior (relative to the non-composite situation) -- Forwarded message - From: David G. Johnston Date: Tue, Mar

Re: could not bind IPv4 address "127.0.0.1": Address already in use

2023-03-07 Thread Tom Lane
Siddharth Jain writes: > But when I try to start the server I get this: > 2023-03-07 17:16:43.228 PST [25925] LOG: could not bind IPv6 address > "::1": Address already in use > 2023-03-07 17:16:43.228 PST [25925] HINT: Is another postmaster already > running on port 5432? If not, wait a few sec

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

2023-03-07 Thread Tom Lane
"David G. Johnston" writes: > 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 record the current tupdesc ID, so we can detect changes > * (including drops). We don't currently

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

2023-03-07 Thread David G. Johnston
On Tue, Mar 7, 2023 at 9:49 PM Tom Lane wrote: > "David G. Johnston" writes: > > 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 record the current tupdesc ID, so we

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

2023-03-07 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >>> david.g.johns...@gmail.com wrote: >>> b...@yugabyte.com wrote: Regard a DDL on any object that an application uses as unsafe while the app is in use. You must terminate all client-sessions before doing

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

2023-03-07 Thread David G. Johnston
On Tue, Mar 7, 2023 at 10:19 PM Bryn Llewellyn wrote: > Why not err on the side of caution and (I trust) guaranteed currency of > each session's in-memory representation of a PL/pgSQL program with the > environment in which it executes? > > After all, you add a column in order to use it. And this