Re: Description field for tables and views

2024-07-03 Thread Christophe Pettus
> On Jul 3, 2024, at 13:24, Kent Dorfman wrote: > Is it SQL standard or postgres specific? It's not in the SQL standard (at the bottom of each page for each SQL command is a note regarding its relationship with the SQL standard). Other DBMS implement something similar, however.

Re: Description field for tables and views

2024-07-03 Thread Kent Dorfman
On 7/3/24 15:30, Christophe Pettus wrote: On Jul 3, 2024, at 12:28, Kent Dorfman wrote: Is there any psql function/command to add a description field to a table or view definition in the system? Allow me to introduce you to my good friend "COMMENT": https://www.postgresql.org/docs/

Re: Description field for tables and views

2024-07-03 Thread Achilleas Mantzios
Στις 3/7/24 22:28, ο/η Kent Dorfman έγραψε: I think I already know the answer but asking here is probably quicker turnaround than researching it. I've gotten into a "view bloat" scenario with many many custom views that I cannot remember what they actually do.  Is there any psql function/comm

Can't dump new-style sequences independently from their tables.

2024-07-03 Thread Christophe Pettus
Quick example: xof=# CREATE TABLE t1 (id SERIAL PRIMARY KEY); CREATE TABLE xof=# CREATE TABLE t2 (id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY); CREATE TABLE xof=# \d+ List of relations Schema | Name| Type | Owner | Persistence | Access meth

Re: Description field for tables and views

2024-07-03 Thread Guyren Howe
Comment is probably what you’re looking for. If you don’t want to use that: it’s a database. Make a table. Put whatever information in there that you need. Either look up by view name, or schema + view name, or oid: https://www.postgresql.org/docs/current/datatype-oid.html > On Jul 3, 2024, at

Re: Description field for tables and views

2024-07-03 Thread Christophe Pettus
> On Jul 3, 2024, at 12:28, Kent Dorfman wrote: > > Is there any psql function/command to add a description field to a table or > view definition in the system? Allow me to introduce you to my good friend "COMMENT": https://www.postgresql.org/docs/current/sql-comment.html

Description field for tables and views

2024-07-03 Thread Kent Dorfman
I think I already know the answer but asking here is probably quicker turnaround than researching it. I've gotten into a "view bloat" scenario with many many custom views that I cannot remember what they actually do.  Is there any psql function/command to add a description field to a table or

Query 2 Node HA test case result

2024-07-03 Thread Mukesh Tanuku
Hello everyone, We are doing a POC on postgres HA setup with streaming replication (async) using pgpool-II as a load balancing & connection pooling and repmgr for setting up HA & automatic failover. We are applying a test case, like isolating the VM1 node from the Network completely for more than

Re: printing PGresult content with gdb

2024-07-03 Thread Tom Lane
clippe...@gmx.fr writes: > I don't know if it is the right mailing list, but i was > wondering if one could introspect via gdb the content of PGresult. You might have better luck with that if you install the debuginfo RPM corresponding to your libpq RPM. PGresult's innards are not exposed to appl

Re: Accommodating alternative column values [RESOLVED]

2024-07-03 Thread Rich Shepard
On Wed, 3 Jul 2024, Adrian Klaver wrote: alter table array_conv alter column email type varchar[] using array[email]; select * from array_conv ; id |email +- 1 | {adrian.kla...@aklaver.com} 2 | {akla...@example.com} Adrian, Given my inexperience

Re: Accommodating alternative column values

2024-07-03 Thread Adrian Klaver
On 7/3/24 07:13, Rich Shepard wrote: On Wed, 3 Jul 2024, David G. Johnston wrote: Yeah, the simply cast suggested will not work. You’d have to apply an expression that turns the current contents into an array. The current contents are not likely to be an array literal. David, No, it's not no

Re: Accommodating alternative column values

2024-07-03 Thread Peter J. Holzer
On 2024-07-03 07:13:47 -0700, Rich Shepard wrote: > On Wed, 3 Jul 2024, David G. Johnston wrote: > > Yeah, the simply cast suggested will not work. You’d have to apply an > > expression that turns the current contents into an array. The current > > contents are not likely to be an array literal. >

