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 5964387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:25:22+00:00 2026-05-22T19:25:22+00:00

Here is the current situation: I have a login page on which user enters

  • 0

Here is the current situation: I have a login page on which user enters his username and pass. Then I connect to the database using a “hardcoded” user (in the script), which opens connection to the server and executes the query to check if this data that user submitted is valid, and if so it “recognizes” him as logged in. This is the scenario that I saw and used in most of my applications.

Now, since I already have a database with many users (postgres database roles and not table “users” – I have to stress this to not mislead you) I was wondering if it would be good practice to do a pg_connect with a username and password the user puts in the login page.

My further question is how would I then keep them logged in? Session variable with username and hashed password? How is this affected from security viewpoint?

I would be grateful for your answers and any good reading material is appreciated!

  • 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-05-22T19:25:23+00:00Added an answer on May 22, 2026 at 7:25 pm

    I don’t think that’s wise at all. Technically you would have your root or admin user which can DROP or ALTER tables right? You don’t want it at all possible for a user to get access to your database internals.

    Why don’t you have a separate table (at the moment that is)? If you require your users to have real database access (for another system or application) then you should still create a proper users table.

    You can always write a script which will sync the data across from the internal DB users table to your application users table.

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

Sidebar

Related Questions

Here is the situation, I have a login page as the initial rootView of
Here is my current situation: I have a web page containing a couple scrollable
Here is my current situation: I have a user class that has an attribute
Here is my current setup: Database Role - MyDbRole Schema - MySchema User -
Here is my current situation: I have two tm structs, both set to the
Here's my current situation: I have images embedded on a class. package system {
Okay, so here's the situation: I have an application which uses SDL and OpenGL.
here is my current line of code: $(<li>).text($(this).text()).appendTo(#theList); Which results in <ul id=theList> <li>blah</li>
I'm making a web-app with PhoneGap. Here's my current hurdle: On page one, the
Here is the situation: We have to build a system made of web services

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.