Postgresql Syntax Error At Or Near User
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you syntax error at or near postgresql might have Meta Discuss the workings and policies of this
Sql Error: 0, Sqlstate: 42601
site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or
Org Postgresql Util Psqlexception Error Syntax Error At Or Near
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community
Postgres Syntax Error At Or Near Create
of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR: syntax error at or near “user” up vote 2 down vote favorite I'm using Hibernate and have a persistent class called "User". Since this is a keyword, I marked the @Entity attribute with a syntax error at or near $1 postgres different name (I have seen, for example, this question: Unable to use table named "user" in postgresql hibernate) However, I still run into trouble because this class extends another, and it looks like hibernate is still trying to use "user" as a column name and getting messed up: @Entity( name = "XonamiUser" ) public class User extends PropertyContainer { ... and @MappedSuperclass public abstract class PropertyContainer implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) protected long key; /** tags */ @ElementCollection protected Set
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about sqlstate 42601 postgresql hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges "error: 42601: syntax error at or near" Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. postgres user table Join them; it only takes a minute: Sign up Postgresql : syntax error at or near “-” up vote 4 down vote favorite 1 I am Trying to run a query to update the user password using. alter http://stackoverflow.com/questions/9035971/error-syntax-error-at-or-near-user user dell-sys with password 'Pass@133'; But because of - it's giving me error like, ERROR: syntax error at or near "-" LINE 1: alter user dell-sys with password 'Pass@133'; ^ Can Anyone shade a light on it? postgresql share|improve this question edited Oct 13 at 6:41 a_horse_with_no_name 187k24236312 asked Sep 6 '13 at 11:18 OpenCurious 5532618 postgresql.org/docs/current/static/… –a_horse_with_no_name Sep 6 '13 at 11:35 add a comment| 2 Answers 2 active oldest votes up vote 11 down http://stackoverflow.com/questions/18656545/postgresql-syntax-error-at-or-near vote accepted I have Regenerated the issue in my system, postgres=# alter user my-sys with password 'pass11'; ERROR: syntax error at or near "-" LINE 1: alter user my-sys with password 'pass11'; ^ Here is the issue, psql is asking for input and you have given again the alter query see postgres-#That's why it's giving error at alter postgres-# alter user "my-sys" with password 'pass11'; ERROR: syntax error at or near "alter" LINE 2: alter user "my-sys" with password 'pass11'; ^ Solution is as simple as the error, postgres=# alter user "my-sys" with password 'pass11'; ALTER ROLE share|improve this answer answered Sep 6 '13 at 12:24 Atul Arvind 6,58852544 yes it is, I have not recognize it, Thanks a for the effort. –OpenCurious Sep 6 '13 at 12:27 add a comment| up vote 6 down vote Wrap it in double quotes alter user "dell-sys" with password 'Pass@133'; Notice that you will have to use the same case you used when you created the user using double quotes. Say you created "Dell-Sys" then you will have to issue exact the same whenever you refer to that user. I think the best you do is to drop that user and recreate without illegal identifier characters and without double quotes so you can later refer to it in any case you want. share|improve this answer edited Sep 6 '13 at 11:24 answered
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules Themes ERPAL for Service ProvidersIssues SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at https://www.drupal.org/node/2503431 or near "user" LINE 3: user bigint CHECK (user >= 0) NOT NULL default 0, ^ Needs workProject:ERPAL for Service ProvidersVersion:7.x-2.x-devComponent:CodePriority:NormalCategory:Bug reportAssigned:UnassignedIssue tags:PostgreSQLReporter:Drupa1ishCreated:June 9, 2015 - 23:58Updated:June 10, 2015 - 02:26 Log https://www.phpbb.com/community/viewtopic.php?f=46&t=1047045 in or register to update this issue Jump to:Most recent comment This was intialy reported at http://www.erpal.info/blog/blog/erpal-for-service-providers-installation , using Erpal with PostgreSQL Comments Comment #1 Drupa1ish CreditAttribution: Drupa1ish commented June 10, 2015 syntax error at 12:00am This error is too general, too vague to start debugging. A good tip is to check /var/lib/pgsql/9.3/data/pg_log Full error looks like: >ERROR: syntax error at or near "user" at character 81 < 2015-05-08 18:42:46.307 EEST >STATEMENT: CREATE TABLE ajax_checklist ( nid bigint CHECK (nid >= 0) NOT NULL default 0, user bigint CHECK (user >= 0) NOT NULL default 0, qid varchar(255) syntax error at NOT NULL, state bigint CHECK (state >= 0) NOT NULL default 0, PRIMARY KEY (nid, user, qid) ) Cannot report it in https://www.drupal.org/project/ajax_checklist queue, because there is no 7.x version. This may call for a core patch , properly escaping postgresql reserved words ( in our case word “user”)#2503197: Escaping PostgreSQL reserved words Log in or register to post comments Comment #2 Drupa1ish CreditAttribution: Drupa1ish commented June 10, 2015 at 2:28am Assigned: Drupa1ish » Unassigned Our ugly fix: Comment out function ajax_checklist_schema() { from ajax_checklist.install, and run manually the sql against the empty database, before installing Erpal CREATE TABLE ajax_checklist ( nid bigint CHECK (nid >= 0) NOT NULL default 0, "user" bigint CHECK ("user" >= 0) NOT NULL default 0, qid varchar(255) NOT NULL, state bigint CHECK (state >= 0) NOT NULL default 0, PRIMARY KEY (nid, "user", qid) ) The word "user" is escaped Log in or register to post comments Comment #3 Drupa1ish CreditAttribution: Drupa1ish commented June 10, 2015 at 12:02am Related issues: +#2503197: Escaping PostgreSQL reserved words Log in or register to post comments Comment #4 Drupa1ish CreditAttribution: Drupa1ish commented June 10, 2015 at 12:05am Stat
Involved Learn how you can get involved with the project. 3.1 New Features An overview of the new features and improvements in phpBB 3.1 (The new version of phpBB). The Team Find out who is responsible for all the mayhem. Contact Us Have a question the forums don't answer? Come here. Advertising Information if you want to advertise on phpBB.com. Find out more about the project » Downloads Latest Version Download the latest stable release of phpBB Update Packages Automatic Update packages for your phpBB release Language Packs Translate phpBB into (almost) any language you like Extensions Download extensions to enhance phpBB’s functionality Styles Your forums need a new look? Browse our Styles DB Official Tools Official tools by the phpBB team to assist you with your board Customise Customisation Database Our customisation database contains just about everything you might need to customise your phpBB board to your liking. In it you will find Extensions (for 3.1.x), MODs (for 3.0.x), Styles, Language Packs, BBCodes, as well as various tools. Extensions (3.1.x) Guides on how to use them and how to create your own. Extensions DB Download or submit extensions to our extensions database. Modifications (3.0.x) Guides on how to use them and how to create your own. Modifications DB Download or submit modifications to our MODs database. Styles Guides on how to use them and to create your own styles. Styles DB Download or submit styles to our styles database. More resources on customising your board » Support Documentation Installation guide and the complete documentation. Knowledge Base Team and user submitted articles covering support areas. Flash Tutorials View Flash Tutorials that help you with the use of phpBB. phpBB Support The Support related areas in our community forums. IRC Support Old school? Visit the IRC