473,396 Members | 2,011 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,396 software developers and data experts.

What is the sql way to restrict "superadmin" priv to one user?

Is there some way to restrict in mysql that certan field has only ONE ROW
with CERTAIN VALUE X while other rows can have any values but not this
one(so "unique" is not the answer..)?

This can be of course done in application level, but it would just be nice
to know. I would build my application so that only one user can be
superadmin, while others are normal admins or something else.

Of course this restriction would not be enough anyway, because I still need
to figure out what happens in different cases. So actual benefit would be
close to zero, but nerd idealist inside of me requires to know - "we have a
right to know".
Jul 20 '05 #1
2 1472
Perttu Pulkkinen wrote:
Is there some way to restrict in mysql that certan field has only ONE ROW
with CERTAIN VALUE X while other rows can have any values but not this
one(so "unique" is not the answer..)?


From what I have read in the docs, MySQL does not appear to have
support for user-defined constraints, as some RDBMS implementations do.
I recommend you go ahead and implement the constraint in your
application logic.

Regards,
Bill K.
Jul 20 '05 #2
Perttu Pulkkinen wrote:
Is there some way to restrict in mysql that certan field has only ONE ROW
with CERTAIN VALUE X while other rows can have any values but not this
one(so "unique" is not the answer..)?


From what I have read in the docs, MySQL does not appear to have
support for user-defined constraints, as some RDBMS implementations do.
I recommend you go ahead and implement the constraint in your
application logic.

Regards,
Bill K.
Jul 20 '05 #3

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

Similar topics

3
by: Timo-Pekka Oikarinen | last post by:
Is there PHP chat script *without* MySQL? Demands: absolutely FREE (no adware, shareware etc.), No MySQL needed, one permanent public chat, can make your own channels (public/private) like IRC,...
8
by: Perttu Pulkkinen | last post by:
Content management system I'm working consists pages, categories, users (and images). It is in the first place dircted to companies where 1-10 persons are taking care of site content. I am thinking...
0
by: Perttu Pulkkinen | last post by:
I ask all php-freaks say how they feel this CMS approach especially from the point of view of 1) admin usability, 2) user rights management and) database speed. In my approach webcontent could...
0
by: Perttu Pulkkinen | last post by:
Is there some way to restrict in mysql that certan field has only ONE ROW with CERTAIN VALUE X while other rows can have any values but not this one(so "unique" is not the answer..)? This can be...
1
by: Brett | last post by:
I have an application with two user roles - regular or admin. If an admin logs in, a button to the admin reporting section appears. This keeps maintenance simple. However, I need to add more...
1
by: Diffident | last post by:
Hello All, Does the Application_AuthenticateRequest event get fired for every request made to the application? According to my understanding, YES it does get fired for each and every request....
15
by: Dan2kx | last post by:
Hello peeps!! got another problem that is outta my league.... What i want (and can do) is to disable the DB window on startup, (what i cant do) disable the shift key load... Also i need...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.