Postgres support for UUIDIs it ever a good idea to denormalize for integrity?Improve performance on...
What species should be used for storage of human minds?
Allow console draw poker game to output more hands
Eww, those bytes are gross
How vim overwrites readonly mode?
Icon at Subject-line scrlttr2
I have trouble understanding this fallacy: "If A, then B. Therefore if not-B, then not-A."
Caron Accent v{a} doesn't render without usepackage{xeCJK}
Converting very wide logos to square formats
What's the oldest plausible frozen specimen for a Jurassic Park style story-line?
Case protection with emphasis in biblatex
Is it possible to detect 100% of SQLi with a simple regex?
What is a good reason for every spaceship to carry gun on board?
Where does documentation like business and software requirement spec docs fit in an agile project?
Coworker asking me to not bring cakes due to self control issue. What should I do?
What are some ways of extending a description of a scenery?
How to create a label containing values from different layers in QGIS
Does diversity provide anything that meritocracy does not?
Count repetitions of an array
Why is this column order in my non-clustered index better for my query?
Boss asked me to sign a resignation paper without a date on it along with my new contract
Can you determine if focus is sharp without diopter adjustment if your sight is imperfect?
Critique vs nitpicking
How to politely refuse in-office gym instructor for steroids and protein
Buying a "Used" Router
Postgres support for UUID
Is it ever a good idea to denormalize for integrity?Improve performance on concurrent UPDATEs for a timestamp column in PostgresSlow fulltext search due to wildly inaccurate row estimatesDelete duplicate records with no change in betweenDefault value for UUID column in PostgresNon-integer primary key considerationspostgres: Upgraded RDS Postgres from 9.4 - 9.6, id fields went from SERIAL to INTDifference between UUID UUID + IdPostgreSQL 9.5 query performance depends on JOINed column in SELECT clauseStandard behaviour in executing multiple alter statements in Postgres
My understanding is that Postgres supports UUID data type out-of-the-box. I'm running Postgres on Amazon RDS with Engine version 10.6 and am scratching my head as to why the following commands are not behaving as expected:
CREATE TABLE IF NOT EXISTS "Tenants" ("id" UUID NOT NULL , "domain" VARCHAR(255) NOT NULL UNIQUE, "name" VARCHAR(255) NOT NULL, "schema" VARCHAR(255) NOT NULL UNIQUE, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));
The critical part here is that I'm creating "id" UUID NOT NULL
. So far, so good. Or so I thought.
Next, I'm trying to add an entry:
INSERT INTO "Tenants" ("id","domain","name","schema","createdAt","updatedAt") VALUES ('3b6b220b-2690-4279-8343-cbe6167f7596','test1.stage-domain.io','Test1','test1','2019-02-25 14:29:33.475 +00:00','2019-02-25 14:29:33.475 +00:00') RETURNING *;
and surprisingly the following error shows up:
"SequelizeDatabaseError: invalid input syntax for integer: "3b6b220b-2690-4279-8343-cbe6167f7596"
Sure enough, if I go to PGAdmin, I'm seeing that the column has not been set to UUID, rather it has been set to an integer:
The dropdown shown in this picture does not even contain a UUID type.
The weirdest part is that I created a different Postgresql server on RDS last night and everything actually worked just fine in that instance.
My question: How can I get my database to recognize the UUID type when creating the Tenants table?
postgresql uuid
add a comment |
My understanding is that Postgres supports UUID data type out-of-the-box. I'm running Postgres on Amazon RDS with Engine version 10.6 and am scratching my head as to why the following commands are not behaving as expected:
CREATE TABLE IF NOT EXISTS "Tenants" ("id" UUID NOT NULL , "domain" VARCHAR(255) NOT NULL UNIQUE, "name" VARCHAR(255) NOT NULL, "schema" VARCHAR(255) NOT NULL UNIQUE, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));
The critical part here is that I'm creating "id" UUID NOT NULL
. So far, so good. Or so I thought.
Next, I'm trying to add an entry:
INSERT INTO "Tenants" ("id","domain","name","schema","createdAt","updatedAt") VALUES ('3b6b220b-2690-4279-8343-cbe6167f7596','test1.stage-domain.io','Test1','test1','2019-02-25 14:29:33.475 +00:00','2019-02-25 14:29:33.475 +00:00') RETURNING *;
and surprisingly the following error shows up:
"SequelizeDatabaseError: invalid input syntax for integer: "3b6b220b-2690-4279-8343-cbe6167f7596"
Sure enough, if I go to PGAdmin, I'm seeing that the column has not been set to UUID, rather it has been set to an integer:
The dropdown shown in this picture does not even contain a UUID type.
The weirdest part is that I created a different Postgresql server on RDS last night and everything actually worked just fine in that instance.
My question: How can I get my database to recognize the UUID type when creating the Tenants table?
postgresql uuid
add a comment |
My understanding is that Postgres supports UUID data type out-of-the-box. I'm running Postgres on Amazon RDS with Engine version 10.6 and am scratching my head as to why the following commands are not behaving as expected:
CREATE TABLE IF NOT EXISTS "Tenants" ("id" UUID NOT NULL , "domain" VARCHAR(255) NOT NULL UNIQUE, "name" VARCHAR(255) NOT NULL, "schema" VARCHAR(255) NOT NULL UNIQUE, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));
The critical part here is that I'm creating "id" UUID NOT NULL
. So far, so good. Or so I thought.
Next, I'm trying to add an entry:
INSERT INTO "Tenants" ("id","domain","name","schema","createdAt","updatedAt") VALUES ('3b6b220b-2690-4279-8343-cbe6167f7596','test1.stage-domain.io','Test1','test1','2019-02-25 14:29:33.475 +00:00','2019-02-25 14:29:33.475 +00:00') RETURNING *;
and surprisingly the following error shows up:
"SequelizeDatabaseError: invalid input syntax for integer: "3b6b220b-2690-4279-8343-cbe6167f7596"
Sure enough, if I go to PGAdmin, I'm seeing that the column has not been set to UUID, rather it has been set to an integer:
The dropdown shown in this picture does not even contain a UUID type.
The weirdest part is that I created a different Postgresql server on RDS last night and everything actually worked just fine in that instance.
My question: How can I get my database to recognize the UUID type when creating the Tenants table?
postgresql uuid
My understanding is that Postgres supports UUID data type out-of-the-box. I'm running Postgres on Amazon RDS with Engine version 10.6 and am scratching my head as to why the following commands are not behaving as expected:
CREATE TABLE IF NOT EXISTS "Tenants" ("id" UUID NOT NULL , "domain" VARCHAR(255) NOT NULL UNIQUE, "name" VARCHAR(255) NOT NULL, "schema" VARCHAR(255) NOT NULL UNIQUE, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));
The critical part here is that I'm creating "id" UUID NOT NULL
. So far, so good. Or so I thought.
Next, I'm trying to add an entry:
INSERT INTO "Tenants" ("id","domain","name","schema","createdAt","updatedAt") VALUES ('3b6b220b-2690-4279-8343-cbe6167f7596','test1.stage-domain.io','Test1','test1','2019-02-25 14:29:33.475 +00:00','2019-02-25 14:29:33.475 +00:00') RETURNING *;
and surprisingly the following error shows up:
"SequelizeDatabaseError: invalid input syntax for integer: "3b6b220b-2690-4279-8343-cbe6167f7596"
Sure enough, if I go to PGAdmin, I'm seeing that the column has not been set to UUID, rather it has been set to an integer:
The dropdown shown in this picture does not even contain a UUID type.
The weirdest part is that I created a different Postgresql server on RDS last night and everything actually worked just fine in that instance.
My question: How can I get my database to recognize the UUID type when creating the Tenants table?
postgresql uuid
postgresql uuid
asked 2 mins ago
wheresmycookiewheresmycookie
101
101
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230672%2fpostgres-support-for-uuid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230672%2fpostgres-support-for-uuid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown