Re: [GENERAL] moving from MySQL to pgsql

2012-10-15 Thread Jasen Betts
On 2012-10-13, Merlin Moncure mmonc...@gmail.com wrote: On Sat, Oct 13, 2012 at 3:22 AM, Jasen Betts ja...@xnet.co.nz wrote: On 2012-10-11, Vineet Deodhar vineet.deod...@gmail.com wrote: To give an example, I have tables for storing master records (year master, security master, etc.) for

Re: [GENERAL] moving from MySQL to pgsql

2012-10-13 Thread Jasen Betts
On 2012-10-10, Vineet Deodhar vineet.deod...@gmail.com wrote: --f46d040714c5d7a08c04cbb08256 Content-Type: text/plain; charset=UTF-8 Hi ! At present, I am using MySQL as backend for my work. Because of the licensing implications, I am considering to shift from MySQL to pgsql. Typically, my

Re: [GENERAL] moving from MySQL to pgsql

2012-10-13 Thread Jasen Betts
On 2012-10-11, Vineet Deodhar vineet.deod...@gmail.com wrote: To give an example, I have tables for storing master records (year master, security master, etc.) for which pkid TINYINT is just sufficient. These pkid's are used as fk constraints in tables for storing business transactions. The

Re: [GENERAL] moving from MySQL to pgsql

