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

failing test with parametrised view #906

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

Conversation

steeeveb
Copy link

hi,
I'm expecting that something like the following stmt would work:
txn.Exec("CREATE VIEW foo3 AS SELECT $1", 100)

but instead it seems that the $1 is ignored by the driver and it then fails.

in the test I've put the same stmt with the TABLE and it works, is it a bug or I'm missing something?
thanks,
stefano

@maddyblue
Copy link
Collaborator

This is a misuse of the API. You have to close txns before reusing them on the same connection.

@steeeveb
Copy link
Author

I just removed the usage of txns and the problem it's still there...

@maddyblue
Copy link
Collaborator

Ah. I think you just can't use parameters in postgres views. Try it in a different driver or with psql to verify.

@steeeveb
Copy link
Author

hi again,
I tried the same thing from both psql and python/psycopg2 and it works perfectly. IMHO the statement is correct and it never arrive to postgres, because I cannot see the error there.

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.

3 participants