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: select (17, 42)::s.t2 into... fails with "invalid input syntax"

2023-03-08 Thread David G. Johnston
On Wed, Mar 8, 2023 at 7:58 PM Bryn Llewellyn wrote: > > r := (my_c1, my_c2)::s.t; > If you write s.x there it will also work. Your first and third assignments are identical in syntax/nature. These are both the first examples here[1] Yes, the behavior of INTO in the second assignment is s

Blog post series on commitfests and patches

2023-03-08 Thread Chris Travers
Hi all; I have been writing a few blog posts trying to shed some light on the development process of PostgreSQL , what's coming and what I hope we see more of. I would be very much interested in feedback as to whether people (particularly non-Postgres contributors) find this useful or not. The l

Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"

2023-03-08 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > >> b...@yugabyte.com writes: >>select (17, 42)::s.t2 into r2; >> [ doesn't work ] > > This would work as > > select 17, 42 into r2; > > In general, SELECT INTO with a composite target expects to see a source > column per target field. If you want to assign a

Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"

2023-03-08 Thread Tom Lane
Bryn Llewellyn writes: > select (17, 42)::s.t2 into r2; > [ doesn't work ] This would work as select 17, 42 into r2; In general, SELECT INTO with a composite target expects to see a source column per target field. If you want to assign a composite value to the whole target, don't use

Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"

2023-03-08 Thread David G. Johnston
On Wed, Mar 8, 2023 at 5:41 PM Bryn Llewellyn wrote: > > select (((17, 42)::s.t2)::text)::s.t2 into r2; > > then I'm back to the same 22P02 error: > > invalid input syntax for type integer: "(17,42)" > > Single quotes. SELECT '(17,42)'::s.t2; David J.

select (17, 42)::s.t2 into... fails with "invalid input syntax"

2023-03-08 Thread Bryn Llewellyn
I have a horrible feeling that I'm missing the blindingly obvious here. But I can't spot it. Help! This simple setup produces the expected result: create type s.t1 as (c1 text, c2 text); select ('cat', 'dog')::s.t1; This is the result: (cat,dog) create type s.t2 as (c1 int, c2 int); select

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

2023-03-08 Thread Ron
On 3/8/23 15:29, Bryn Llewellyn wrote: [snip] create table s.t(k int primary key, c1 int, c2 int, c3 int); insert into s.t(k, c1, c2, c3) values(1, 17, 42, 57); create type s.x as (c1 int, c2 int, c3 int); [snip] This is an excellent analysis. Native PG doesn't provide much metadata or tool

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

2023-03-08 Thread Bryn Llewellyn
> 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 record the current tupdesc ID, so we can detect

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

2023-03-08 Thread Siddharth Jain
Thanks Tom. found the problem. On Tue, Mar 7, 2023 at 8:28 PM Tom Lane wrote: > 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