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 ha

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 tabl

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 int

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 au

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 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 My

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 AUTOICRE

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); Ins

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

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

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

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 t