Skip to content
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

tbls does not work with AWS Redshift #26

Closed
watarukura opened this issue Jun 19, 2018 · 2 comments
Closed

tbls does not work with AWS Redshift #26

watarukura opened this issue Jun 19, 2018 · 2 comments

Comments

@watarukura
Copy link

watarukura commented Jun 19, 2018

tbls doc postgres://user:[email protected]:5439/dbname ./redshift
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x112f0db]

goroutine 1 [running]:
database/sql.(*Rows).close(0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/opt/go/libexec/src/database/sql/sql.go:2907 +0x6b
database/sql.(*Rows).Close(0x0, 0xc420195840, 0x1)
	/usr/local/opt/go/libexec/src/database/sql/sql.go:2903 +0x33
github.com/k1LoW/tbls/drivers/postgres.(*Postgres).Analyze(0x16ad940, 0xc4200b19a0, 0xc42009a900, 0x14995c0, 0xc4200acfc0)
	/Users/watarukura/src/github.com/k1LoW/tbls/drivers/postgres/postgres.go:28 +0x26cf
github.com/k1LoW/tbls/db.Analyze(0x7ffeefbffa51, 0x5a, 0x0, 0x0, 0x0)
	/Users/watarukura/src/github.com/k1LoW/tbls/db/db.go:47 +0x296
github.com/k1LoW/tbls/cmd.glob..func4(0x168a680, 0xc420134d60, 0x2, 0x2)
	/Users/watarukura/src/github.com/k1LoW/tbls/cmd/doc.go:53 +0x79
github.com/k1LoW/tbls/vendor/github.com/spf13/cobra.(*Command).execute(0x168a680, 0xc420134d20, 0x2, 0x2, 0x168a680, 0xc420134d20)
	/Users/watarukura/src/github.com/k1LoW/tbls/vendor/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/k1LoW/tbls/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x168ab40, 0xc420057f68, 0x136c5d7, 0x144f631)
	/Users/watarukura/src/github.com/k1LoW/tbls/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/k1LoW/tbls/vendor/github.com/spf13/cobra.(*Command).Execute(0x168ab40, 0xc42007c058, 0x0)
	/Users/watarukura/src/github.com/k1LoW/tbls/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/k1LoW/tbls/cmd.Execute()
	/Users/watarukura/src/github.com/k1LoW/tbls/cmd/root.go:49 +0x2d
main.main()
	/Users/watarukura/src/github.com/k1LoW/tbls/main.go:33 +0x20

Analyze で実行している下記SQLがエラーを返すようです。

dbname=#
SELECT CONCAT(table_schema, '."', table_name, '"')::regclass::oid AS oid, table_name, table_type
FROM information_schema.tables
WHERE table_schema != 'pg_catalog' AND table_schema != 'information_schema'
AND table_catalog = 'dbname'
ORDER BY oid;
ERROR:  function concat(information_schema.sql_identifier, "unknown", information_schema.sql_identifier, "unknown") does not exist
HINT:  No function matches the given name and argument types. You may need to add explicit type casts.
dbname=#
@k1LoW
Copy link
Owner

k1LoW commented Jun 19, 2018

レポートありがとうございます!

残念ながら手元にAWS Redshiftを用意できないので、解決するのが難しそうです...

ERRORを見る限りCONCATの使い方が良くないようですが...

あと重要なIssueなので、タイトルだけを英語にしておきますね。

@k1LoW k1LoW changed the title AWS Redshift では実行時にエラーになります tbls does not work with AWS Redshift Jun 19, 2018
@k1LoW
Copy link
Owner

k1LoW commented Jun 28, 2018

Thank you @watarukura !
Released as v0.9.0.

@k1LoW k1LoW closed this as completed Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants