473,408 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

username length character limits?

Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.

-----------------------------
ANYONE have any ideas why?
-----------------------------

PG_VERSION says it's 7.3. I don't know how to find out any more accurately the subversion of that.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
12 5379
I now have tried an equal length name, and it logs in fine:

't012345678901_web_user' with pword 'password' works fine.

The problem below is consistent. I can drop and recrate the user, and it always cannot be logged into using that name. I can successfully alter the user, so the system is finding it, I just can't authenticate into it.
Dennis Gearon wrote:
Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.

-----------------------------
ANYONE have any ideas why?
-----------------------------

PG_VERSION says it's 7.3. I don't know how to find out any more
accurately the subversion of that.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
another name that does not work is 'H1q2W3e4R5_web_user'.

It seems to not like many alternations between numbers and letters.

Dennis Gearon wrote:
Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.

-----------------------------
ANYONE have any ideas why?
-----------------------------

PG_VERSION says it's 7.3. I don't know how to find out any more
accurately the subversion of that.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3
tried it with two underscores and short name:
H1q2W_web_user

with only one underscore and a long name:
H1q2W3e4R5t6Y7u8Iweb_user

with only oneunderscore and a short name:
H1q2Wweb_user

with no underscore and a long name:
H1q2W3e4R5t6Y7u8Iwebuser

with no underschore and a short name:
H1q2W3webuser

--------------------------------------------------------------------
NONE OF THESE NAMES WORK AS USER NAMES WITH THE PASSWORD 'password'.
--------------------------------------------------------------------

I have no idea why.

Where does it say what is the legal:

length
characters
character set (?)

for user names?

one underscore and a short name.

Dennis Gearon wrote:
Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.

-----------------------------
ANYONE have any ideas why?
-----------------------------

PG_VERSION says it's 7.3. I don't know how to find out any more accurately the subversion of that.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #4
Stephan Szabo wrote:
On Sat, 3 Jul 2004, Dennis Gearon wrote:

Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.

Are you sure that you're not just running into a case problem
with case folded names (non-quoted names from sql statements) versus
non-case folded names (programs which treat their arguments as quoted like
psql).

I am putting the exact same string into both situations:

A/ creating the username
B/ trying to log in.

If the database is not going to respect case in one, it shouldn't respect case in the other, right?

Maybe because it's feeding the name to the MD5 library with case, but checking it without case later?

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #5

On Sat, 3 Jul 2004, Dennis Gearon wrote:
Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.


Are you sure that you're not just running into a case problem
with case folded names (non-quoted names from sql statements) versus
non-case folded names (programs which treat their arguments as quoted like
psql).

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #6
Dennis Gearon wrote:
another name that does not work is 'H1q2W3e4R5_web_user'.
Sounds like a quoting problem. In the meantime, read this:
http://www.fr.postgresql.org/docs/7....reporting.html

It seems to not like many alternations between numbers and letters.

Dennis Gearon wrote:
Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.

-----------------------------
ANYONE have any ideas why?
-----------------------------

PG_VERSION says it's 7.3. I don't know how to find out any more
accurately the subversion of that.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #7


On Sat, 3 Jul 2004, Dennis Gearon wrote:
Stephan Szabo wrote:
On Sat, 3 Jul 2004, Dennis Gearon wrote:

Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.

Are you sure that you're not just running into a case problem
with case folded names (non-quoted names from sql statements) versus
non-case folded names (programs which treat their arguments as quoted like
psql).

I am putting the exact same string into both situations:

A/ creating the username


How did you create the user. Did you use the shell script or a create
user statement from inside a session in the database?
B/ trying to log in.

If the database is not going to respect case in one, it shouldn't
respect case in the other, right?


IIRC, psql (and the createuser shell script and such) treat it as if you
had double quoted its argument because of the way shells handle quotes
which would necessitate something like '"FOO"' to use a quoted uppercase
name. So, if you say psql FOO -U BAR, you're saying log into database
"FOO" as user "BAR".
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #8
Stephan Szabo wrote:

On Sat, 3 Jul 2004, Dennis Gearon wrote:

Stephan Szabo wrote:
On Sat, 3 Jul 2004, Dennis Gearon wrote:

Please CC me:

If I create the user 'web_user'
with password 'password'
I can connect using 'psql' just fine.

If I create the user 'D1Khb2g5m7FGk_web_user'
with password 'password'
I CANNOT connect using 'psql', I get authentication error.
Are you sure that you're not just running into a case problem
with case folded names (non-quoted names from sql statements) versus
non-case folded names (programs which treat their arguments as quoted like
psql).


I am putting the exact same string into both situations:

A/ creating the username

How did you create the user. Did you use the shell script or a create
user statement from inside a session in the database?

B/ trying to log in.

If the database is not going to respect case in one, it shouldn't
respect case in the other, right?

IIRC, psql (and the createuser shell script and such) treat it as if you
had double quoted its argument because of the way shells handle quotes
which would necessitate something like '"FOO"' to use a quoted uppercase
name. So, if you say psql FOO -U BAR, you're saying log into database
"FOO" as user "BAR".

I created the user from inside of a psql session.

And I cannot either connect from invoking a different psql session from the shell,
nor from PHP using it's compiled in c library for postgres.

It seems it's another gotcha with this database. I wouldn't have thought it would so difficult to insert upper(whatever was enterd) into the database, and validate it the same way.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #9

On Sat, 3 Jul 2004, Dennis Gearon wrote:
Stephan Szabo wrote:
IIRC, psql (and the createuser shell script and such) treat it as if you
had double quoted its argument because of the way shells handle quotes
which would necessitate something like '"FOO"' to use a quoted uppercase
name. So, if you say psql FOO -U BAR, you're saying log into database
"FOO" as user "BAR".

I created the user from inside of a psql session.

And I cannot either connect from invoking a different psql session from the shell,
nor from PHP using it's compiled in c library for postgres.

It seems it's another gotcha with this database. I wouldn't have thought
it would so difficult to insert upper(whatever was enterd) into the
database, and validate it the same way.


Create user Foo and Create user "Foo" are creating users with different
names. Since we want to allow both names to exist at the same time and for
you to refer to either, there needs to be a mechanism for doing so. I
don't know about PHP, but as I said above, psql does not treat its
arguments as normal identifiers (thus lowercasing them) because it was
decided to be simpler for people to refer to either user. For the former,
it is foo and the latter Foo.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #10
Stephan Szabo wrote:
On Sat, 3 Jul 2004, Dennis Gearon wrote:

Stephan Szabo wrote:

IIRC, psql (and the createuser shell script and such) treat it as if you
had double quoted its argument because of the way shells handle quotes
which would necessitate something like '"FOO"' to use a quoted uppercase
name. So, if you say psql FOO -U BAR, you're saying log into database
"FOO" as user "BAR".


I created the user from inside of a psql session.

And I cannot either connect from invoking a different psql session from the shell,
nor from PHP using it's compiled in c library for postgres.

It seems it's another gotcha with this database. I wouldn't have thought
it would so difficult to insert upper(whatever was enterd) into the
database, and validate it the same way.

Create user Foo and Create user "Foo" are creating users with different
names. Since we want to allow both names to exist at the same time and for
you to refer to either, there needs to be a mechanism for doing so. I
don't know about PHP, but as I said above, psql does not treat its
arguments as normal identifiers (thus lowercasing them) because it was
decided to be simpler for people to refer to either user. For the former,
it is foo and the latter Foo.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

So, if I >>WANT<< a user name with case:

((A))
Creating user in psql, it will respect case automatically?
To OPEN psql using that user, I have to put it in double quotes?

(to those new to postgres, the '#' means superuser is logged in)
-------------------------------------------------------------------
database_name# create user CasedNameForUser with password 'password';
database_name#\q
user/system_prompt> psql -U "CasedNameForUser" -d dbase -p port
password:
Congratulations statements ....
dbase_name_as_prompt

###OR###

((B))
Creating user in psql, I will have to use double quotes?
To OPEN psql using that user, , it will respect case automatically?

(to those new to postgres, the '#' means superuser is logged in)
-------------------------------------------------------------------
database_name# create user "CasedNameForUser" with password 'password';
database_name#\q
user/system_prompt> psql -U CasedNameForUser -d dbase -p port
password:
Congratulations statements ....
dbase_name_as_prompt
and the converse, if I >>WANT<< a user name withOUT case:

What then?
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #11

On Sat, 3 Jul 2004, Dennis Gearon wrote:
Stephan Szabo wrote:
On Sat, 3 Jul 2004, Dennis Gearon wrote:

Stephan Szabo wrote:
IIRC, psql (and the createuser shell script and such) treat it as if you
had double quoted its argument because of the way shells handle quotes
which would necessitate something like '"FOO"' to use a quoted uppercase
name. So, if you say psql FOO -U BAR, you're saying log into database
"FOO" as user "BAR".

I created the user from inside of a psql session.

And I cannot either connect from invoking a different psql session from the shell,
nor from PHP using it's compiled in c library for postgres.

It seems it's another gotcha with this database. I wouldn't have thought
it would so difficult to insert upper(whatever was enterd) into the
database, and validate it the same way.

