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

PostgresSQL access on rows.Scan fails for varchar fields #15

Open
ghost opened this issue Dec 12, 2014 · 0 comments
Open

PostgresSQL access on rows.Scan fails for varchar fields #15

ghost opened this issue Dec 12, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 12, 2014

Hello Gophercast crew -

Appreciate the lessons. Quite new to Go and been trying out your tutorials. Using Go 1.4 on Ubuntu.

From a Python / Java / SQL background and Go has been a great language.

Getting an error on the rows.Scan - on fields that are VARCHAR in Postgres.
sql: Scan error on column index 1: unsupported driver -> Scan pair: -> *string

Do not get the erro if the fields are CHAR.

I updated the names of libraries for myself and it compiles and such - and even runs.
But get this other error when I get to templates (ie if I pass the above error in Lesson 4).

I get an error in that a field I am using in the struct to store the variables is unexportable.

template: members:9:9: executing "members" at <.ihg_member_id>: ihg_member_id is an unexported field of struct type main.Member

So I am using a struct Members instead of the Books table you showed - but does the same thing.
And I can access Memebers fine if the fields ar CHAR but not VARCHAR.

Your help would be very appreciated.

Thank you.

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

No branches or pull requests

0 participants