Re: [GENERAL] INSERT WHERE NOT EXISTS

2003-06-25 Thread Ian Barwick
On Wednesday 25 June 2003 21:37, Mike Mascari wrote: > Ian Barwick wrote: > > On Wednesday 25 June 2003 20:06, Reuben D. Budiardja wrote: (...) > > This kind of query should work; just leave out the "FROM dummy_table" > > bit. (in Oracle it would be "FROM dual"). > > I proposed that same solution

Re: [GENERAL] INSERT WHERE NOT EXISTS

2003-06-25 Thread Reuben D. Budiardja
On Wednesday 25 June 2003 03:26 pm, Ian Barwick wrote: > > I vaguely remember in Oracle, there is something like this: > > > > INSERT INTO mytable > > SELECT 'value1', 'value2' > > FROM dummy_table > > WHERE NOT EXISTS > > (SELECT NULL FROM mytable > > WHERE mycon

Re: [GENERAL] NIST test defects

2003-06-25 Thread Mike Castle
In article <[EMAIL PROTECTED]>, Dann Corbit <[EMAIL PROTECTED]> wrote: >The Ocelot project has uncovered 23 defects in the NIST test: >http://www.ocelot.ca/nist.htm > >All of the defects appear to be identified correctly as defects. I >suggest (therefore) that the NIST verification effort consider

Re: [GENERAL] INSERT WHERE NOT EXISTS

2003-06-25 Thread Mike Mascari
Ian Barwick wrote: > On Wednesday 25 June 2003 20:06, Reuben D. Budiardja wrote: > >>Hi, >>I am developing application with PHP as the front end, PGSQL as the >>backend. I am trying to figure out what's the best way to do this. >>I want to check if an entry already exists in the table. If it does

Re: [GENERAL] INSERT WHERE NOT EXISTS

2003-06-25 Thread Reuben D. Budiardja
On Wednesday 25 June 2003 03:04 pm, scott.marlowe wrote: > Just wrap it in a transaction: > > begin; > select * from table where somefield='somevalue'; > (in php code) > if pg_num_rows>1... > update table set field=value where somefield=somevalue; > else > insert into table (field) values (value);

Re: [GENERAL] full featured alter table?

2003-06-25 Thread Andrew Sullivan
On Sat, Jun 14, 2003 at 07:33:19PM +0200, Sven K?hler wrote: > > "select *" should refelect the cosmetical order of the columns. Why? You asked for everything, and specified no order. > "select *" could be tranformed into something like "select col1, col2, > ..." according to the cosmetical or

Re: [GENERAL] INSERT WHERE NOT EXISTS

2003-06-25 Thread Ian Barwick
On Wednesday 25 June 2003 20:06, Reuben D. Budiardja wrote: > Hi, > I am developing application with PHP as the front end, PGSQL as the > backend. I am trying to figure out what's the best way to do this. > I want to check if an entry already exists in the table. If it does, then I > will do > UPDA

Re: [GENERAL] INSERT WHERE NOT EXISTS

2003-06-25 Thread scott.marlowe
Just wrap it in a transaction: begin; select * from table where somefield='somevalue'; (in php code) if pg_num_rows>1... update table set field=value where somefield=somevalue; else insert into table (field) values (value); commit; On Wed, 25 Jun 2003, Reuben D. Budiardja wrote: > > Hi, > I am

[GENERAL] INSERT WHERE NOT EXISTS

2003-06-25 Thread Reuben D. Budiardja
Hi, I am developing application with PHP as the front end, PGSQL as the backend. I am trying to figure out what's the best way to do this. I want to check if an entry already exists in the table. If it does, then I will do UPDATE tablename otherwise, I will do INSER INTO tablename... W

Re: [GENERAL] Eliminating start error message: "unary operator

2003-06-25 Thread Carlos
Title: RE: [GENERAL] Eliminating start error message: "unary operator Hi Tom, I got the following log when I tried to output the messages from pg_ctl (enclosed is the text file also).  I modified the postscript script to get the log writeeen at bootup.  The line of postscript script that I mo

Re: [GENERAL] pg_statistic_relid_att_index

2003-06-25 Thread scott.marlowe
Oh, good. I was under the impression that 7.1.3 didn't have reindex (that's was Jean said at first, and I haven't used it in so long, I wasn't sure either.) Jean, don't forget to BACKUP first. On Wed, 25 Jun 2003, Martijn van Oosterhout wrote: > On Wed, Jun 25, 2003 at 04:14:10AM -0600, sco

