Skip to content

Replace awk -F based csv iteration by IFS + built-in for loop #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kkimurak
Copy link
Contributor

awk -F, splits values by comma but built-in for loop reinterpret each values. This behavior does not allow us to contain internal field separator (such as whitespace) in DB_EXTENSION for example.

By setting environment variable IFS we can control internal field separator that will affect to for-in loop. This PR replace awk -F, based word splitting by setting IFS then for-in loop.
This change allow us to include additional options to each element in DB_EXTENSIONS - for example --env 'DB_EXTENSION=extension_name CASCADE (CASCADE is an option to load extensions required by specified extension).
See full syntax in https://www.postgresql.org/docs/current/sql-createextension.html .

note: This PR is ported from my fork kkimurak#9, included in releases 20250717 and later and is available for testing.

`awk -F,` splits values by comma but built-in for loop reinterpret each values.
This behavior does not allow us to contain internal field separator
(such as whitespace) in DB_EXTENSION for example.

By setting environment variable `IFS` we can control internal field separator
that will affect to for-in loop.
@kkimurak kkimurak mentioned this pull request Jul 17, 2025
See pull request #11

* Fix IFS parsing (Re4zOon)
* remove empty line (Re4zOon)
* Make temporary variable `IFS_ORG` function-local (kkimurak)

Co-authored-by: Re4zOon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant