View Issue Details

IDProjectCategoryView StatusLast Update
0001461SymmetricDSImprovementpublic2025-08-07 15:49
Reporterrotten Assigned Toemiller  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.5.9 
Target Version3.16.5Fixed in Version3.16.5 
Summary0001461: dbexport --sql column filter
DescriptionIf I run dbexport --sql with a selection query that does not select all of the columns in the table, dbexport will generate a CSV with all of the columns in the original table, and simply not populate the columns I didn't select.

I'd rather the CSV only contained the columns I selected. Is that something that can be added as a flag or property? Or maybe simply made the default behaviour when --sql is used?

I'm exporting tables to third parties who do not need all of the columns. Rather than shipping them empty columns, I'd like to ship them what they need without having to post-process the CSV.
Steps To Reproducecreate table (a, b, c, d)
insert some values in all 4 columns.

dbexport --sql 'select a,b from table'

Note that the csv has

a,b,c,d
with only a,b with values.
Tagsdbimport/dbexport

Activities

aifaniyi

2025-04-29 11:54

reporter   ~0002851

It appears dbexport will work as expected for the scenario above if you add the fields you do not require to the "--exclude-columns" list of fields i.e

dbexport --sql 'select a,b from table' --exclude-columns 'c,d'

should produce a csv file with just

cquamme

2025-04-30 17:20

developer   ~0002854

It seems like it's using the table metadata, and it should be using the result set metadata.

emiller

2025-07-15 19:20

developer   ~0003253

PR: https://github.com/JumpMind/symmetric-ds/pull/327

pbelov

2025-08-07 15:49

manager   ~0003301

Included in the 3.16.5 release

Related Changesets

SymmetricDS: 3.16 c79f6735

2025-07-21 11:59:58

evan-miller-jumpmind


Committer: GitHub Details Diff
0001461: Excluded columns that aren't in the result set when running dbexport with the --sql option (#327) Affected Issues
0001461
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/DbExport.java Diff File

Issue History

Date Modified Username Field Change
2013-10-31 19:06 rotten New Issue
2019-04-22 14:18 elong Tag Attached: dbimport/dbexport
2024-07-03 17:28 jvanmeter Status new => confirmed
2025-04-29 11:54 aifaniyi Note Added: 0002851
2025-04-30 17:20 cquamme Note Added: 0002854
2025-07-14 15:25 emiller Assigned To => emiller
2025-07-14 15:25 emiller Status confirmed => assigned
2025-07-14 15:26 emiller Target Version => 3.16.5
2025-07-15 19:20 emiller Note Added: 0003253
2025-07-21 12:00 Changeset attached => SymmetricDS 3.16 c79f6735
2025-07-21 12:00 pbelov Status assigned => resolved
2025-07-21 12:00 pbelov Resolution open => fixed
2025-07-21 12:00 pbelov Fixed in Version => 3.16.5
2025-08-07 15:49 pbelov Note Added: 0003301
2025-08-07 15:49 pbelov Status resolved => closed