MySQL : dateadd(dd, 1, getdate())
Oracle : SYSTIMESTAMP+NUMTODSINTERVAL(1,'day')
DB2 : CURRENT TIMESTAMP+1 DAY
PostgreSQL : LOCALTIMESTAMP+INTERVAL '1 day'
Показ дописів із міткою postgresql. Показати всі дописи
Показ дописів із міткою postgresql. Показати всі дописи
середа, 16 вересня 2009 р.
неділя, 30 серпня 2009 р.
Auto-increment field
How to create it in
a) MySQL:
CREATE TABLE `t1` ( `id` INT UNSIGNED AUTO_INCREMENT , ... ) AUTO_INCREMENT=... ;
b) PostgreSQL:
first create the sequence:
CREATE SEQUENCE "seq1" INCREMENT BY ... START WITH ... ;
and then - create the table:
CREATE TABLE "t1" ( "id" INT NOT NULL DEFAULT nextval('seq1') ...);
c) Microsoft SQL Server
CREATE TABLE [t1] ( [id] [int] NOT NULL identity(1, 2) ...);
(this means start with 1 and increment by 2 each time )
a) MySQL:
CREATE TABLE `t1` ( `id` INT UNSIGNED AUTO_INCREMENT , ... ) AUTO_INCREMENT=... ;
b) PostgreSQL:
first create the sequence:
CREATE SEQUENCE "seq1" INCREMENT BY ... START WITH ... ;
and then - create the table:
CREATE TABLE "t1" ( "id" INT NOT NULL DEFAULT nextval('seq1') ...);
c) Microsoft SQL Server
CREATE TABLE [t1] ( [id] [int] NOT NULL identity(1, 2) ...);
(this means start with 1 and increment by 2 each time )
субота, 25 липня 2009 р.
ER tools for PostgreSQL
Indeed, PostgreSQL is a great database engine. It's free and open-source. Great tool for the server.
But what about developers? Which ER tools can we use for database design? I'm not talking about the databases with 5 tables, I mean more complex designs.
Any more ideas guys?
But what about developers? Which ER tools can we use for database design? I'm not talking about the databases with 5 tables, I mean more complex designs.
- MySQL Workbench: a tool developed by Sun. It exports design into the MySQL-specific code, thus you have to modify it by hand in the text editor. Pros: you can show the graphic database design to the customer. Contras: MySQL-specific SQL and ... BUGGY !! (at least - the latest version. Just click the "Not NULL" checkbox in the fields list ... and the program dies).
- Database Designer for PostgreSQL from MicroOLAP. Never used but look at the prices: starting from 124.95 USD for personal use. I think the tool is good, but the price...
Any more ideas guys?
Підписатися на:
Дописи (Atom)