Re: Gradual migration from integer to bigint?

2023-10-06 Thread Bruce Momjian
On Sun, Oct 1, 2023 at 05:30:39AM -0400, Ann Harrison wrote: > Other databases do allow that sort of gradual migration.  One example > has an internal table of record descriptions indexed the table identifier  > and a description number.  Each record includes a header with various  > useful bits

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

2023-10-06 Thread David G. Johnston
On Friday, October 6, 2023, Tom Lane wrote: > "David G. Johnston" writes: > >> On 10/6/23 08:45, Ron wrote: > >>> Nah. "The programmer -- and DBA -- on the Clapham omnibus" quite > >>> reasonably expects that COPY table_name TO (output)" copies all the > >>> columns listed in "\d table_name".

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

2023-10-06 Thread Tom Lane
"David G. Johnston" writes: >> On 10/6/23 08:45, Ron wrote: >>> Nah. "The programmer -- and DBA -- on the Clapham omnibus" quite >>> reasonably expects that COPY table_name TO (output)" copies all the >>> columns listed in "\d table_name". > Sure, but it doesn't. Mainly since copy's original

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

2023-10-06 Thread Ron
On 10/6/23 11:08, David G. Johnston wrote: On Fri, Oct 6, 2023 at 8:54 AM Adrian Klaver wrote: On 10/6/23 08:45, Ron wrote: > On 10/6/23 09:04, Andreas Kretschmer wrote: >> >>> Not sure how convincing that reasoning is, but it was at least >>> thought about.  I do agree

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

2023-10-06 Thread David G. Johnston
On Fri, Oct 6, 2023 at 8:54 AM Adrian Klaver wrote: > On 10/6/23 08:45, Ron wrote: > > On 10/6/23 09:04, Andreas Kretschmer wrote: > >> > > >>> Not sure how convincing that reasoning is, but it was at least > >>> thought about. I do agree with it as far as the default column > >>> list goes,

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

2023-10-06 Thread Adrian Klaver
On 10/6/23 08:45, Ron wrote: On 10/6/23 09:04, Andreas Kretschmer wrote: Not sure how convincing that reasoning is, but it was at least thought about.  I do agree with it as far as the default column list goes, but maybe we could allow explicit selection of these columns in COPY TO.

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

2023-10-06 Thread Ron
On 10/6/23 09:04, Andreas Kretschmer wrote: Am 06.10.23 um 15:47 schrieb Tom Lane: 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:

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

2023-10-06 Thread Dominique Devienne
On Fri, Oct 6, 2023 at 4:59 PM Rob Sargent wrote: > What would be copied? The formula? Of course not. That's DDL, not DML IMHO. > Seems to me one is using “the fast option” so adding the column which can > be regenerated is overhead. > Regenerated by whom? COPY TO to is output to the

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

2023-10-06 Thread David G. Johnston
On Friday, October 6, 2023, Rob Sargent wrote: > > > > 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? > > >

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

Re: How to make a map in pg kernel?

2023-10-06 Thread Artur Zakirov
Hello, On Thu, 5 Oct 2023 at 16:42, jacktby jacktby wrote: > > Hi, I’m writing some kernel codes in pg15, and now I need to make a map > struct, I know c-lang doesn’t support this, so does pg support an internal > struct? Hopefully your replies. PostgreSQL has hash tables:

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

2023-10-06 Thread Andreas Kretschmer
Am 06.10.23 um 15:47 schrieb Tom Lane: 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 include generated columns in

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

2023-10-06 Thread Tom Lane
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 include generated columns in the generated full list and we don't *

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

2023-10-06 Thread Ron
On 10/6/23 07:20, Andreas Kretschmer wrote: Am 06.10.23 um 13:53 schrieb Luca Ferrari: Hi all, 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? Example: testdb=# CREATE TABLE test( pk int

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

2023-10-06 Thread Andreas Kretschmer
Am 06.10.23 um 13:53 schrieb Luca Ferrari: Hi all, 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? Example: testdb=# CREATE TABLE test( pk int generated always as identity primary key , ts

why generated columsn cannot be used in COPY TO?

2023-10-06 Thread Luca Ferrari
Hi all, 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? Example: testdb=# CREATE TABLE test( pk int generated always as identity primary key , ts timestamp default current_timestamp , month int