Re: Accommodating alternative column values

2024-07-03 Thread David G. Johnston
On Wed, Jul 3, 2024 at 7:13 AM Rich Shepard wrote: > On Wed, 3 Jul 2024, David G. Johnston wrote: > > > Yeah, the simply cast suggested will not work. You’d have to apply an > > expression that turns the current contents into an array. The current > > contents are not likely to be an array litera

Re: Accommodating alternative column values

2024-07-03 Thread Torsten Förtsch
Check this out https://www.postgresql.org/docs/16/arrays.html#ARRAYS-INPUT You can use ('{' || email || '}')::varchar(64)[] or the syntax I suggested earlier. On Wed, Jul 3, 2024 at 4:13 PM Rich Shepard wrote: > On Wed, 3 Jul 2024, David G. Johnston wrote: > > > Yeah, the simply cast sugge

Re: Accommodating alternative column values

2024-07-03 Thread Rich Shepard
On Wed, 3 Jul 2024, David G. Johnston wrote: Yeah, the simply cast suggested will not work. You’d have to apply an expression that turns the current contents into an array. The current contents are not likely to be an array literal. David, No, it's not now an array. I thought that this expre

Re: Accommodating alternative column values

2024-07-03 Thread Torsten Förtsch
The USING phrase basically answers the question how do I convert an existing value of the old type to the new type. On Wed, Jul 3, 2024 at 4:03 PM Rich Shepard wrote: > On Wed, 3 Jul 2024, Rich Shepard wrote: > > > What I've tried: > > bustrac=# alter table people alter column email set data typ

Re: Accommodating alternative column values

2024-07-03 Thread David G. Johnston
On Wednesday, July 3, 2024, Rich Shepard wrote: > On Wed, 3 Jul 2024, Rich Shepard wrote: > > What I've tried: >> bustrac=# alter table people alter column email set data type varchar(64) >> []; >> ERROR: column "email" cannot be cast automatically to type character >> varying[] >> HINT: You mi

Re: Accommodating alternative column values

2024-07-03 Thread Torsten Förtsch
You could try ALTER TABLE ... SET TYPE TEXT[] USING ARRAY[email]::TEXT[] something along these lines. On Wed, Jul 3, 2024 at 3:58 PM Rich Shepard wrote: > On Tue, 2 Jul 2024, Christophe Pettus wrote: > > > To be clear, I wasn't suggesting stuffing them all into a text column > with > > a delim

Re: Accommodating alternative column values

2024-07-03 Thread Rich Shepard
On Wed, 3 Jul 2024, Rich Shepard wrote: What I've tried: bustrac=# alter table people alter column email set data type varchar(64) []; ERROR: column "email" cannot be cast automatically to type character varying[] HINT: You might need to specify "USING email::character varying(64)[]". What

Re: Accommodating alternative column values

2024-07-03 Thread David G. Johnston
On Wednesday, July 3, 2024, Rich Shepard wrote: > > I'm not using the proper syntax and the postgres alter table doc has no > example in the alter column choices. Simpler syntax forms tend to get skipped over when doing examples. > > How do I incorporate the "USING email::..." string? > ALTE

Re: Accommodating alternative column values

2024-07-03 Thread Rich Shepard
On Tue, 2 Jul 2024, Christophe Pettus wrote: To be clear, I wasn't suggesting stuffing them all into a text column with a delimiter, but storing them in a text *array* field, each email address one component of the array. Christophe, I'm not using the proper syntax and the postgres alter tabl

Re: printing PGresult content with gdb

2024-07-03 Thread Reid Thompson
On Tue, 2024-07-02 at 18:13 +0200, clippe...@gmx.fr wrote: >   > Hi all > I don't know if it is the right mailing list, but i was wondering if > one could introspect via gdb the content of PGresult. > In my case i got a coredump and when i tried to analyze the core and > try to print the content of

printing PGresult content with gdb

2024-07-03 Thread clipperDB
  Hi all I don't know if it is the right mailing list, but i was wondering if one could introspect via gdb the content of PGresult. In my case i got a coredump and when i tried to analyze the core and try to print the content of PGresult i got incomplete type I'm using libpq-13.3 (installed via