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

ERROR: zero-length delimited identifier at or near """" (PG::SyntaxError) #42

Closed
villelahdenvuo opened this issue Apr 9, 2018 · 2 comments

Comments

@villelahdenvuo
Copy link

I have a function:

CREATE FUNCTION cas.user_full_name(u cas.user)
			RETURNS VARCHAR AS $$ BEGIN
				RETURN u.first_name || ' ' || u.last_name;
			END; $$ LANGUAGE plpgsql IMMUTABLE;

And piggly trace -s '/cas\./' outputs:

postgres@8df3dca48d04:~$ piggly trace -s '/cas\./'
compiling 2 procedures
ProcessQueue running concurrently
tracing 2 procedures
/var/lib/gems/2.3.0/gems/piggly-2.2.4/lib/piggly/installer.rb:50:in `exec': ERROR:  zero-length delimited identifier at or near """" (PG::SyntaxError)
LINE 1: ...lace function "cas"."user_full_name" (in "u" "cas".""user"")
                                                              ^

Error installing traced procedure cas.user_full_name from /home/postgres/piggly/cache/Dumper/53c863ad9a8bf9d1ebf0372d02c797f2.plpgsql

Probably because user is a keyword and an identifier?

@kputnam
Copy link
Owner

kputnam commented Apr 10, 2018

I see ""user"" is double-quoted for some reason. My guess is it came back from a SQL query as "user" and then the code that generates SQL added another set of quotes. I'll check into it this week and I expect it's an easy fix. Thanks for reporting it!

@kputnam
Copy link
Owner

kputnam commented Apr 18, 2018

Ok, I confirmed that is the problem. Should have a fix pretty quickly!

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

2 participants