Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9080187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:01:13+00:00 2026-06-16T20:01:13+00:00

Consider the following declarative User model in SQLAlchemy: class User(Base): id = Column(Integer, primary_key=True)

  • 0

Consider the following declarative User model in SQLAlchemy:

class User(Base):
    id = Column(Integer, primary_key=True)
    username = Column(String(50), unique=True)
    email = Column(String(1024), unique=True)
    points = Column(Integer, default=0)
    achievements = relationship('Achievement', 
    secondary=achievement_association_table,
    backref='users')
    reviews = relationship('Review', backref='author', lazy='dynamic')
    moderated = Column(Boolean, default=True)

When I do a SELECT * FROM user, I noticed that the query was not returning all of my columns, and showed only the “current_user” column which I can only surmise is a result of using Flask-Login.

Making the query User.query.all() resulted in the following SQL:

SELECT "user".created AS user_created, "user".modified AS user_modified, "user".id AS user_id, "user".username AS user_username, "user".email AS user_email, "user".points AS user_points, "user".moderated AS user_moderated

Can anyone help me understand why this table was created double quoted? None of my other (similarly defined) declarative models exhibit this behavior.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:01:14+00:00Added an answer on June 16, 2026 at 8:01 pm

    user is a reserved words and thus needs to be quoted.

    More details about quoted identifiers are in the manual:
    http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following declaration as part of SomeClass private Set<String> blah = new HashSet<String>();
Consider following string Some string with quotes and \pre-slashed\ quotes Using regex, I want
Consider following 2 programs giving same error First calss: public class Testing { Testing
Consider following scenario: I have RESTful URL /articles that returns list of articles user
Consider following program: static void Main (string[] args) { int i; uint ui; i
Consider the following declaration of a generic utility class in Delphi 2010: TEnumerableUtils =
Consider the following code spread out along 3 files: // secret.h #pragma once class
Consider the following code: #include <iostream> #include <type_traits> template<typename Type> class Test { public:
consider the following class declarations: namespace X { template<class T> class Foo { public:
Consider the following definitions: class Foo a where foo :: a -> Int class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.