Re: [GENERAL] A couple of newbie questions ...

2008-07-25 Thread John DeSoi
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

[GENERAL] A couple of newbie questions ...

2008-07-23 Thread admin
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

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Raymond O'Donnell
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.

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Raymond O'Donnell
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

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Craig Ringer
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.

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Karsten Hilbert
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,

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread A. Kretschmer
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')

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Albe Laurenz
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?

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Scott Marlowe
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

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Shane Ambler
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

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Shane Ambler
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

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Craig Ringer
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') ...

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Francisco Reyes
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.

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Tino Wildenhain
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

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Artacus
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

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Scott Marlowe
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