public inbox for [email protected]
help / color / mirror / Atom feed[PATCH] Don't lose attnotnull if a deferred PK supports it
23+ messages / 5 participants
[nested] [flat]
* [PATCH] Don't lose attnotnull if a deferred PK supports it
@ 2024-03-05 12:32 Alvaro Herrera <[email protected]>
0 siblings, 0 replies; 23+ messages in thread
From: Alvaro Herrera @ 2024-03-05 12:32 UTC (permalink / raw)
When dropping a NOT NULL constraint on a column that has a deferred
primary key, we would reset attnotnull, but that's bogus.
XXX this patch is nowhere near final.
Reported-by: Amul Sul <[email protected]>
Discussion: https://postgr.es/m/CAAJ_b94QonkgsbDXofakHDnORQNgafd1y3Oa5QXfpQNJyXyQ7A@mail.gmail.com
---
src/backend/commands/tablecmds.c | 71 ++++++++++++++++++++++++++++++--
1 file changed, 68 insertions(+), 3 deletions(-)
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index c61f9305c2..84c7871dda 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -12704,6 +12704,73 @@ ATExecDropConstraint(Relation rel, const char *constrName,
table_close(conrel, RowExclusiveLock);
}
+/*
+ * dropconstraint_getpkcols -- subroutine for dropconstraint_internal
+ *
+ * This is a workaround to the fact that RelationGetIndexAttrBitmap does
+ * not consider a DEFERRABLE PRIMARY KEY to be a real primary key. Maybe
+ * this code should be elsewhere.
+ */
+static Bitmapset *
+dropconstraint_getpkcols(Relation rel)
+{
+ Relation indrel;
+ SysScanDesc indscan;
+ ScanKeyData skey;
+ HeapTuple htup;
+ Bitmapset *b = NULL;
+
+ /*
+ * We try first to obtain a list of PK columns from the cache; if there
+ * is one, we're done.
+ */
+ b = RelationGetIndexAttrBitmap(rel, INDEX_ATTR_BITMAP_PRIMARY_KEY);
+ if (b != NULL)
+ return b;
+
+ /* Prepare to scan pg_index for entries having indrelid = this rel. */
+ ScanKeyInit(&skey,
+ Anum_pg_index_indrelid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(RelationGetRelid(rel)));
+
+ indrel = table_open(IndexRelationId, AccessShareLock);
+ indscan = systable_beginscan(indrel, IndexIndrelidIndexId, true,
+ NULL, 1, &skey);
+
+ while (HeapTupleIsValid(htup = systable_getnext(indscan)))
+ {
+ Form_pg_index index = (Form_pg_index) GETSTRUCT(htup);
+
+ /*
+ * Ignore any indexes that are currently being dropped and those that
+ * aren't a primary key.
+ */
+ if (!index->indislive)
+ continue;
+ if (!index->indisprimary)
+ continue;
+
+ /*
+ * If this primary key was IMMEDIATE, it would have been returned
+ * by RelationGetIndexAttrBitmap.
+ */
+ Assert(!index->indimmediate);
+
+ for (int i = 0; i < index->indnatts; i++)
+ {
+ int attrnum = index->indkey.values[i];
+
+ b = bms_add_member(b, attrnum - FirstLowInvalidHeapAttributeNumber);
+ }
+ }
+
+ systable_endscan(indscan);
+ table_close(indrel, AccessShareLock);
+
+ return b;
+}
+
/*
* Remove a constraint, using its pg_constraint tuple
*
@@ -12837,9 +12904,7 @@ dropconstraint_internal(Relation rel, HeapTuple constraintTup, DropBehavior beha
* We want to test columns for their presence in the primary key, but
* only if we're not dropping it.
*/
- pkcols = dropping_pk ? NULL :
- RelationGetIndexAttrBitmap(rel,
- INDEX_ATTR_BITMAP_PRIMARY_KEY);
+ pkcols = dropping_pk ? NULL : dropconstraint_getpkcols(rel);
ircols = RelationGetIndexAttrBitmap(rel, INDEX_ATTR_BITMAP_IDENTITY_KEY);
foreach(lc, unconstrained_cols)
--
2.39.2
--qek6jpjdi3ls6ksm--
^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH] Don't lose attnotnull if a deferred PK supports it
@ 2024-03-05 12:32 Alvaro Herrera <[email protected]>
0 siblings, 0 replies; 23+ messages in thread
From: Alvaro Herrera @ 2024-03-05 12:32 UTC (permalink / raw)
When dropping a NOT NULL constraint on a column that has a deferred
primary key, we would reset attnotnull, but that's bogus.
XXX this patch is nowhere near final.
Reported-by: Amul Sul <[email protected]>
Discussion: https://postgr.es/m/CAAJ_b94QonkgsbDXofakHDnORQNgafd1y3Oa5QXfpQNJyXyQ7A@mail.gmail.com
---
src/backend/commands/tablecmds.c | 71 ++++++++++++++++++++++++++++++--
1 file changed, 68 insertions(+), 3 deletions(-)
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index c61f9305c2..84c7871dda 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -12704,6 +12704,73 @@ ATExecDropConstraint(Relation rel, const char *constrName,
table_close(conrel, RowExclusiveLock);
}
+/*
+ * dropconstraint_getpkcols -- subroutine for dropconstraint_internal
+ *
+ * This is a workaround to the fact that RelationGetIndexAttrBitmap does
+ * not consider a DEFERRABLE PRIMARY KEY to be a real primary key. Maybe
+ * this code should be elsewhere.
+ */
+static Bitmapset *
+dropconstraint_getpkcols(Relation rel)
+{
+ Relation indrel;
+ SysScanDesc indscan;
+ ScanKeyData skey;
+ HeapTuple htup;
+ Bitmapset *b = NULL;
+
+ /*
+ * We try first to obtain a list of PK columns from the cache; if there
+ * is one, we're done.
+ */
+ b = RelationGetIndexAttrBitmap(rel, INDEX_ATTR_BITMAP_PRIMARY_KEY);
+ if (b != NULL)
+ return b;
+
+ /* Prepare to scan pg_index for entries having indrelid = this rel. */
+ ScanKeyInit(&skey,
+ Anum_pg_index_indrelid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(RelationGetRelid(rel)));
+
+ indrel = table_open(IndexRelationId, AccessShareLock);
+ indscan = systable_beginscan(indrel, IndexIndrelidIndexId, true,
+ NULL, 1, &skey);
+
+ while (HeapTupleIsValid(htup = systable_getnext(indscan)))
+ {
+ Form_pg_index index = (Form_pg_index) GETSTRUCT(htup);
+
+ /*
+ * Ignore any indexes that are currently being dropped and those that
+ * aren't a primary key.
+ */
+ if (!index->indislive)
+ continue;
+ if (!index->indisprimary)
+ continue;
+
+ /*
+ * If this primary key was IMMEDIATE, it would have been returned
+ * by RelationGetIndexAttrBitmap.
+ */
+ Assert(!index->indimmediate);
+
+ for (int i = 0; i < index->indnatts; i++)
+ {
+ int attrnum = index->indkey.values[i];
+
+ b = bms_add_member(b, attrnum - FirstLowInvalidHeapAttributeNumber);
+ }
+ }
+
+ systable_endscan(indscan);
+ table_close(indrel, AccessShareLock);
+
+ return b;
+}
+
/*
* Remove a constraint, using its pg_constraint tuple
*
@@ -12837,9 +12904,7 @@ dropconstraint_internal(Relation rel, HeapTuple constraintTup, DropBehavior beha
* We want to test columns for their presence in the primary key, but
* only if we're not dropping it.
*/
- pkcols = dropping_pk ? NULL :
- RelationGetIndexAttrBitmap(rel,
- INDEX_ATTR_BITMAP_PRIMARY_KEY);
+ pkcols = dropping_pk ? NULL : dropconstraint_getpkcols(rel);
ircols = RelationGetIndexAttrBitmap(rel, INDEX_ATTR_BITMAP_IDENTITY_KEY);
foreach(lc, unconstrained_cols)
--
2.39.2
--qek6jpjdi3ls6ksm--
^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH] Don't lose attnotnull if a deferred PK supports it
@ 2024-03-05 12:32 Alvaro Herrera <[email protected]>
0 siblings, 0 replies; 23+ messages in thread
From: Alvaro Herrera @ 2024-03-05 12:32 UTC (permalink / raw)
When dropping a NOT NULL constraint on a column that has a deferred
primary key, we would reset attnotnull, but that's bogus.
XXX this patch is nowhere near final.
Reported-by: Amul Sul <[email protected]>
Discussion: https://postgr.es/m/CAAJ_b94QonkgsbDXofakHDnORQNgafd1y3Oa5QXfpQNJyXyQ7A@mail.gmail.com
---
src/backend/commands/tablecmds.c | 71 ++++++++++++++++++++++++++++++--
1 file changed, 68 insertions(+), 3 deletions(-)
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index c61f9305c2..84c7871dda 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -12704,6 +12704,73 @@ ATExecDropConstraint(Relation rel, const char *constrName,
table_close(conrel, RowExclusiveLock);
}
+/*
+ * dropconstraint_getpkcols -- subroutine for dropconstraint_internal
+ *
+ * This is a workaround to the fact that RelationGetIndexAttrBitmap does
+ * not consider a DEFERRABLE PRIMARY KEY to be a real primary key. Maybe
+ * this code should be elsewhere.
+ */
+static Bitmapset *
+dropconstraint_getpkcols(Relation rel)
+{
+ Relation indrel;
+ SysScanDesc indscan;
+ ScanKeyData skey;
+ HeapTuple htup;
+ Bitmapset *b = NULL;
+
+ /*
+ * We try first to obtain a list of PK columns from the cache; if there
+ * is one, we're done.
+ */
+ b = RelationGetIndexAttrBitmap(rel, INDEX_ATTR_BITMAP_PRIMARY_KEY);
+ if (b != NULL)
+ return b;
+
+ /* Prepare to scan pg_index for entries having indrelid = this rel. */
+ ScanKeyInit(&skey,
+ Anum_pg_index_indrelid,
+ BTEqualStrategyNumber, F_OIDEQ,
+ ObjectIdGetDatum(RelationGetRelid(rel)));
+
+ indrel = table_open(IndexRelationId, AccessShareLock);
+ indscan = systable_beginscan(indrel, IndexIndrelidIndexId, true,
+ NULL, 1, &skey);
+
+ while (HeapTupleIsValid(htup = systable_getnext(indscan)))
+ {
+ Form_pg_index index = (Form_pg_index) GETSTRUCT(htup);
+
+ /*
+ * Ignore any indexes that are currently being dropped and those that
+ * aren't a primary key.
+ */
+ if (!index->indislive)
+ continue;
+ if (!index->indisprimary)
+ continue;
+
+ /*
+ * If this primary key was IMMEDIATE, it would have been returned
+ * by RelationGetIndexAttrBitmap.
+ */
+ Assert(!index->indimmediate);
+
+ for (int i = 0; i < index->indnatts; i++)
+ {
+ int attrnum = index->indkey.values[i];
+
+ b = bms_add_member(b, attrnum - FirstLowInvalidHeapAttributeNumber);
+ }
+ }
+
+ systable_endscan(indscan);
+ table_close(indrel, AccessShareLock);
+
+ return b;
+}
+
/*
* Remove a constraint, using its pg_constraint tuple
*
@@ -12837,9 +12904,7 @@ dropconstraint_internal(Relation rel, HeapTuple constraintTup, DropBehavior beha
* We want to test columns for their presence in the primary key, but
* only if we're not dropping it.
*/
- pkcols = dropping_pk ? NULL :
- RelationGetIndexAttrBitmap(rel,
- INDEX_ATTR_BITMAP_PRIMARY_KEY);
+ pkcols = dropping_pk ? NULL : dropconstraint_getpkcols(rel);
ircols = RelationGetIndexAttrBitmap(rel, INDEX_ATTR_BITMAP_IDENTITY_KEY);
foreach(lc, unconstrained_cols)
--
2.39.2
--qek6jpjdi3ls6ksm--
^ permalink raw reply [nested|flat] 23+ messages in thread
* ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-08 12:41 Ryo Kanbayashi <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-08 12:41 UTC (permalink / raw)
To: [email protected]
Hi hackers,
I found a code validation bug in master branch.
Now, ecpg does not support 'EXEC SQL COPY ... FROM STDIN ... ;' and
code for warning it exits.
https://github.com/postgres/postgres/blob/7b27f5fd36cb3270e8ac25aefd73b552663d1392/src/interfaces/ec...
---
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list
copy_from opt_program copy_file_name copy_delimiter opt_with
copy_options where_clause
if (strcmp(@6, "from") == 0 &&
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
---
But it is not working.
ecpg command fails to notice though code like above exits on pgc code.
# COPY ... FROM STDIN code
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ cat copy_from_should_be_warned.pgc
#include <stdio.h>
#include <stdlib.h>
EXEC SQL WHENEVER SQLERROR CALL die();
EXEC SQL WHENEVER NOT FOUND DO BREAK;
void
die(void)
{
fprintf(stderr, "%s\n", sqlca.sqlerrm.sqlerrmc);
exit(1);
}
int
main(void)
{
EXEC SQL BEGIN DECLARE SECTION;
const char *target = "postgres@localhost:5432";
const char *user = "ryo";
const char *passwd = "";
EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO :target USER :user USING :passwd;
EXEC SQL COPY name_age_list FROM STDIN;
EXEC SQL COMMIT;
EXEC SQL DISCONNECT ALL;
return 0;
}
-----
I executed ecpg command for above code.
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg
copy_from_should_be_warned.pgc
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
But there was no warning and generaged c source.
So, I wrote patch.
the patch changes @6 on code above to @5.
Checked variable was wrong.
After apply patch, warning is shown.
(c source is generated as before)
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg
copy_from_should_be_warned.pgc
copy_from_should_be_warned.pgc:24: WARNING: COPY FROM STDIN is not implemented
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
--
Best regards,
Ryo Kanbayashi
[email protected]
https://github.com/ryogrid
ryo@DESKTOP-IOASPN6:~/work/postgres$ git log
commit 7b27f5fd36cb3270e8ac25aefd73b552663d1392 (HEAD -> master, origin/master, origin/HEAD)
Author: Peter Eisentraut <[email protected]>
Date: Wed Jan 8 09:20:01 2025 +0100
plpgsql: pure parser and reentrant scanner
ryo@DESKTOP-IOASPN6:~/work/postgres$ uname -a
Linux DESKTOP-IOASPN6 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ryo@DESKTOP-IOASPN6:~/work/postgres$ gcc --version
gcc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ryo@DESKTOP-IOASPN6:~/work/postgres$ bison --version
bison (GNU Bison) 3.5.1
Written by Robert Corbett and Richard Stallman. Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ryo@DESKTOP-IOASPN6:~/work/postgres$ lex --version
flex 2.6.4
# local postgres install dir
ryo@DESKTOP-IOASPN6:~/work/postgres$ ls master/
bin data include lib share
# COPY ... FROM STDIN code
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ cat copy_from_should_be_warned.pgc
#include <stdio.h>
#include <stdlib.h>
EXEC SQL WHENEVER SQLERROR CALL die();
EXEC SQL WHENEVER NOT FOUND DO BREAK;
void
die(void)
{
fprintf(stderr, "%s\n", sqlca.sqlerrm.sqlerrmc);
exit(1);
}
int
main(void)
{
EXEC SQL BEGIN DECLARE SECTION;
const char *target = "postgres@localhost:5432";
const char *user = "ryo";
const char *passwd = "";
EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO :target USER :user USING :passwd;
EXEC SQL COPY name_age_list FROM STDIN;
EXEC SQL COMMIT;
EXEC SQL DISCONNECT ALL;
return 0;
}
# before apply patch -> No Warning
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg copy_from_should_be_warned.pgc
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
# after apply patch -> Warning is shown
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg copy_from_should_be_warned.pgc
copy_from_should_be_warned.pgc:24: WARNING: COPY FROM STDIN is not implemented
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
# COPY ... FROM filename code
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ cat copy_from_ok.pgc
#include <stdio.h>
#include <stdlib.h>
EXEC SQL WHENEVER SQLERROR CALL die();
EXEC SQL WHENEVER NOT FOUND DO BREAK;
void
die(void)
{
fprintf(stderr, "%s\n", sqlca.sqlerrm.sqlerrmc);
exit(1);
}
int
main(void)
{
EXEC SQL BEGIN DECLARE SECTION;
const char *target = "postgres@localhost:5432";
const char *user = "ryo";
const char *passwd = "";
EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO :target USER :user USING :passwd;
EXEC SQL COPY name_age_list FROM '/home/ryo/work/postgres/src/test_ecpg.out';
EXEC SQL COMMIT;
EXEC SQL DISCONNECT ALL;
return 0;
}
# after apply patch -> No Warning (no difference before applying patch)
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg copy_from_ok.pgc
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
# applying patch -> regression tests are passed
ryo@DESKTOP-IOASPN6:~/work/postgres/src/interfaces/ecpg$ make check
PATH="/home/ryo/work/postgres/tmp_install/usr/local/bin:/home/ryo/work/postgres/src/interfaces/ecpg/test:$PATH" LD_LIBRARY_PATH="/home/ryo/work/postgres/tmp_install/usr/local/lib" INITDB_TEMPLATE='/home/ryo/work/postgres'/tmp_install/initdb-template ./pg_regress --expecteddir=. --dbname=ecpg1_regression,ecpg2_regression --create-role=regress_ecpg_user1,regress_ecpg_user2 --temp-instance=./tmp_check --bindir= --schedule=./ecpg_schedule sql/twophase
# initializing database system by copying initdb template
# using temp instance on port 65312 with PID 1593657
ok 1 - compat_informix/dec_test 3 ms
ok 2 - compat_informix/charfuncs 1 ms
ok 3 - compat_informix/rfmtdate 1 ms
ok 4 - compat_informix/rfmtlong 1 ms
ok 5 - compat_informix/rnull 16 ms
ok 6 - compat_informix/sqlda 16 ms
ok 7 - compat_informix/describe 14 ms
ok 8 - compat_informix/test_informix 16 ms
ok 9 - compat_informix/test_informix2 8 ms
ok 10 - compat_informix/intoasc 1 ms
ok 11 - compat_oracle/char_array 10 ms
ok 12 - connect/test2 13 ms
ok 13 - connect/test3 8 ms
ok 14 - connect/test4 3 ms
ok 15 - connect/test5 40 ms
ok 16 - pgtypeslib/dt_test 6 ms
ok 17 - pgtypeslib/dt_test2 1 ms
ok 18 - pgtypeslib/num_test 7 ms
ok 19 - pgtypeslib/num_test2 3 ms
ok 20 - pgtypeslib/nan_test 19 ms
ok 21 - preproc/array_of_struct 7 ms
ok 22 - preproc/pointer_to_struct 8 ms
ok 23 - preproc/autoprep 20 ms
ok 24 - preproc/comment 3 ms
ok 25 - preproc/cursor 30 ms
ok 26 - preproc/define 8 ms
ok 27 - preproc/init 1 ms
ok 28 - preproc/strings 6 ms
ok 29 - preproc/type 6 ms
ok 30 - preproc/variable 10 ms
ok 31 - preproc/outofscope 14 ms
ok 32 - preproc/whenever 12 ms
ok 33 - preproc/whenever_do_continue 14 ms
ok 34 - sql/array 16 ms
ok 35 - sql/binary 8 ms
ok 36 - sql/bytea 15 ms
ok 37 - sql/code100 13 ms
ok 38 - sql/copystdout 7 ms
ok 39 - sql/createtableas 9 ms
ok 40 - sql/define 8 ms
ok 41 - sql/desc 11 ms
ok 42 - sql/sqlda 21 ms
ok 43 - sql/describe 26 ms
ok 44 - sql/dynalloc 9 ms
ok 45 - sql/dynalloc2 9 ms
ok 46 - sql/dyntest 23 ms
ok 47 - sql/execute 10 ms
ok 48 - sql/fetch 10 ms
ok 49 - sql/func 14 ms
ok 50 - sql/indicators 27 ms
ok 51 - sql/oldexec 11 ms
ok 52 - sql/quote 11 ms
ok 53 - sql/show 5 ms
ok 54 - sql/sqljson 11 ms
ok 55 - sql/sqljson_jsontable 4 ms
ok 56 - sql/insupd 8 ms
ok 57 - sql/parser 10 ms
ok 58 - sql/prepareas 20 ms
ok 59 - sql/declare 19 ms
ok 60 - thread/thread 49 ms
ok 61 - thread/thread_implicit 58 ms
ok 62 - thread/prep 121 ms
ok 63 - thread/alloc 101 ms
ok 64 - thread/descriptor 37 ms
ok 65 - sql/twophase 8 ms
1..65
# All 65 tests passed.
make[1]: Leaving directory '/home/ryo/work/postgres/src/interfaces/ecpg/test'
Attachments:
[text/plain] patch_checking_note.txt (8.1K, ../../CANOn0Ez_t5uDCUEV8c1YORMisJiU5wu681eEVZzgKwOeiKhkqQ@mail.gmail.com/2-patch_checking_note.txt)
download | inline:
ryo@DESKTOP-IOASPN6:~/work/postgres$ git log
commit 7b27f5fd36cb3270e8ac25aefd73b552663d1392 (HEAD -> master, origin/master, origin/HEAD)
Author: Peter Eisentraut <[email protected]>
Date: Wed Jan 8 09:20:01 2025 +0100
plpgsql: pure parser and reentrant scanner
ryo@DESKTOP-IOASPN6:~/work/postgres$ uname -a
Linux DESKTOP-IOASPN6 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ryo@DESKTOP-IOASPN6:~/work/postgres$ gcc --version
gcc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ryo@DESKTOP-IOASPN6:~/work/postgres$ bison --version
bison (GNU Bison) 3.5.1
Written by Robert Corbett and Richard Stallman. Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ryo@DESKTOP-IOASPN6:~/work/postgres$ lex --version
flex 2.6.4
# local postgres install dir
ryo@DESKTOP-IOASPN6:~/work/postgres$ ls master/
bin data include lib share
# COPY ... FROM STDIN code
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ cat copy_from_should_be_warned.pgc
#include <stdio.h>
#include <stdlib.h>
EXEC SQL WHENEVER SQLERROR CALL die();
EXEC SQL WHENEVER NOT FOUND DO BREAK;
void
die(void)
{
fprintf(stderr, "%s\n", sqlca.sqlerrm.sqlerrmc);
exit(1);
}
int
main(void)
{
EXEC SQL BEGIN DECLARE SECTION;
const char *target = "postgres@localhost:5432";
const char *user = "ryo";
const char *passwd = "";
EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO :target USER :user USING :passwd;
EXEC SQL COPY name_age_list FROM STDIN;
EXEC SQL COMMIT;
EXEC SQL DISCONNECT ALL;
return 0;
}
# before apply patch -> No Warning
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg copy_from_should_be_warned.pgc
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
# after apply patch -> Warning is shown
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg copy_from_should_be_warned.pgc
copy_from_should_be_warned.pgc:24: WARNING: COPY FROM STDIN is not implemented
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
# COPY ... FROM filename code
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ cat copy_from_ok.pgc
#include <stdio.h>
#include <stdlib.h>
EXEC SQL WHENEVER SQLERROR CALL die();
EXEC SQL WHENEVER NOT FOUND DO BREAK;
void
die(void)
{
fprintf(stderr, "%s\n", sqlca.sqlerrm.sqlerrmc);
exit(1);
}
int
main(void)
{
EXEC SQL BEGIN DECLARE SECTION;
const char *target = "postgres@localhost:5432";
const char *user = "ryo";
const char *passwd = "";
EXEC SQL END DECLARE SECTION;
EXEC SQL CONNECT TO :target USER :user USING :passwd;
EXEC SQL COPY name_age_list FROM '/home/ryo/work/postgres/src/test_ecpg.out';
EXEC SQL COMMIT;
EXEC SQL DISCONNECT ALL;
return 0;
}
# after apply patch -> No Warning (no difference before applying patch)
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg copy_from_ok.pgc
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
# applying patch -> regression tests are passed
ryo@DESKTOP-IOASPN6:~/work/postgres/src/interfaces/ecpg$ make check
PATH="/home/ryo/work/postgres/tmp_install/usr/local/bin:/home/ryo/work/postgres/src/interfaces/ecpg/test:$PATH" LD_LIBRARY_PATH="/home/ryo/work/postgres/tmp_install/usr/local/lib" INITDB_TEMPLATE='/home/ryo/work/postgres'/tmp_install/initdb-template ./pg_regress --expecteddir=. --dbname=ecpg1_regression,ecpg2_regression --create-role=regress_ecpg_user1,regress_ecpg_user2 --temp-instance=./tmp_check --bindir= --schedule=./ecpg_schedule sql/twophase
# initializing database system by copying initdb template
# using temp instance on port 65312 with PID 1593657
ok 1 - compat_informix/dec_test 3 ms
ok 2 - compat_informix/charfuncs 1 ms
ok 3 - compat_informix/rfmtdate 1 ms
ok 4 - compat_informix/rfmtlong 1 ms
ok 5 - compat_informix/rnull 16 ms
ok 6 - compat_informix/sqlda 16 ms
ok 7 - compat_informix/describe 14 ms
ok 8 - compat_informix/test_informix 16 ms
ok 9 - compat_informix/test_informix2 8 ms
ok 10 - compat_informix/intoasc 1 ms
ok 11 - compat_oracle/char_array 10 ms
ok 12 - connect/test2 13 ms
ok 13 - connect/test3 8 ms
ok 14 - connect/test4 3 ms
ok 15 - connect/test5 40 ms
ok 16 - pgtypeslib/dt_test 6 ms
ok 17 - pgtypeslib/dt_test2 1 ms
ok 18 - pgtypeslib/num_test 7 ms
ok 19 - pgtypeslib/num_test2 3 ms
ok 20 - pgtypeslib/nan_test 19 ms
ok 21 - preproc/array_of_struct 7 ms
ok 22 - preproc/pointer_to_struct 8 ms
ok 23 - preproc/autoprep 20 ms
ok 24 - preproc/comment 3 ms
ok 25 - preproc/cursor 30 ms
ok 26 - preproc/define 8 ms
ok 27 - preproc/init 1 ms
ok 28 - preproc/strings 6 ms
ok 29 - preproc/type 6 ms
ok 30 - preproc/variable 10 ms
ok 31 - preproc/outofscope 14 ms
ok 32 - preproc/whenever 12 ms
ok 33 - preproc/whenever_do_continue 14 ms
ok 34 - sql/array 16 ms
ok 35 - sql/binary 8 ms
ok 36 - sql/bytea 15 ms
ok 37 - sql/code100 13 ms
ok 38 - sql/copystdout 7 ms
ok 39 - sql/createtableas 9 ms
ok 40 - sql/define 8 ms
ok 41 - sql/desc 11 ms
ok 42 - sql/sqlda 21 ms
ok 43 - sql/describe 26 ms
ok 44 - sql/dynalloc 9 ms
ok 45 - sql/dynalloc2 9 ms
ok 46 - sql/dyntest 23 ms
ok 47 - sql/execute 10 ms
ok 48 - sql/fetch 10 ms
ok 49 - sql/func 14 ms
ok 50 - sql/indicators 27 ms
ok 51 - sql/oldexec 11 ms
ok 52 - sql/quote 11 ms
ok 53 - sql/show 5 ms
ok 54 - sql/sqljson 11 ms
ok 55 - sql/sqljson_jsontable 4 ms
ok 56 - sql/insupd 8 ms
ok 57 - sql/parser 10 ms
ok 58 - sql/prepareas 20 ms
ok 59 - sql/declare 19 ms
ok 60 - thread/thread 49 ms
ok 61 - thread/thread_implicit 58 ms
ok 62 - thread/prep 121 ms
ok 63 - thread/alloc 101 ms
ok 64 - thread/descriptor 37 ms
ok 65 - sql/twophase 8 ms
1..65
# All 65 tests passed.
make[1]: Leaving directory '/home/ryo/work/postgres/src/interfaces/ecpg/test'
[application/octet-stream] copy_from_ok.pgc (610B, ../../CANOn0Ez_t5uDCUEV8c1YORMisJiU5wu681eEVZzgKwOeiKhkqQ@mail.gmail.com/3-copy_from_ok.pgc)
download
[application/octet-stream] copy_from_should_be_warned.pgc (576B, ../../CANOn0Ez_t5uDCUEV8c1YORMisJiU5wu681eEVZzgKwOeiKhkqQ@mail.gmail.com/4-copy_from_should_be_warned.pgc)
download
[application/octet-stream] copy_from_stdin_no_warning.patch (851B, ../../CANOn0Ez_t5uDCUEV8c1YORMisJiU5wu681eEVZzgKwOeiKhkqQ@mail.gmail.com/5-copy_from_stdin_no_warning.patch)
download | inline diff:
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 71f7ad26ad..b732f1a355 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -240,7 +240,7 @@ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
@$ = cat_str(2, "where current of", cursor_marker);
}
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
- if (strcmp(@6, "from") == 0 &&
+ if (strcmp(@5, "from") == 0 &&
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
ECPG: addon var_value NumericOnly
^ permalink raw reply [nested|flat] 23+ messages in thread
* RE: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-08 13:35 Hayato Kuroda (Fujitsu) <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Hayato Kuroda (Fujitsu) @ 2025-01-08 13:35 UTC (permalink / raw)
To: 'Ryo Kanbayashi' <[email protected]>; +Cc: [email protected] <[email protected]>
Dear Kanbayashi-san,
> I found a code validation bug in master branch.
>
> Now, ecpg does not support 'EXEC SQL COPY ... FROM STDIN ... ;' and
> code for warning it exits.
>
> https://github.com/postgres/postgres/blob/7b27f5fd36cb3270e8ac25aefd73b55
> 2663d1392/src/interfaces/ecpg/preproc/ecpg.addons#L242-L245
> ---
> ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list
> copy_from opt_program copy_file_name copy_delimiter opt_with
> copy_options where_clause
> if (strcmp(@6, "from") == 0 &&
> (strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
> mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not
> implemented");
> ---
>
> But it is not working.
> ecpg command fails to notice though code like above exits on pgc code.
Good catch. I have a comment about the fix.
The parser accepts a statement like "COPY ... FROM STDOUT", and ISTM it is not either
implemented yet. However, the warning message only mentions STDIN case even STDOUT
is specified.
EXEC SQL COPY foo FROM STDOUT;
->
WARNING: COPY FROM STDIN is not implemented
I feel we can change like "COPY FROM STDIN/STDOUT...", or prepare two messages.
Thought?
Best regards,
Hayato Kuroda
FUJITSU LIMITED
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-08 14:04 Ryo Kanbayashi <[email protected]>
parent: Hayato Kuroda (Fujitsu) <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-08 14:04 UTC (permalink / raw)
To: Hayato Kuroda (Fujitsu) <[email protected]>; +Cc: [email protected]
Kuroda-san, thank to your comment.
> > I found a code validation bug in master branch.
> >
> > Now, ecpg does not support 'EXEC SQL COPY ... FROM STDIN ... ;' and
> > code for warning it exits.
> >
> > https://github.com/postgres/postgres/blob/7b27f5fd36cb3270e8ac25aefd73b55
> > 2663d1392/src/interfaces/ecpg/preproc/ecpg.addons#L242-L245
> > ---
> > ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list
> > copy_from opt_program copy_file_name copy_delimiter opt_with
> > copy_options where_clause
> > if (strcmp(@6, "from") == 0 &&
> > (strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
> > mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not
> > implemented");
> > ---
> >
> > But it is not working.
> > ecpg command fails to notice though code like above exits on pgc code.
>
> Good catch. I have a comment about the fix.
>
> The parser accepts a statement like "COPY ... FROM STDOUT", and ISTM it is not either
> implemented yet. However, the warning message only mentions STDIN case even STDOUT
> is specified.
>
> EXEC SQL COPY foo FROM STDOUT;
> ->
> WARNING: COPY FROM STDIN is not implemented
>
> I feel we can change like "COPY FROM STDIN/STDOUT...", or prepare two messages.
> Thought?
I think your proposed fix is better too.
So, I modified the patch.
With new patch, warning message is changed like below :)
ryo@DESKTOP-IOASPN6:~/work/postgres/src$ ../master/bin/ecpg
copy_from_should_be_warned.pgc
copy_from_should_be_warned.pgc:24: WARNING: COPY FROM STDIN/STDOUT is
not implemented
ryo@DESKTOP-IOASPN6:~/work/postgres/src$
--
Best regards,
Ryo Kanbayashi
https://github.com/ryogrid
On Wed, Jan 8, 2025 at 10:35β―PM Hayato Kuroda (Fujitsu)
<[email protected]> wrote:
>
> Dear Kanbayashi-san,
>
> > I found a code validation bug in master branch.
> >
> > Now, ecpg does not support 'EXEC SQL COPY ... FROM STDIN ... ;' and
> > code for warning it exits.
> >
> > https://github.com/postgres/postgres/blob/7b27f5fd36cb3270e8ac25aefd73b55
> > 2663d1392/src/interfaces/ecpg/preproc/ecpg.addons#L242-L245
> > ---
> > ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list
> > copy_from opt_program copy_file_name copy_delimiter opt_with
> > copy_options where_clause
> > if (strcmp(@6, "from") == 0 &&
> > (strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
> > mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not
> > implemented");
> > ---
> >
> > But it is not working.
> > ecpg command fails to notice though code like above exits on pgc code.
>
> Good catch. I have a comment about the fix.
>
> The parser accepts a statement like "COPY ... FROM STDOUT", and ISTM it is not either
> implemented yet. However, the warning message only mentions STDIN case even STDOUT
> is specified.
>
> EXEC SQL COPY foo FROM STDOUT;
> ->
> WARNING: COPY FROM STDIN is not implemented
>
> I feel we can change like "COPY FROM STDIN/STDOUT...", or prepare two messages.
> Thought?
>
> Best regards,
> Hayato Kuroda
> FUJITSU LIMITED
>
Attachments:
[application/octet-stream] copy_from_stdin_no_warning2.patch (1023B, ../../CANOn0EwOgYcB-NmanjsGSeo7WE4tNCO=sp2C7wT97KhMucUqUg@mail.gmail.com/2-copy_from_stdin_no_warning2.patch)
download | inline diff:
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 71f7ad26ad..e53929dd84 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -240,9 +240,9 @@ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
@$ = cat_str(2, "where current of", cursor_marker);
}
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
- if (strcmp(@6, "from") == 0 &&
+ if (strcmp(@5, "from") == 0 &&
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
- mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
+ mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN/STDOUT is not implemented");
ECPG: addon var_value NumericOnly
if (@1[0] == '$')
@$ = "$0";
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-08 15:19 Fujii Masao <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Fujii Masao @ 2025-01-08 15:19 UTC (permalink / raw)
To: Ryo Kanbayashi <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; +Cc: [email protected]
On 2025/01/08 23:04, Ryo Kanbayashi wrote:
>>> But it is not working.
>>> ecpg command fails to notice though code like above exits on pgc code.
This issue seems to have been introduced in commit 3d009e45bd. Before that,
as per my testing, ecpg successfully detected COPY FROM STDIN and reported
a warning. It seems the fix will need to be back-patched to all supported versions.
>> I feel we can change like "COPY FROM STDIN/STDOUT...", or prepare two messages.
>> Thought?
>
> I think your proposed fix is better too.
> So, I modified the patch.
As for COPY FROM STDOUT, while it's possible, mentioning it might be
confusing since it's not official syntax. So I'm not sure if this is
good idea.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-08 15:42 Tom Lane <[email protected]>
parent: Fujii Masao <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Tom Lane @ 2025-01-08 15:42 UTC (permalink / raw)
To: Fujii Masao <[email protected]>; +Cc: Ryo Kanbayashi <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; [email protected]
Fujii Masao <[email protected]> writes:
> On 2025/01/08 23:04, Ryo Kanbayashi wrote:
> But it is not working.
> ecpg command fails to notice though code like above exits on pgc code.
> This issue seems to have been introduced in commit 3d009e45bd.
Indeed :-(
> As for COPY FROM STDOUT, while it's possible, mentioning it might be
> confusing since it's not official syntax. So I'm not sure if this is
> good idea.
There's another problem: the correct syntax is COPY TO STDOUT,
and that won't trigger this warning either.
I'm inclined to drop the test on @5 altogether, and just check for
"stdin" or "stdout" in @7. There is no variant of those that will
work. (But maybe we should allow it if opt_program isn't empty?)
The warning message could perhaps be written
"COPY FROM STDIN/TO STDOUT is not implemented".
regards, tom lane
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-08 16:04 Fujii Masao <[email protected]>
parent: Tom Lane <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Fujii Masao @ 2025-01-08 16:04 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Ryo Kanbayashi <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; [email protected]
On 2025/01/09 0:42, Tom Lane wrote:
> Fujii Masao <[email protected]> writes:
>> On 2025/01/08 23:04, Ryo Kanbayashi wrote:
>> But it is not working.
>> ecpg command fails to notice though code like above exits on pgc code.
>
>> This issue seems to have been introduced in commit 3d009e45bd.
>
> Indeed :-(
>
>> As for COPY FROM STDOUT, while it's possible, mentioning it might be
>> confusing since it's not official syntax. So I'm not sure if this is
>> good idea.
>
> There's another problem: the correct syntax is COPY TO STDOUT,
> and that won't trigger this warning either.
ISTM that ecpg supports COPY TO STDOUT and includes the regression test "copystdout" for it. No?
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-08 16:31 Tom Lane <[email protected]>
parent: Fujii Masao <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Tom Lane @ 2025-01-08 16:31 UTC (permalink / raw)
To: Fujii Masao <[email protected]>; +Cc: Ryo Kanbayashi <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; [email protected]
Fujii Masao <[email protected]> writes:
> On 2025/01/09 0:42, Tom Lane wrote:
>> There's another problem: the correct syntax is COPY TO STDOUT,
>> and that won't trigger this warning either.
> ISTM that ecpg supports COPY TO STDOUT and includes the regression test "copystdout" for it. No?
Oh right. (Pokes at it...) It looks like the backend accepts
"FROM STDOUT" as a synonym for "FROM STDIN", so that's why this
is checking for both spellings. But I agree it'd be better
for the error message to only use the standard spelling.
Also I tried
regression=# copy int4_tbl from program stdin;
ERROR: STDIN/STDOUT not allowed with PROGRAM
So we probably don't need to bother with adjusting the check
to allow that.
regards, tom lane
^ permalink raw reply [nested|flat] 23+ messages in thread
* RE: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-09 07:52 Hayato Kuroda (Fujitsu) <[email protected]>
parent: Tom Lane <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Hayato Kuroda (Fujitsu) @ 2025-01-09 07:52 UTC (permalink / raw)
To: 'Tom Lane' <[email protected]>; Fujii Masao <[email protected]>; +Cc: Ryo Kanbayashi <[email protected]>; [email protected] <[email protected]>
Dear Tom, Fujii-san,
> > ISTM that ecpg supports COPY TO STDOUT and includes the regression test
> "copystdout" for it. No?
>
> Oh right. (Pokes at it...) It looks like the backend accepts
> "FROM STDOUT" as a synonym for "FROM STDIN", so that's why this
> is checking for both spellings. But I agree it'd be better
> for the error message to only use the standard spelling.
>
> Also I tried
>
> regression=# copy int4_tbl from program stdin;
> ERROR: STDIN/STDOUT not allowed with PROGRAM
>
> So we probably don't need to bother with adjusting the check
> to allow that.
To confirm - I have no objections for the decision. I'm also think it is not
an usual grammar. I checked the doc [1] and I could not find "COPY FROM STDOUT".
I.e., first version is enough.
[1]: https://www.postgresql.org/docs/devel/sql-copy.html
Best regards,
Hayato Kuroda
FUJITSU LIMITED
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-09 11:34 Ryo Kanbayashi <[email protected]>
parent: Hayato Kuroda (Fujitsu) <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-09 11:34 UTC (permalink / raw)
To: Hayato Kuroda (Fujitsu) <[email protected]>; +Cc: Tom Lane <[email protected]>; Fujii Masao <[email protected]>; [email protected] <[email protected]>
Dear Tom, Fujii-san, Kuroda-san,
I saw comments of yours and recognized that better fix is below.
- Fix of first attached patch which does not change warning message
And I created patch entry of commitfest :)
https://commitfest.postgresql.org/52/5497/
What should I do additionally?
Do I need to write patches for current supporting versions? (12.x - 17.x)
--
Best regards,
Ryo Kanbayashi
https://github.com/ryogrid
On Thu, Jan 9, 2025 at 4:53β―PM Hayato Kuroda (Fujitsu)
<[email protected]> wrote:
>
> Dear Tom, Fujii-san,
>
> > > ISTM that ecpg supports COPY TO STDOUT and includes the regression test
> > "copystdout" for it. No?
> >
> > Oh right. (Pokes at it...) It looks like the backend accepts
> > "FROM STDOUT" as a synonym for "FROM STDIN", so that's why this
> > is checking for both spellings. But I agree it'd be better
> > for the error message to only use the standard spelling.
> >
> > Also I tried
> >
> > regression=# copy int4_tbl from program stdin;
> > ERROR: STDIN/STDOUT not allowed with PROGRAM
> >
> > So we probably don't need to bother with adjusting the check
> > to allow that.
>
> To confirm - I have no objections for the decision. I'm also think it is not
> an usual grammar. I checked the doc [1] and I could not find "COPY FROM STDOUT".
> I.e., first version is enough.
>
> [1]: https://www.postgresql.org/docs/devel/sql-copy.html
>
> Best regards,
> Hayato Kuroda
> FUJITSU LIMITED
>
Attachments:
[application/octet-stream] copy_from_stdin_no_warning.patch (851B, ../../CANOn0Ex9oN_ZFm9v8Sf4X6PSMkh7buoo2713wkLgGHKUXMLcpg@mail.gmail.com/2-copy_from_stdin_no_warning.patch)
download | inline diff:
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 71f7ad26ad..b732f1a355 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -240,7 +240,7 @@ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
@$ = cat_str(2, "where current of", cursor_marker);
}
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
- if (strcmp(@6, "from") == 0 &&
+ if (strcmp(@5, "from") == 0 &&
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
ECPG: addon var_value NumericOnly
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-09 11:59 Fujii Masao <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Fujii Masao @ 2025-01-09 11:59 UTC (permalink / raw)
To: Ryo Kanbayashi <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; +Cc: Tom Lane <[email protected]>; [email protected] <[email protected]>
On 2025/01/09 20:34, Ryo Kanbayashi wrote:
> Dear Tom, Fujii-san, Kuroda-san,
>
> I saw comments of yours and recognized that better fix is below.
>
> - Fix of first attached patch which does not change warning message
>
> And I created patch entry of commitfest :)
> https://commitfest.postgresql.org/52/5497/
>
> What should I do additionally?
> Do I need to write patches for current supporting versions? (12.x - 17.x)
Testing the patch across all supported versions would be helpful.
If adjustments are needed for specific versions, creating separate
patches for those would also be appreciated. Since v12 is no longer
supported, back-patching to it isn't necessary.
BTW, regarding the discussion on the list, please avoid top-posting;
bottom-posting is the preferred style on this mailing list.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-09 12:27 Ryo Kanbayashi <[email protected]>
parent: Fujii Masao <[email protected]>
0 siblings, 2 replies; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-09 12:27 UTC (permalink / raw)
To: Fujii Masao <[email protected]>; +Cc: Hayato Kuroda (Fujitsu) <[email protected]>; Tom Lane <[email protected]>; [email protected] <[email protected]>
> On 2025/01/09 20:34, Ryo Kanbayashi wrote:
> > Dear Tom, Fujii-san, Kuroda-san,
> >
> > I saw comments of yours and recognized that better fix is below.
> >
> > - Fix of first attached patch which does not change warning message
> >
> > And I created patch entry of commitfest :)
> > https://commitfest.postgresql.org/52/5497/
> >
> > What should I do additionally?
> > Do I need to write patches for current supporting versions? (12.x - 17.x)
>
> Testing the patch across all supported versions would be helpful.
> If adjustments are needed for specific versions, creating separate
> patches for those would also be appreciated. Since v12 is no longer
> supported, back-patching to it isn't necessary.
thanks.
I try these :)
> BTW, regarding the discussion on the list, please avoid top-posting;
> bottom-posting is the preferred style on this mailing list.
I understand.
I'll be careful from now on :)
(Please Ignore: I attach renamed patch file for updating patch file on
commitfest system)
--
Best regards,
Ryo Kanbayashi
https://github.com/ryogrid
Attachments:
[application/octet-stream] copy_from_stdin_no_warning_for_master.patch (851B, ../../CANOn0EzoiQmkFoEEEiz-0+O8-SbK7Em+0Z5ibXY1CSmJZ9A3RA@mail.gmail.com/2-copy_from_stdin_no_warning_for_master.patch)
download | inline diff:
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 71f7ad26ad..b732f1a355 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -240,7 +240,7 @@ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
@$ = cat_str(2, "where current of", cursor_marker);
}
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
- if (strcmp(@6, "from") == 0 &&
+ if (strcmp(@5, "from") == 0 &&
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
ECPG: addon var_value NumericOnly
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-10 08:45 Ryo Kanbayashi <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
1 sibling, 1 reply; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-10 08:45 UTC (permalink / raw)
To: [email protected] <[email protected]>
On Thu, Jan 9, 2025 at 9:27β―PM Ryo Kanbayashi <[email protected]> wrote:
>
> > On 2025/01/09 20:34, Ryo Kanbayashi wrote:
> > > Dear Tom, Fujii-san, Kuroda-san,
> > >
> > > I saw comments of yours and recognized that better fix is below.
> > >
> > > - Fix of first attached patch which does not change warning message
> > >
> > > And I created patch entry of commitfest :)
> > > https://commitfest.postgresql.org/52/5497/
> > >
> > > What should I do additionally?
> > > Do I need to write patches for current supporting versions? (12.x - 17.x)
> >
> > Testing the patch across all supported versions would be helpful.
> > If adjustments are needed for specific versions, creating separate
> > patches for those would also be appreciated. Since v12 is no longer
> > supported, back-patching to it isn't necessary.
>
> thanks.
> I try these :)
>
> > BTW, regarding the discussion on the list, please avoid top-posting;
> > bottom-posting is the preferred style on this mailing list.
>
> I understand.
> I'll be careful from now on :)
>
> (Please Ignore: I attach renamed patch file for updating patch file on
> commitfest system)
PLEASE IGNORE THIS MAIL
(I attached wrong format patch file. So re-attach modified one for CFBot)
---
Great Reagrds,
Ryo Kanbayashi
Attachments:
[application/octet-stream] copy_from_stdin_no_warning_for_master2.patch (720B, ../../CANOn0Ey8YbVZcemKzZEQ77v2WA+n2t+fmB6UQ+1-=A3fHqzUeg@mail.gmail.com/2-copy_from_stdin_no_warning_for_master2.patch)
download | inline diff:
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -240,7 +240,7 @@ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
@$ = cat_str(2, "where current of", cursor_marker);
}
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
- if (strcmp(@6, "from") == 0 &&
+ if (strcmp(@5, "from") == 0 &&
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
ECPG: addon var_value NumericOnly
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-10 10:34 Ryo Kanbayashi <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
0 siblings, 0 replies; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-10 10:34 UTC (permalink / raw)
To: [email protected] <[email protected]>
On Fri, Jan 10, 2025 at 5:45β―PM Ryo Kanbayashi <[email protected]> wrote:
>
> On Thu, Jan 9, 2025 at 9:27β―PM Ryo Kanbayashi <[email protected]> wrote:
> >
> > > On 2025/01/09 20:34, Ryo Kanbayashi wrote:
> > > > Dear Tom, Fujii-san, Kuroda-san,
> > > >
> > > > I saw comments of yours and recognized that better fix is below.
> > > >
> > > > - Fix of first attached patch which does not change warning message
> > > >
> > > > And I created patch entry of commitfest :)
> > > > https://commitfest.postgresql.org/52/5497/
> > > >
> > > > What should I do additionally?
> > > > Do I need to write patches for current supporting versions? (12.x - 17.x)
> > >
> > > Testing the patch across all supported versions would be helpful.
> > > If adjustments are needed for specific versions, creating separate
> > > patches for those would also be appreciated. Since v12 is no longer
> > > supported, back-patching to it isn't necessary.
> >
> > thanks.
> > I try these :)
> >
> > > BTW, regarding the discussion on the list, please avoid top-posting;
> > > bottom-posting is the preferred style on this mailing list.
> >
> > I understand.
> > I'll be careful from now on :)
PLEASE IGNORE THIS MAIL
SORRY TO BOTHER YOU AGAIN...
(I have not attached correct format patch file yet. So re-attach
modified one for CFBot)
Great Reagrds,
Ryo Kanbayashi
Attachments:
[application/octet-stream] copy_from_stdin_no_warning_for_master3.patch (765B, ../../CANOn0Ez85ow5kfKQ8mH4gtpE6-fMkhMLr1QzNjV333cHq5Uu8w@mail.gmail.com/2-copy_from_stdin_no_warning_for_master3.patch)
download | inline diff:
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 71f7ad26ad..b732f1a355 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -240,7 +240,7 @@ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
@$ = cat_str(2, "where current of", cursor_marker);
}
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
- if (strcmp(@6, "from") == 0 &&
+ if (strcmp(@5, "from") == 0 &&
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
ECPG: addon var_value NumericOnly
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-11 17:04 Ryo Kanbayashi <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
1 sibling, 1 reply; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-11 17:04 UTC (permalink / raw)
To: [email protected] <[email protected]>; +Cc: Hayato Kuroda (Fujitsu) <[email protected]>; Tom Lane <[email protected]>; Fujii Masao <[email protected]>
> On Thu, Jan 9, 2025 at 9:27β―PM Ryo Kanbayashi <[email protected]> wrote:
>
> > On 2025/01/09 20:34, Ryo Kanbayashi wrote:
> > > Dear Tom, Fujii-san, Kuroda-san,
> > >
> > > I saw comments of yours and recognized that better fix is below.
> > >
> > > - Fix of first attached patch which does not change warning message
> > >
> > > And I created patch entry of commitfest :)
> > > https://commitfest.postgresql.org/52/5497/
> > >
> > > What should I do additionally?
> > > Do I need to write patches for current supporting versions? (12.x - 17.x)
> >
> > Testing the patch across all supported versions would be helpful.
> > If adjustments are needed for specific versions, creating separate
> > patches for those would also be appreciated. Since v12 is no longer
> > supported, back-patching to it isn't necessary.
>
> thanks.
> I try these :)
>
> > BTW, regarding the discussion on the list, please avoid top-posting;
> > bottom-posting is the preferred style on this mailing list.
>
> I understand.
> I'll be careful from now on :)
>
> (Please Ignore: I attach renamed patch file for updating patch file on
> commitfest system)
I wrote a patch for release v13 - v17 additionally and tested it for
each release branch :)
As a result, two patch is needed for this fix.
copy_from_stdin_no_warning_for_master3.patch -> patch for master branch
copy_from_stdin_no_warning_for_stables.patch -> patch for v13 - v17
check_patches.sh -> utility script for testing above two patches on
each target branches
patch_checking_note_cf.txt -> checking result by check_patches.sh and etc
other files -> files which are needed for testing with check_patches.sh
[commitfest entry]
https://commitfest.postgresql.org/52/5497/
It would be helpful if someone could review patches I wrote :)
--
Best regards,
Ryo Kanbayashi
https://github.com/ryogrid
ryo@DESKTOP-IOASPN6:~/work/postgres$ uname -a
Linux DESKTOP-IOASPN6 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ryo@DESKTOP-IOASPN6:~/work/postgres$ gcc --version
gcc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ryo@DESKTOP-IOASPN6:~/work/postgres$ bison --version
bison (GNU Bison) 3.5.1
Written by Robert Corbett and Richard Stallman. Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ryo@DESKTOP-IOASPN6:~/work/postgres$ lex --version
flex 2.6.4
ryo@DESKTOP-IOASPN6:~/work/postgres$ perl --version
This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi
(with 60 registered patches, see perl -V for more detail)
Copyright 1987-2019, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
ryo@DESKTOP-IOASPN6:~/work/postgres$ bash check_patches.sh
------------------------------
Checking branch: master
------------------------------
[HEAD]
commit ca87c415e2fccf81cec6fd45698dde9fae0ab570
Author: Peter Eisentraut <[email protected]>
Date: Sat Jan 11 10:45:17 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_master3.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch master. Cleaning up...
Branch master checks complete. Moving on.
------------------------------
Checking branch: REL_13_STABLE
------------------------------
[HEAD]
commit 84b8f6d9f59aa2d40ffb8edccb3f1eacff32b6c0
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_13_STABLE. Cleaning up...
Branch REL_13_STABLE checks complete. Moving on.
------------------------------
Checking branch: REL_14_STABLE
------------------------------
[HEAD]
commit 83ffb9f20f06120273304332594b7fab159f738f
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
Hunk #1 succeeded at 248 (offset 14 lines).
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_14_STABLE. Cleaning up...
Branch REL_14_STABLE checks complete. Moving on.
------------------------------
Checking branch: REL_15_STABLE
------------------------------
[HEAD]
commit 830215a4c8879dbed6aeec2ae67be050ec9b7d60
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
Hunk #1 succeeded at 248 (offset 14 lines).
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_15_STABLE. Cleaning up...
Branch REL_15_STABLE checks complete. Moving on.
------------------------------
Checking branch: REL_16_STABLE
------------------------------
[HEAD]
commit c35bbdfbc0d30fee6037b7859501b68b28d68c34
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
Hunk #1 succeeded at 248 (offset 14 lines).
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_16_STABLE. Cleaning up...
Branch REL_16_STABLE checks complete. Moving on.
------------------------------
Checking branch: REL_17_STABLE
------------------------------
[HEAD]
commit 8ed9bf0a3217c5fb18e9bba43a655b0a947f6f36
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
Hunk #1 succeeded at 248 (offset 14 lines).
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_17_STABLE. Cleaning up...
Branch REL_17_STABLE checks complete. Moving on.
All branches have been checked successfully!
Attachments:
[text/plain] patch_checking_note_cf.txt (7.3K, ../../CANOn0Ez+gAOCcEVqaFGsjU4Ls3vKxe=ui-qxbq3iCf9baHsqTg@mail.gmail.com/2-patch_checking_note_cf.txt)
download | inline:
ryo@DESKTOP-IOASPN6:~/work/postgres$ uname -a
Linux DESKTOP-IOASPN6 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ryo@DESKTOP-IOASPN6:~/work/postgres$ gcc --version
gcc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ryo@DESKTOP-IOASPN6:~/work/postgres$ bison --version
bison (GNU Bison) 3.5.1
Written by Robert Corbett and Richard Stallman. Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ryo@DESKTOP-IOASPN6:~/work/postgres$ lex --version
flex 2.6.4
ryo@DESKTOP-IOASPN6:~/work/postgres$ perl --version
This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi
(with 60 registered patches, see perl -V for more detail)
Copyright 1987-2019, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
ryo@DESKTOP-IOASPN6:~/work/postgres$ bash check_patches.sh
------------------------------
Checking branch: master
------------------------------
[HEAD]
commit ca87c415e2fccf81cec6fd45698dde9fae0ab570
Author: Peter Eisentraut <[email protected]>
Date: Sat Jan 11 10:45:17 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_master3.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch master. Cleaning up...
Branch master checks complete. Moving on.
------------------------------
Checking branch: REL_13_STABLE
------------------------------
[HEAD]
commit 84b8f6d9f59aa2d40ffb8edccb3f1eacff32b6c0
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_13_STABLE. Cleaning up...
Branch REL_13_STABLE checks complete. Moving on.
------------------------------
Checking branch: REL_14_STABLE
------------------------------
[HEAD]
commit 83ffb9f20f06120273304332594b7fab159f738f
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
Hunk #1 succeeded at 248 (offset 14 lines).
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_14_STABLE. Cleaning up...
Branch REL_14_STABLE checks complete. Moving on.
------------------------------
Checking branch: REL_15_STABLE
------------------------------
[HEAD]
commit 830215a4c8879dbed6aeec2ae67be050ec9b7d60
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
Hunk #1 succeeded at 248 (offset 14 lines).
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_15_STABLE. Cleaning up...
Branch REL_15_STABLE checks complete. Moving on.
------------------------------
Checking branch: REL_16_STABLE
------------------------------
[HEAD]
commit c35bbdfbc0d30fee6037b7859501b68b28d68c34
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
Hunk #1 succeeded at 248 (offset 14 lines).
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_16_STABLE. Cleaning up...
Branch REL_16_STABLE checks complete. Moving on.
------------------------------
Checking branch: REL_17_STABLE
------------------------------
[HEAD]
commit 8ed9bf0a3217c5fb18e9bba43a655b0a947f6f36
Author: Daniel Gustafsson <[email protected]>
Date: Fri Jan 10 22:02:58 2025 +0100
Applying patch: ./copy_from_stdin_no_warning_for_stables.patch
patching file src/interfaces/ecpg/preproc/ecpg.addons
Hunk #1 succeeded at 248 (offset 14 lines).
[Confirmation 1] Start building...
Running: ./configure --enable-cassert --enable-tap-tests --prefix=/home/ryo/work/postgres/local_install >/dev/null 2>&1
Running: make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1
[Confirmation 2] Running regression tests...
[Confirmation 3] Checking output for command: ./local_install/bin/ecpg copy_from_should_be_warned.pgc
[Confirmation 4] Checking no output for command: ./local_install/bin/ecpg copy_from_ok.pgc
All checks passed on branch REL_17_STABLE. Cleaning up...
Branch REL_17_STABLE checks complete. Moving on.
All branches have been checked successfully!
[application/octet-stream] copy_from_stdin_no_warning_for_master3.patch (765B, ../../CANOn0Ez+gAOCcEVqaFGsjU4Ls3vKxe=ui-qxbq3iCf9baHsqTg@mail.gmail.com/3-copy_from_stdin_no_warning_for_master3.patch)
download | inline diff:
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 71f7ad26ad..b732f1a355 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -240,7 +240,7 @@ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
@$ = cat_str(2, "where current of", cursor_marker);
}
ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
- if (strcmp(@6, "from") == 0 &&
+ if (strcmp(@5, "from") == 0 &&
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
ECPG: addon var_value NumericOnly
[application/octet-stream] copy_from_stdin_no_warning_for_stables.patch (767B, ../../CANOn0Ez+gAOCcEVqaFGsjU4Ls3vKxe=ui-qxbq3iCf9baHsqTg@mail.gmail.com/4-copy_from_stdin_no_warning_for_stables.patch)
download | inline diff:
diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons
index 300381eaad5..feb61d11a97 100644
--- a/src/interfaces/ecpg/preproc/ecpg.addons
+++ b/src/interfaces/ecpg/preproc/ecpg.addons
@@ -234,7 +234,7 @@ ECPG: where_or_current_clauseWHERECURRENT_POFcursor_name block
$$ = cat_str(2,mm_strdup("where current of"), cursor_marker);
}
ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listcopy_fromopt_programcopy_file_namecopy_delimiteropt_withcopy_optionswhere_clause addon
- if (strcmp($6, "from") == 0 &&
+ if (strcmp($5, "from") == 0 &&
(strcmp($7, "stdin") == 0 || strcmp($7, "stdout") == 0))
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
ECPG: var_valueNumericOnly addon
[text/x-sh] check_patches.sh (5.2K, ../../CANOn0Ez+gAOCcEVqaFGsjU4Ls3vKxe=ui-qxbq3iCf9baHsqTg@mail.gmail.com/5-check_patches.sh)
download | inline:
#!/usr/bin/env bash
# --------------------------------------
# This script checks multiple branches for certain conditions.
# It is meant to be run within a git repository.
# --------------------------------------
# list of branches to check.
# "master" and "REL_13_STABLE" through "REL_17_STABLE".
BRANCHES=(
"master"
"REL_13_STABLE"
"REL_14_STABLE"
"REL_15_STABLE"
"REL_16_STABLE"
"REL_17_STABLE"
)
MASTER_PATCH_FILE="./copy_from_stdin_no_warning_for_master3.patch"
STABLES_PATCH_FILE="./copy_from_stdin_no_warning_for_stables.patch"
# mapping from branch to patch file path.
declare -A PATCH_FILES=(
["master"]="$MASTER_PATCH_FILE"
["REL_13_STABLE"]="$STABLES_PATCH_FILE"
["REL_14_STABLE"]="$STABLES_PATCH_FILE"
["REL_15_STABLE"]="$STABLES_PATCH_FILE"
["REL_16_STABLE"]="$STABLES_PATCH_FILE"
["REL_17_STABLE"]="$STABLES_PATCH_FILE"
)
# --------------------------------------
# other constants.
# --------------------------------------
SHOULD_BE_WARNED_PGC_SOURCE="copy_from_should_be_warned.pgc"
SHOULD_NOT_BE_WARNED_PGC_SOURCE="copy_from_ok.pgc"
# --------------------------------------
# commands for confirmation checks.
# --------------------------------------
# Confirmation 1: Two-step build commands (only check the exit code of the second one).
BUILD_CMD_1="./configure --enable-cassert --enable-tap-tests --prefix=$HOME/work/postgres/local_install >/dev/null 2>&1"
BUILD_CMD_2="make -j 8 >/dev/null 2>&1 && make install >/dev/null 2>&1"
# Confirmation 2: Regression test command.
REGRESSION_TEST_CMD="make check >/dev/null 2>&1"
# Confirmation 3: The command line whose output must match a hard-coded string.
CMD_LINE_1="./local_install/bin/ecpg $SHOULD_BE_WARNED_PGC_SOURCE"
EXPECTED_OUTPUT_FOR_CMD_LINE_1=" COPY FROM STDIN is not implemented"
# Confirmation 4: The command line which should produce no output at all.
CMD_LINE_2="./local_install/bin/ecpg $SHOULD_NOT_BE_WARNED_PGC_SOURCE"
# --------------------------------------
# Function to apply patch
# --------------------------------------
apply_patch() {
local patch_file_path="$1"
# Apply the patch with patch -p0 < "patch_file_path"
if [[ -f "$patch_file_path" ]]; then
echo "Applying patch: $patch_file_path"
patch -p1 < "$patch_file_path"
if [[ $? -ne 0 ]]; then
echo "Error: Failed to apply patch $patch_file_path"
exit 1
fi
else
echo "Error: Patch file not found ($patch_file_path)"
exit 1
fi
}
# --------------------------------------
# Main processing
# --------------------------------------
for branch in "${BRANCHES[@]}"; do
echo "------------------------------"
echo "Checking branch: $branch"
echo "------------------------------"
# 1) Checkout the branch
# ------------------------------
# Switch to the branch we want to check.
git checkout "$branch" >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Error: Failed to check out branch $branch"
exit 1
fi
echo "[HEAD]"
git log | head -n 3
# 2) Apply the patch corresponding to this branch
# ------------------------------
apply_patch "${PATCH_FILES[$branch]}"
# 3) Confirmation 1: Two-step build (check exit code of the second command)
# ------------------------------
echo "[Confirmation 1] Start building..."
echo " Running: $BUILD_CMD_1"
eval "$BUILD_CMD_1"
echo " Running: $BUILD_CMD_2"
eval "$BUILD_CMD_2"
if [[ $? -ne 0 ]]; then
echo "Error: Build command (second step) failed on branch $branch."
exit 1
fi
# 4) Confirmation 2: Regression test command
# ------------------------------
echo "[Confirmation 2] Running regression tests..."
cd src/interfaces/ecpg
eval "$REGRESSION_TEST_CMD"
if [[ $? -ne 0 ]]; then
echo "Error: Regression test failed on branch $branch."
exit 1
fi
cd ../../..
# 5) Confirmation 3: check output of warning needed execution
# ------------------------------
echo "[Confirmation 3] Checking output for command: $CMD_LINE_1"
OUTPUT_1="$($CMD_LINE_1 2>&1)"
CUTED_OUTPUT_1=$(echo "${OUTPUT_1}" | cut -d':' -f4)
if [[ "$CUTED_OUTPUT_1" != "$EXPECTED_OUTPUT_FOR_CMD_LINE_1" ]]; then
echo "Error: Output mismatch for $CMD_LINE_1 on branch $branch."
echo " Expected: $EXPECTED_OUTPUT_FOR_CMD_LINE_1"
echo " Got: $CUTED_OUTPUT_1"
exit 1
fi
# 6) Confirmation 4: check output of no warning needed execution
# ------------------------------
echo "[Confirmation 4] Checking no output for command: $CMD_LINE_2"
OUTPUT_2="$($CMD_LINE_2 2>&1)"
if [[ -n "$OUTPUT_2" ]]; then
echo "Error: Command $CMD_LINE_2 produced unexpected output on branch $branch."
echo " Output was: $OUTPUT_2"
exit 1
fi
# 7) If we reach here, all confirmations passed for this branch.
# Then clean up and ensure no local modifications.
# ------------------------------
echo "All checks passed on branch $branch. Cleaning up..."
make distclean >/dev/null 2>&1
# Ensure no local modifications remain (so next branch starts clean).
git reset --hard HEAD >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Error: Failed to reset branch $branch to a clean state."
exit 1
fi
echo "Branch $branch checks complete. Moving on."
done
echo "All branches have been checked successfully!"
exit 0
[application/octet-stream] copy_from_should_be_warned.pgc (576B, ../../CANOn0Ez+gAOCcEVqaFGsjU4Ls3vKxe=ui-qxbq3iCf9baHsqTg@mail.gmail.com/6-copy_from_should_be_warned.pgc)
download
[application/octet-stream] copy_from_ok.pgc (584B, ../../CANOn0Ez+gAOCcEVqaFGsjU4Ls3vKxe=ui-qxbq3iCf9baHsqTg@mail.gmail.com/7-copy_from_ok.pgc)
download
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-12 03:56 Fujii Masao <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Fujii Masao @ 2025-01-12 03:56 UTC (permalink / raw)
To: Ryo Kanbayashi <[email protected]>; [email protected] <[email protected]>; +Cc: Hayato Kuroda (Fujitsu) <[email protected]>; Tom Lane <[email protected]>
On 2025/01/12 2:04, Ryo Kanbayashi wrote:
> I wrote a patch for release v13 - v17 additionally and tested it for
> each release branch :)
> As a result, two patch is needed for this fix.
Thanks for the patches! Barring any objections,
I plan to commit them with the following commit log.
-------------------
ecpg: Restore detection of unsupported COPY FROM STDIN.
The ecpg command includes code to warn about unsupported COPY FROM STDIN
statements in input files. However, since commit 3d009e45bd,
this functionality has been broken due to a bug introduced in that commit,
causing ecpg to fail to detect the statement.
This commit resolves the issue, restoring ecpg's ability to detect
COPY FROM STDIN and issue a warning as intended.
Back-patch to all supported versions.
Author: Ryo Kanbayashi
Reviewed-by: Hayato Kuroda, Tom Lane
Discussion: https://postgr.es/m/CANOn0Ez_t5uDCUEV8c1YORMisJiU5wu681eEVZzgKwOeiKhkqQ@mail.gmail.com
-------------------
> check_patches.sh -> utility script for testing above two patches on
> each target branches
Should we add a regression test to ensure ecpg correctly reports errors
and warnings, including the warning for COPY FROM STDIN? This could help
catch similar bugs more effectively. If agreed, we could create this
as a separate patch.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-12 09:27 Ryo Kanbayashi <[email protected]>
parent: Fujii Masao <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-12 09:27 UTC (permalink / raw)
To: Fujii Masao <[email protected]>; +Cc: [email protected] <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; Tom Lane <[email protected]>
On Sun, Jan 12, 2025 at 12:56β―PM Fujii Masao
<[email protected]> wrote:
>
>
>
> On 2025/01/12 2:04, Ryo Kanbayashi wrote:
> > I wrote a patch for release v13 - v17 additionally and tested it for
> > each release branch :)
> > As a result, two patch is needed for this fix.
>
> Thanks for the patches! Barring any objections,
> I plan to commit them with the following commit log.
>
> -------------------
> ecpg: Restore detection of unsupported COPY FROM STDIN.
>
> The ecpg command includes code to warn about unsupported COPY FROM STDIN
> statements in input files. However, since commit 3d009e45bd,
> this functionality has been broken due to a bug introduced in that commit,
> causing ecpg to fail to detect the statement.
>
> This commit resolves the issue, restoring ecpg's ability to detect
> COPY FROM STDIN and issue a warning as intended.
>
> Back-patch to all supported versions.
>
> Author: Ryo Kanbayashi
> Reviewed-by: Hayato Kuroda, Tom Lane
> Discussion: https://postgr.es/m/CANOn0Ez_t5uDCUEV8c1YORMisJiU5wu681eEVZzgKwOeiKhkqQ@mail.gmail.com
> -------------------
Thank you for reviewing patch :)
The commit log matches with my recognition and has no problem.
> > check_patches.sh -> utility script for testing above two patches on
> > each target branches
>
> Should we add a regression test to ensure ecpg correctly reports errors
> and warnings, including the warning for COPY FROM STDIN? This could help
> catch similar bugs more effectively. If agreed, we could create this
> as a separate patch.
Of course there is no problem!
I think a test like above becomes a good regression test too.
--
Best regards,
Ryo Kanbayashi
https://github.com/ryogrid
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-14 16:34 Fujii Masao <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Fujii Masao @ 2025-01-14 16:34 UTC (permalink / raw)
To: Ryo Kanbayashi <[email protected]>; +Cc: [email protected] <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; Tom Lane <[email protected]>
On 2025/01/12 18:27, Ryo Kanbayashi wrote:
> Thank you for reviewing patch :)
> The commit log matches with my recognition and has no problem.
Pushed. Thanks!
>>> check_patches.sh -> utility script for testing above two patches on
>>> each target branches
>>
>> Should we add a regression test to ensure ecpg correctly reports errors
>> and warnings, including the warning for COPY FROM STDIN? This could help
>> catch similar bugs more effectively. If agreed, we could create this
>> as a separate patch.
>
> Of course there is no problem!
> I think a test like above becomes a good regression test too.
So, will you give creating the patch a try?
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-17 08:46 Ryo Kanbayashi <[email protected]>
parent: Fujii Masao <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-17 08:46 UTC (permalink / raw)
To: Fujii Masao <[email protected]>; +Cc: [email protected] <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; Tom Lane <[email protected]>
On Wed, Jan 15, 2025 at 1:34β―AM Fujii Masao <[email protected]> wrote:
>
>
>
> On 2025/01/12 18:27, Ryo Kanbayashi wrote:
> > Thank you for reviewing patch :)
> > The commit log matches with my recognition and has no problem.
>
> Pushed. Thanks!
>
> >>> check_patches.sh -> utility script for testing above two patches on
> >>> each target branches
> >>
> >> Should we add a regression test to ensure ecpg correctly reports errors
> >> and warnings, including the warning for COPY FROM STDIN? This could help
> >> catch similar bugs more effectively. If agreed, we could create this
> >> as a separate patch.
> >
> > Of course there is no problem!
> > I think a test like above becomes a good regression test too.
>
> So, will you give creating the patch a try?
Yes. I try to write the patch for regression test of ecpg command
warning and error notice :)
BTW, How should we handle commit fest entry below?
"ecpg command does not warn COPY ... FROM STDIN;"
https://commitfest.postgresql.org/52/5497/
I think that the patch of regression test is not included the entry.
---
Great regards,
Ryo Kanbayashi
https://github.com/ryogrid
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-17 13:51 Fujii Masao <[email protected]>
parent: Ryo Kanbayashi <[email protected]>
0 siblings, 1 reply; 23+ messages in thread
From: Fujii Masao @ 2025-01-17 13:51 UTC (permalink / raw)
To: Ryo Kanbayashi <[email protected]>; +Cc: [email protected] <[email protected]>; Hayato Kuroda (Fujitsu) <[email protected]>; Tom Lane <[email protected]>
On 2025/01/17 17:46, Ryo Kanbayashi wrote:
>> So, will you give creating the patch a try?
>
> Yes. I try to write the patch for regression test of ecpg command
> warning and error notice :)
Thanks!
> BTW, How should we handle commit fest entry below?
>
> "ecpg command does not warn COPY ... FROM STDIN;"
> https://commitfest.postgresql.org/52/5497/
>
> I think that the patch of regression test is not included the entry.
I've marked this entry as committed.
Please feel free to create a new CF entry for the regression test patch for ecpg.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: ecpg command does not warn COPY ... FROM STDIN;
@ 2025-01-17 14:49 Ryo Kanbayashi <[email protected]>
parent: Fujii Masao <[email protected]>
0 siblings, 0 replies; 23+ messages in thread
From: Ryo Kanbayashi @ 2025-01-17 14:49 UTC (permalink / raw)
To: [email protected]; +Cc: [email protected]; [email protected]; [email protected]
π
Ryo γγγ Gmail
<https://www.google.com/gmail/about/?utm_source=gmail-in-product&utm_medium=et&utm_campaign=e...;
γ§γͺγ’γ―γ·γ§γ³γγΎγγ
2025εΉ΄1ζ17ζ₯(ι) εεΎ10:51 Fujii Masao <[email protected]>:
>
>
> On 2025/01/17 17:46, Ryo Kanbayashi wrote:
> >> So, will you give creating the patch a try?
> >
> > Yes. I try to write the patch for regression test of ecpg command
> > warning and error notice :)
>
> Thanks!
>
> > BTW, How should we handle commit fest entry below?
> >
> > "ecpg command does not warn COPY ... FROM STDIN;"
> > https://commitfest.postgresql.org/52/5497/
> >
> > I think that the patch of regression test is not included the entry.
>
> I've marked this entry as committed.
>
> Please feel free to create a new CF entry for the regression test patch
> for ecpg.
>
> Regards,
>
> --
> Fujii Masao
> Advanced Computing Technology Center
> Research and Development Headquarters
> NTT DATA CORPORATION
>
>
^ permalink raw reply [nested|flat] 23+ messages in thread
end of thread, other threads:[~2025-01-17 14:49 UTC | newest]
Thread overview: 23+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-05 12:32 [PATCH] Don't lose attnotnull if a deferred PK supports it Alvaro Herrera <[email protected]>
2024-03-05 12:32 [PATCH] Don't lose attnotnull if a deferred PK supports it Alvaro Herrera <[email protected]>
2024-03-05 12:32 [PATCH] Don't lose attnotnull if a deferred PK supports it Alvaro Herrera <[email protected]>
2025-01-08 12:41 ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-08 13:35 ` RE: ecpg command does not warn COPY ... FROM STDIN; Hayato Kuroda (Fujitsu) <[email protected]>
2025-01-08 14:04 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-08 15:19 ` Re: ecpg command does not warn COPY ... FROM STDIN; Fujii Masao <[email protected]>
2025-01-08 15:42 ` Re: ecpg command does not warn COPY ... FROM STDIN; Tom Lane <[email protected]>
2025-01-08 16:04 ` Re: ecpg command does not warn COPY ... FROM STDIN; Fujii Masao <[email protected]>
2025-01-08 16:31 ` Re: ecpg command does not warn COPY ... FROM STDIN; Tom Lane <[email protected]>
2025-01-09 07:52 ` RE: ecpg command does not warn COPY ... FROM STDIN; Hayato Kuroda (Fujitsu) <[email protected]>
2025-01-09 11:34 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-09 11:59 ` Re: ecpg command does not warn COPY ... FROM STDIN; Fujii Masao <[email protected]>
2025-01-09 12:27 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-10 08:45 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-10 10:34 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-11 17:04 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-12 03:56 ` Re: ecpg command does not warn COPY ... FROM STDIN; Fujii Masao <[email protected]>
2025-01-12 09:27 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-14 16:34 ` Re: ecpg command does not warn COPY ... FROM STDIN; Fujii Masao <[email protected]>
2025-01-17 08:46 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
2025-01-17 13:51 ` Re: ecpg command does not warn COPY ... FROM STDIN; Fujii Masao <[email protected]>
2025-01-17 14:49 ` Re: ecpg command does not warn COPY ... FROM STDIN; Ryo Kanbayashi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox