On Jul 23, 2008, at 12:00 PM, Shane Ambler wrote:
To be honest I hadn't seen the use of INSERT INTO table (fld_x,
fld_y,fld_z) VALUES (DEFAULT, 'y','z') before, I have always gone
with INSERT INTO table (fld_x, fld_y,fld_z) VALUES (NULL, 'y','z')
is DEFAULT a better option than using
I've worked as a web developer on mostly small business websites for the
past seven years, and while I've had some limited experience with older
versions of PostgreSQL (7.* ??), I've mostly used MySQL all this time.
I now work for local govt and am building a large intranet-like system
which
On 23/07/2008 10:48, admin wrote:
So anyway, life story aside, I have a couple of very newbie questions
after tinkering with PostgreSQL 8.1.9 for a day converting some
PHP/MySQL code:
Hi there,
You should consider upgrading to 8.3 if you can - there are significant
performance improvements.
On 23/07/2008 11:01, Raymond O'Donnell wrote:
On 23/07/2008 10:48, admin wrote:
1. Is a SEQUENCE what I use instead of auto_increment?
Yes. The easiest thing is to define the column as type SERIAL - this
will create the sequence for you and associate it with the column.
Alternatively, you
admin wrote:
I'm convinced that PostgreSQL's performance is not an issue (both
because it's improved and traffic will be relatively low anyway)
It's really rather solid in performance terms anyway, especially for
non-trivial workloads where data consistency and reliability are important.
On Wed, Jul 23, 2008 at 07:18:15PM +0930, admin wrote:
1. Is a SEQUENCE what I use instead of auto_increment?
Yes. Perhaps better use it indirectly with (BIG)SERIAL:
create table foo (
pk (big)serial
);
2. Does this work in PostgreSQL:
INSERT INTO table VALUES ('x','y','z')
Yes,
am Wed, dem 23.07.2008, um 19:18:15 +0930 mailte admin folgendes:
1. Is a SEQUENCE what I use instead of auto_increment?
Yes.
2. Does this work in PostgreSQL:
INSERT INTO table VALUES ('x','y','z')
or do I need to do this
INSERT INTO table (fld_x,fld_y,fld_z) VALUES ('x','y','z')
admin wrote:
So anyway, life story aside, I have a couple of very newbie questions
after tinkering with PostgreSQL 8.1.9 for a day converting some
PHP/MySQL code:
Here I have to ask the obvious thing: Why not a more current version?
1. Is a SEQUENCE what I use instead of auto_increment?
On Wed, Jul 23, 2008 at 3:48 AM, admin [EMAIL PROTECTED] wrote:
I'm convinced that PostgreSQL's performance is not an issue (both because
it's improved and traffic will be relatively low anyway), and that the
benefits of PostgreSQL's advanced features are too good to ignore. I'm
hoping to
Raymond O'Donnell wrote:
1. Is a SEQUENCE what I use instead of auto_increment?
Yes. The easiest thing is to define the column as type SERIAL - this
will create the sequence for you and associate it with the column.
Alternatively, you can create the sequence by hand, create the column
as an
Craig Ringer wrote:
INSERT INTO table (fld_y,fld_z) VALUES ('y','z')
which is really doing:
INSERT INTO table (fld_x, fld_y,fld_z) VALUES (DEFAULT, 'y','z')
To be honest I hadn't seen the use of INSERT INTO table (fld_x,
fld_y,fld_z) VALUES (DEFAULT, 'y','z') before, I have always gone
Shane Ambler wrote:
INSERT INTO table (fld_x, fld_y,fld_z) VALUES (DEFAULT, 'y','z')
To be honest I hadn't seen the use of INSERT INTO table (fld_x,
fld_y,fld_z) VALUES (DEFAULT, 'y','z') before, I have always gone with
INSERT INTO table (fld_x, fld_y,fld_z) VALUES (NULL, 'y','z')
...
On 12:00 pm 07/23/08 Shane Ambler [EMAIL PROTECTED] wrote:
INSERT INTO table (fld_y,fld_z) VALUES ('y','z')
I believe that is the most common way of doing it.
which is really doing:
INSERT INTO table (fld_x, fld_y,fld_z) VALUES (DEFAULT, 'y','z')
Correct.
So either one should be fine.
Shane Ambler wrote:
Raymond O'Donnell wrote:
...
INSERT INTO table (fld_y, fld_z) VALUES ('y', 'z');
Another way is INSERT INTO table VALUES (NULL,'y','z')
of course you meant:
INSERT INTO table VALUES (DEFAULT,'y','z')
since Null would be wrongly insert NULL value instead
of using the
This is one of the many SQL bad habits you've likely picked up from
using MySQL. I'd highly suggest reading the pgsql users manual cover
to cover, you'll pick up a lot of good info on how to drive
postgresql. Other things that work in mysql but fail in pgsql include
inserting things that are
On Wed, Jul 23, 2008 at 10:22 PM, Artacus [EMAIL PROTECTED] wrote:
This is one of the many SQL bad habits you've likely picked up from
using MySQL. I'd highly suggest reading the pgsql users manual cover
to cover, you'll pick up a lot of good info on how to drive
postgresql. Other things
16 matches
Mail list logo