2012-10-13 Thread Merlin Moncure
On Sat, Oct 13, 2012 at 3:22 AM, Jasen Betts ja...@xnet.co.nz wrote: On 2012-10-11, Vineet Deodhar vineet.deod...@gmail.com wrote: To give an example, I have tables for storing master records (year master, security master, etc.) for which pkid TINYINT is just sufficient. These pkid's are used

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Vineet Deodhar
On Thu, Oct 11, 2012 at 5:26 AM, Ondrej Ivanič ondrej.iva...@gmail.comwrote: Hi, On 10 October 2012 19:47, Vineet Deodhar vineet.deod...@gmail.com wrote: 3) Can I simulate MySQL's TINYINT data-type (using maybe the custom data type or something else) What do you exactly mean? Do you care

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread F. BROUARD / SQLpro
Le 10/10/2012 10:47, Vineet Deodhar a écrit : Hi ! 3) Can I simulate MySQL's TINYINT data-type (using maybe the custom data type or something else) Another way, and a good practice toot is to use SQL DOMAINs wich is a part of the ISO SQL since 1992 that MySQL don't have... CREATE DOMAIN

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Craig Ringer
On 10/11/2012 02:07 PM, Vineet Deodhar wrote: On Thu, Oct 11, 2012 at 5:26 AM, Ondrej Ivanič ondrej.iva...@gmail.com mailto:ondrej.iva...@gmail.com wrote: Hi, On 10 October 2012 19:47, Vineet Deodhar vineet.deod...@gmail.com mailto:vineet.deod...@gmail.com wrote: 3) Can I

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Vineet Deodhar
On Thu, Oct 11, 2012 at 1:12 PM, Craig Ringer ring...@ringerc.id.au wrote: The difference between SMALLINT and BOOLEAN (or TINYINT if Pg supported it) is 1 byte per column. If you had 30 smallint columns and quite a few million rows it might start making a difference, but it's *really* not

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Vineet Deodhar
On Thu, Oct 11, 2012 at 3:04 PM, Craig Ringer ring...@ringerc.id.au wrote: AFAIK in most situations alignment requirements will mean you won't gain any space in those situations anyway. I would be truly amazed if you saw more than something like a 1% difference in size due to this; it'll be

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Vineet Deodhar
Thanks all for your replies. This is my first experience with postgres mailing list. Hats Off to the active community of pgsql. This has definitely raised my confidence level with postgres. --- Vineet

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Craig Ringer
On 10/11/2012 05:07 PM, Vineet Deodhar wrote: On Thu, Oct 11, 2012 at 1:12 PM, Craig Ringer ring...@ringerc.id.au mailto:ring...@ringerc.id.au wrote: The difference between SMALLINT and BOOLEAN (or TINYINT if Pg supported it) is 1 byte per column. If you had 30 smallint columns and

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Merlin Moncure
On Thu, Oct 11, 2012 at 4:44 AM, Vineet Deodhar vineet.deod...@gmail.com wrote: Thanks all for your replies. This is my first experience with postgres mailing list. Hats Off to the active community of pgsql. This has definitely raised my confidence level with postgres. thanks. we like emails

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Gavin Flower
On 12/10/12 04:39, Merlin Moncure wrote: On Thu, Oct 11, 2012 at 4:44 AM, Vineet Deodhar vineet.deod...@gmail.com wrote: Thanks all for your replies. This is my first experience with postgres mailing list. Hats Off to the active community of pgsql. This has definitely raised my confidence level

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Mike Christensen
On Thu, Oct 11, 2012 at 9:38 AM, Gavin Flower gavinflo...@archidevsys.co.nz wrote: On 12/10/12 04:39, Merlin Moncure wrote: On Thu, Oct 11, 2012 at 4:44 AM, Vineet Deodhar vineet.deod...@gmail.com wrote: Thanks all for your replies. This is my first experience with postgres mailing list.

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread John R Pierce
On 10/11/12 2:07 AM, Vineet Deodhar wrote: To give an example, I have tables for storing master records (year master, security master, etc.) for which pkid TINYINT is just sufficient. These pkid's are used as fk constraints in tables for storing business transactions. The no. of rows in

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Chris Travers
On Wed, Oct 10, 2012 at 1:47 AM, Vineet Deodhar vineet.deod...@gmail.comwrote: Hi ! At present, I am using MySQL as backend for my work. Because of the licensing implications, I am considering to shift from MySQL to pgsql. Typically, my apps are multi-user, web based or LAN based. 1) Read

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Sim Zacks
On 10/10/2012 10:47 AM, Vineet Deodhar wrote: Hi ! At present, I am using MySQL as backend for my work. Because of the licensing implications, I am considering to shift from MySQL to pgsql. Typically, my apps are multi-user, web based or LAN based.

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Vineet Deodhar
On Wed, Oct 10, 2012 at 2:38 PM, Chris Travers chris.trav...@gmail.comwrote: On Wed, Oct 10, 2012 at 1:47 AM, Vineet Deodhar vineet.deod...@gmail.comwrote: PostgreSQL has an excellent optimizer and the on-disk layout is completely different. This will dwarf any changes due to threads vs

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Merlin Moncure
On Wed, Oct 10, 2012 at 3:47 AM, Vineet Deodhar vineet.deod...@gmail.com wrote: Hi ! At present, I am using MySQL as backend for my work. Because of the licensing implications, I am considering to shift from MySQL to pgsql. Typically, my apps are multi-user, web based or LAN based. 1) Read

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Ondrej Ivanič
Hi, On 10 October 2012 19:47, Vineet Deodhar vineet.deod...@gmail.com wrote: 3) Can I simulate MySQL's TINYINT data-type (using maybe the custom data type or something else) What do you exactly mean? Do you care about storage requirements or constraints? The smallest numeric type in postgres

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Darren Duncan
I noticed something here that none of the other replies addressed. Vineet Deodhar wrote: 3) Can I simulate MySQL's TINYINT data-type (using maybe the custom data type or something else) The answer to your question depends on what you were using the TINYINT for. For example, many people use

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Joshua D. Drake
On 10/10/2012 02:18 AM, Sim Zacks wrote: 2) I run MySQL from a USB stick. There is no installation required (on WinXP.). (not tried on Ubuntu) Is it the same for pgsql? To use postgres on a USB stick, see

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Craig Ringer
On 10/10/2012 04:47 PM, Vineet Deodhar wrote: 2) I run MySQL from a USB stick. There is no installation required (on WinXP.). (not tried on Ubuntu) Is it the same for pgsql? On Windows PostgreSQL is usually installed as a system service with its own user account (pre-9.2) or running in the

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-05 Thread Mike Mascari
Michael Chaney wrote: On Thu, Mar 04, 2004 at 10:50:50AM -0500, Tom Lane wrote: If I understood the requirements correctly, it might be sufficient to put a unique index on (id1,id2). If two transactions simultaneously try to insert for the same id1, one would get a duplicate-index-entry failure,

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-04 Thread Michael Chaney
On Thu, Mar 04, 2004 at 10:50:50AM -0500, Tom Lane wrote: If I understood the requirements correctly, it might be sufficient to put a unique index on (id1,id2). If two transactions simultaneously try to insert for the same id1, one would get a duplicate-index-entry failure, and it would have

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-03 Thread Paulovi Michal
Harald Fuchs wrote: In article [EMAIL PROTECTED], "scott.marlowe" [EMAIL PROTECTED] writes: On Tue, 2 Mar 2004, [UTF-8] Paulovi Michal wrote: how you solve the problem with multilevel autoicrement? In MySQL you create table with col1, col2. Col 2 is AUTOICREMENT

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-03 Thread Bruno Wolff III
On Wed, Mar 03, 2004 at 18:12:18 +0100, Paulovi?? Michal [EMAIL PROTECTED] wrote: You don't build secent level unique You have to create uniqe index under both levels (first and second) together. But in MySQL there is no problem. I alredy have table with mulitlevel autoincrement (in MySQL)

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-03 Thread scott.marlowe
On Wed, 3 Mar 2004, [UTF-8] Paulovič Michal wrote: Yes I know, But how you do this at PgSQL OK, I just read the response where someone showed me how to make such a table in mysql. What an odd, and non-intuitive behaviour that is. Anyway, first off, upgrade your version of postgresql

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-03 Thread Paulovi Michal
Bruno Wolff III wrote: On Wed, Mar 03, 2004 at 18:12:18 +0100, Paulovi?? Michal [EMAIL PROTECTED] wrote: You don't build secent level unique You have to create uniqe index under both levels (first and second) together. But in MySQL there is no problem. I alredy have table with mulitlevel

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-03 Thread Michael Chaney
On Wed, Mar 03, 2004 at 06:45:56AM +0100, Paulovi?? Michal wrote: Yes I know, But how you do this at PgSQL You have to lock the table exclusively, get the max value for your particular id1, increment it, insert the row, and commit: begin; lock table test in exclusive mode; insert into

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-03 Thread Tom Lane
Michael Chaney [EMAIL PROTECTED] writes: begin; lock table test in exclusive mode; insert into test values (1,(select max(id2) from test where id1=1)+1); commit; It's not pretty, and it'll probably slow down as the table grows. As-is, that will definitely get pretty slow on large tables.

