473,809 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

varchar and unique

Hi @all

i try to create a ssh public key database on a mysql-5.0.16 DB

the problem is the size of the varchar, i want a size 1024...

mysql> create table sshkeys ( absid integer unsigned zerofill NOT NULL
auto_increment, rsa varchar(1024) UNIQUE NULL, dsa varchar(1024) UNIQUE
NULL, PRIMARY KEY(absid) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ERROR 1005 (HY000): Can't create table './test/sshkeys.frm' (errno:
139)

it runs fine without unique :-(

mysql> create table sshkeys ( absid integer unsigned zerofill NOT NULL
auto_increment, rsa varchar(1024) NULL, dsa varchar(1024) NULL, PRIMARY
KEY(absid) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.07 sec)

with unique a can create varchar fields with a size ~700

is it a bug or a feature of mysql ? :-)

background of the table:
a system has rsa or dsa key, or both
has a system only one type, the entry in the other type is NULL.
Another table has a forgein key reference to the sshkeys table, this
table contains the system name or alias name.

Thanks for help

Frank

Dec 19 '05 #1
2 3166
<ro*****@web.de > wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
it runs fine without unique :-(

mysql> create table sshkeys ( absid integer unsigned zerofill NOT NULL
auto_increment, rsa varchar(1024) NULL, dsa varchar(1024) NULL, PRIMARY
KEY(absid) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.07 sec)

with unique [i] can create varchar fields with a size ~700


http://dev.mysql.com/doc/refman/5.0/...te-index.html:
"Prefixes can be up to 1000 bytes long (767 bytes for InnoDB tables)."

Regards,
Bill K.
Dec 19 '05 #2
Hi,

I didn't even think that a varchar field can take 700 characters - I
thought, the limit was 512.

However, I guess, a text field might be more suitable for this.

Markus
Dec 19 '05 #3

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

Similar topics

0
524
by: Randell D. | last post by:
Folks, I'm using MySQL 3.23.56-Max and I have several CREATE TABLEs similar to the following in structure (taken from my PHP script so ignore the double quotes and periods) "ID MEDIUMINT(10) NOT NULL AUTO_INCREMENT," . "publisherHash CHAR(32) NOT NULL," . "articleHash CHAR(32) NOT NULL UNIQUE," . "issueID MEDIUMINT(10) NOT NULL," .
2
1906
by: ImraneA | last post by:
Hi there Got a interesting problem (depends on a point of view.....). Background :- Agent (within Domino) is run daily basis which extracts data from Domino Notes application to SQL Server 2000 database. Agent first removes ALL contents and then appends ALL data. Reporting Tool is SQL Reporting Services (very cool !!).
5
6072
by: jim_geissman | last post by:
One table I manage has a clustered index, and it includes some varchar columns. When it is initially created, all the columns in the clustered index are populated, and then some of the longer varchars are populated through update queries. If the varchar columns are stored outside the clustered structure, then it would make sense to create the clustered index before populating the varchar columns. Otherwise it would make sense to wait,...
0
2408
by: sfh | last post by:
Greetings all, I have a question concerning primary key types. In the past, I have always created tables with a primary key as an "int" such as: CREATE TABLE color_id ( color_id int(10) unsigned NOT NULL auto_increment primary key, color varchar(45) default NULL ) TYPE=INNODB DEFAULT CHARSET=latin1;
1
4698
by: sfh | last post by:
Greetings all, (I had posted this in MS SQL on accident, my apologies :( ) I have a question concerning primary key types. In the past, I have always created tables with a primary key as an "int" such as: CREATE TABLE color_id ( color_id int(10) unsigned NOT NULL auto_increment primary key,
2
4514
by: Laurent | last post by:
DB2 8.1 ------- db2 => create table test (COL1 VARCHAR(10)) db2 => insert into test values ('A') db2 => insert into test values ('A ') db2 => insert into test values ('B') db2 => insert into test values ('B ') db2 => insert into test values ('C') db2 => select distinct COL1, LENGTH(COL1) from test
7
4785
by: James o'konnor | last post by:
hello. i have the next for create one table into db2 CREATE TABLE "MYSQUEMA"."TABLADEMO" ( "ID" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH +0 INCREMENT BY +1 MINVALUE +0 MAXVALUE +2147483647 NO CYCLE
2
2130
by: eflatunn | last post by:
Hi all, I paid 3 hours for it but couldn't get succeed. I'm writing a stored procedure to get a data entry in a table. The problem is that I can't simply use commands "SELECT" or "CASE" directy. First I have to declare a varchar parameter and put all of this in this parameter. (The reason is that the stored procedure is not unique for a table. Year and month, which are parts of the table name are also parameters of my S.P.) There is NO...
2
1616
bugboy
by: bugboy | last post by:
I have a table of words which are all unique and will not change.. can i use the words themselves as the primary key or is it better to use an integer? I think it would simplify my queries a great deal if I didn't have to retrieve the primary key for the word /or the word for the key every time i query. I'm looking for the best efficiency but maybe i'm splitting hairs here? I've read that strings make lousy keys. But since mine are all...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10387
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.