Create user Foo and Create user "Foo" are creating users with different
names. Since we want to allow both names to exist at the same time and for
you to refer to either, there needs to be a mechanism for doing so. I
don't know about PHP, but as I said above, psql does not treat its
arguments as normal identifiers (thus lowercasing them) because it was
decided to be simpler for people to refer to either user. For the former,
it is foo and the latter Foo.


So, if I >>WANT<< a user name with case:

((B))
Creating user in psql, I will have to use double quotes?
To OPEN psql using that user, , it will respect case automatically?


This one. Note that using the createuser shell script does the quoting
for you.
and the converse, if I >>WANT<< a user name withOUT case:

What then?


Then, you create it without double quotes and the name is converted to
lower case. If you're using an interface which takes the username given
exactly (like psql) then you need to provide the lower case version of the
name (as above, using foo to refer to the user Foo, while using Foo to
refer to the user "Foo")
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #12
Stephan Szabo wrote:
On Sat, 3 Jul 2004, Dennis Gearon wrote:

Stephan Szabo wrote:

On Sat, 3 Jul 2004, Dennis Gearon wrote:

Stephan Szabo wrote:

>IIRC, psql (and the createuser shell script and such) treat it as if you
>had double quoted its argument because of the way shells handle quotes
>which would necessitate something like '"FOO"' to use a quoted uppercase
>name. So, if you say psql FOO -U BAR, you're saying log into database
>"FOO" as user "BAR".
>
>

I created the user from inside of a psql session.

And I cannot either connect from invoking a different psql session from the shell,
nor from PHP using it's compiled in c library for postgres.

It seems it's another gotcha with this database. I wouldn't have thought
it would so difficult to insert upper(whatever was enterd) into the
database, and validate it the same way.
Create user Foo and Create user "Foo" are creating users with different
names. Since we want to allow both names to exist at the same time and for
you to refer to either, there needs to be a mechanism for doing so. I
don't know about PHP, but as I said above, psql does not treat its
arguments as normal identifiers (thus lowercasing them) because it was
decided to be simpler for people to refer to either user. For the former,
it is foo and the latter Foo.


So, if I >>WANT<< a user name with case:

((B))
Creating user in psql, I will have to use double quotes?
To OPEN psql using that user, , it will respect case automatically?

This one. Note that using the createuser shell script does the quoting
for you.

and the converse, if I >>WANT<< a user name withOUT case:

What then?

Then, you create it without double quotes and the name is converted to
lower case. If you're using an interface which takes the username given
exactly (like psql) then you need to provide the lower case version of the
name (as above, using foo to refer to the user Foo, while using Foo to
refer to the user "Foo")

Thanks for clearing that up:
usernames are converted to lower case when created,
but psql will quote them and look for the case that is supplied
while trying to login.

That's my take on it, and I'm putting it here for others to see, who will be coming in as newbies some day.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Gerry N | last post by:
My guestbook brekas down if the message is to long. The method is POST, can it still be limits in the length of the message? Gerry The code: <?php header("Cache-Control: no-cache,...
4
by: Lobang Trader | last post by:
Hi all, I am trying to create a username and a password class. I would like to know what are the RECOMMENDED minimum and maximum length for both fields? These fields will be something like...
4
by: wing | last post by:
Hi all, I find a JavaScript that limits the field length in a textarea, but it is not completed. The script does not handle the copy and paste case. For example, says the textarea field...
3
by: Seong-Kook Shin | last post by:
C FAQ Q 13.2 says that sprintf() is guaranteed to work only for n <= 509: sprintf(dest, "%.*s", n, source); Does 509 appear in any C standard? If not, where it came from? I looked over C99...
6
by: Håkan | last post by:
Hi! I get HTTP/1.1 400 Bad Request when I try to access a aspx-page running on server 2003 SP1 from internet explorer 6 running on the same machine. Here is the URL I am using: ...
11
by: =?Utf-8?B?VmxhZCBIcnlib2s=?= | last post by:
Using IIS7, Vista x64, ASP.NET 2.0. I am getting HTTP 400 "Bad Request" for the following URL:...
4
by: Alec MacLean | last post by:
Is anyone aware of a size limit imposed on the subject text when using the System.Net.Mail library? I'm getting problems of message not being recieved if the subject exceeds 15 chars. Thx
4
by: Daryl Lee | last post by:
I am trying to locate all lines in a suite of files with quoted strings of particular lengths. A search pattern like r'".{15}"' finds 15-character strings very nicely. But I have some very long...
11
by: lak | last post by:
Hello firends. I want to know what is the variable length in c. I K&R they stated that atleast 31 character. But I give 1 lakhs length to a variable, but my compiler doesn't say any error. It...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.