Re: [GENERAL] Inherits tables and current CVS

2003-06-25 Thread Tom Lane
Teodor Sigaev <[EMAIL PROTECTED]> writes: > How can I know tables is inherited or no? You have to look in pg_inherits. AFAIR psql has no \d command that will tell you anything about it. regards, tom lane ---(end of broadcast)--

Re: [GENERAL]

2003-06-25 Thread Paul Thomas
On 25/06/2003 15:46 Daniel E. Fisher wrote: Entered in the pg_hba.conf file hostall the.machine's.ip.address 255.255.255.255 and still gives me the error that it doesn't have an entry for the servers ip. If You're using PG 7.3, then you need a user column: host database(or all)user(

[GENERAL] how to fix missing chunk number 0?

2003-06-25 Thread Johnson, Shaunn
Title: how to fix missing chunk number 0? Howdy Migrating PostgreSQL 7.2.1 on RedHat Linux 7.2. I'm trying to dump my tables and have ran into a severe problem.  When I try to pg_dump tables, they fail and I get an error: [snip] pg_dump: query to obtain definition of view "t_ref_hedis

Re: [GENERAL] Alternative replication method.

2003-06-25 Thread Mike Benoit
According to section 5 in this: http://www.complang.tuwien.ac.at/reisner/drbd/publications/drbd_paper_for_LK7.pdf it looks like it does guarantee write order. 5 Write ordering Some file systems require that certain blocks hit the media in a determined order, for example a JFS needs to write a t

Re: [GENERAL] pg_statistic_relid_att_index

2003-06-25 Thread Tom Lane
Jean-Christophe ARNU (JX) <[EMAIL PROTECTED]> writes: > I've a problem with the pg_statistic_relid_att_index system index. The server > version is 7.1.3 (so reindex is not available). You're overdue for an update then. Have you read the lists of bugs fixed since 7.1?

[GENERAL] Inherits tables and current CVS

2003-06-25 Thread Teodor Sigaev
How can I know tables is inherited or no? # create table parent ( id int primary key, value text ); # create table child ( cvaltext, primary key (id) ) INHERITS (parent); # \d child Table "public.child" Column | Type | Modifiers +

[GENERAL] change management

2003-06-25 Thread Matthew Nuzum
Well, business is good I guess. We're getting ready to deploy a few new installations of our software which is raising some questions. Most of them I have answers to, but one area of development I haven't had to deal with much is managing changes to the database structure. I would really like to

Re: [GENERAL]

2003-06-25 Thread Karsten Hilbert
> host all the.machine's.ip.address 255.255.255.255 > and still gives me the error that it doesn't have an entry for the servers > ip. > > Warning: Unable to connect to PostgreSQL server: FATAL: No pg_hba.conf entry > for host "machine's.ip" user postgres, database nm in Well, you of course n

Re: [GENERAL] Inheritance & Indexes

2003-06-25 Thread Stephan Szabo
On Wed, 25 Jun 2003, Tom Lane wrote: > Stephan Szabo <[EMAIL PROTECTED]> writes: > > I *think* 7.4 may be smarter about > > implying these conditions as well. > > Not really. AFAIR the Append-style plan is the only thing you can get > out of the planner for inheritance trees. This works well en

[GENERAL]

2003-06-25 Thread Daniel E. Fisher
Entered in the pg_hba.conf file hostall the.machine's.ip.address 255.255.255.255 and still gives me the error that it doesn't have an entry for the servers ip. Warning: Unable to connect to PostgreSQL server: FATAL: No pg_hba.conf entry for host "machine's.ip" user postgres, database nm i

Re: [GENERAL] Alternative replication method.

2003-06-25 Thread Tom Lane
Mike Benoit <[EMAIL PROTECTED]> writes: > Has anyone used PostgreSQL with Drbd > (http://www.complang.tuwien.ac.at/reisner/drbd/)? Does it guarantee preservation of write ordering? regards, tom lane ---(end of broadcast)---