Re: Database metadata queries (WAS Re: [GENERAL] Moving from MySQL to PGSQL....some questions)

2004-03-02 Thread Bruno Wolff III
On Mon, Mar 01, 2004 at 11:09:32 -0600, Shawn Harrison [EMAIL PROTECTED] wrote: Would it be worthwhile to move many of these \d queries into the system schema, as views on various system tables? I've thought that it would be very useful to be able to access these things through the web or

Re: [GENERAL] Moving from MySQL to PGSQL....some questions

2004-03-02 Thread Bruce Momjian
Michael Chaney wrote: One other note, for those converting a database from MySQL to PostgreSQL, I have a table creation conversion script here: http://www.michaelchaney.com/downloads/m2p.pl I know that two come with PostgreSQL in the contrib directory, but I wrote this because those two

Re: [GENERAL] Moving from MySQL to PGSQL....some questions (multilevel

2004-03-02 Thread Paulovi Michal
how you solve the problem with multilevel autoicrement? In MySQL you create table with col1, col2. Col 2 is AUTOICREMENT and you have to create UNIQUE INDEX (Col1, Col2). If you insert to this table for col1 volume 1, col2 automaticaly increase by one. Example: Insert into table values (1);

Re: [GENERAL] Moving from MySQL to PGSQL....some questions

2004-02-28 Thread Greg Patnude
In PGAdmin III -- you might want to UNCHECK the Display system objects option under the Display menu option -- this will prevent you from seeing all of the non-public schema's and limit your view in PGAdmin to just the databases you created... Most people dont really need to dink around with the

Re: [GENERAL] Moving from MySQL to PGSQL....some questions

2004-02-28 Thread Karl O. Pinc
Karam Chand [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 5.) In MySQL, there are many command like show tables, show databases etc. to get object details. I cant see anything similar in PGSQL. After searching the net i find that i have to execute certain queries to fetch those

Re: [GENERAL] moving from mySQL to pgsql, need a bit of help (perl)

2000-07-11 Thread Peter Haworth
Ed Loehrwrote: I believe DBI/DBD does this for you: while ($row_href = $sth-fetchrow_hashref) { push( @taghash, $row_href); } Don't do that! Each hashref in that array will point to the same hash in some future version of the DBI. You should do this instead:

[GENERAL] moving from mySQL to pgsql, need a bit of help (perl)

2000-07-10 Thread Matt Housh
Hello, I'm trying to move from mySQL to PostgreSQL, and I've got to port a web app over that's written in perl. It uses the DBD/DBI stuff, and works great so far with mySQL. I've got a very specific question relating to pulling data out of a database, I hope this is the correct forum for

Re: [GENERAL] moving from mySQL to pgsql, need a bit of help (perl)

2000-07-10 Thread Ed Loehr
Matt Housh wrote: In my current code (perl/mySQL), I execute the following query: "SELECT * from table_name" - then use the following code to put it in a hash: $j = 0; while (@row = $sth-fetchrow_array) { for ($i = 0; $i $fields; $i++) {