Re: [GENERAL] timestams in the the pg_standby output

2010-01-04 Thread Greg Smith
Tim Uckun wrote: Ah if I am going to do that I suppose something like this would work. #!/bin/sh while read data; do echo "`date +%H:%M:%S` : $data" >> logfile.log done If that works, great. I'm not sure if you'll run afoul of output buffering in this situation. Clearly you've got th

Re: [GENERAL] PostgreSQL Write Performance

2010-01-04 Thread Dann Corbit
> -Original Message- > From: Yan Cheng Cheok [mailto:ycch...@yahoo.com] > Sent: Monday, January 04, 2010 11:30 PM > To: Dann Corbit > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] PostgreSQL Write Performance > > >> What is the actual problem you are trying to solve? > > I am

Re: [GENERAL] PostgreSQL Write Performance

2010-01-04 Thread Yan Cheng Cheok
>> What is the actual problem you are trying to solve? I am currently developing a database system for a high speed measurement machine. The time taken to perform measurement per unit is in term of ~30 milliseconds. We need to record down the measurement result for every single unit. Hence, the

Re: [GENERAL] timestams in the the pg_standby output

2010-01-04 Thread Tim Uckun
>     printf "%s %s\n", strftime("%Y-%m-%d %H:%M:%S", localtime(time)), $item > > (untested, and I am not a regular Perl programmer, its but File::Tail is the > best library I know of to do this sort of thing) > Ah if I am going to do that I suppose something like this would work. #!/bin/sh whil

Re: [GENERAL] timestams in the the pg_standby output

2010-01-04 Thread Greg Smith
Tim Uckun wrote: Is there a way to get pg_standby to put timestamps in the output it generates? I am currently piping the output to a log fie but since it contains no timestamps it's of limited use to me. Nope; already on my TODO list to take care of one day since it annoys me too. What yo

Re: [GENERAL] PostgreSQL Write Performance

2010-01-04 Thread Dann Corbit
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Yan Cheng Cheok > Sent: Monday, January 04, 2010 9:05 PM > To: Scott Marlowe > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] PostgreSQL Write Performance >

Re: [GENERAL] PostgreSQL Write Performance

2010-01-04 Thread Greg Smith
Yan Cheng Cheok wrote: Instead of sending 1000++ INSERT statements in one shot, which will requires my application to keep track on the INSERT statement. Is it possible that I can tell PostgreSQL, "OK. I am sending you INSERT statement. But do not perform any actual right operation. Only pe

Re: [GENERAL] timestams in the the pg_standby output

2010-01-04 Thread Fujii Masao
On Tue, Jan 5, 2010 at 11:20 AM, Tim Uckun wrote: > Is there a way to get pg_standby to put timestamps in the output it > generates? No. > I am currently piping the output to a log fie but since it > contains no timestamps it's of limited use to me. You can create the script which adds the time

Re: [GENERAL] PostgreSQL Write Performance

2010-01-04 Thread Yan Cheng Cheok
Instead of sending 1000++ INSERT statements in one shot, which will requires my application to keep track on the INSERT statement. Is it possible that I can tell PostgreSQL, "OK. I am sending you INSERT statement. But do not perform any actual right operation. Only perform actual write operati

Re: [GENERAL] ERROR in createlang

2010-01-04 Thread Tom Lane
erobles writes: > Hi! i have an error when i try to add/create a plpgsql language in > Postgresql 8.3.1 on SCO Openserver 5.0.7 > createlang: langauge installation failed: ERROR could not access file > "$libdir/plpgsql": No such file or directory. > But, the file plpgsql.so exists in the dire

Re: [GENERAL] PostgreSQL Write Performance

2010-01-04 Thread Scott Marlowe
On Mon, Jan 4, 2010 at 8:36 PM, Yan Cheng Cheok wrote: > I am not sure whether I am doing the correct benchmarking way. > > I have the following table ; > > CREATE TABLE measurement_type > ( >  measurement_type_id bigserial NOT NULL, >  measurement_type_name text NOT NULL, >  CONSTRAINT pk_measure

[GENERAL] PostgreSQL Write Performance

2010-01-04 Thread Yan Cheng Cheok
I am not sure whether I am doing the correct benchmarking way. I have the following table ; CREATE TABLE measurement_type ( measurement_type_id bigserial NOT NULL, measurement_type_name text NOT NULL, CONSTRAINT pk_measurement_type_id PRIMARY KEY (measurement_type_id), CONSTRAINT measurem

Re: [GENERAL] ERROR in createlang

2010-01-04 Thread Adrian Klaver
On Monday 04 January 2010 2:55:35 pm erobles wrote: > Hi! i have an error when i try to add/create a plpgsql language in > Postgresql 8.3.1 on SCO Openserver 5.0.7 > createlang: langauge installation failed: ERROR could not access file > "$libdir/plpgsql": No such file or directory. > > > But, th

Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread Yan Cheng Cheok
Can you please provide me an example of a stored procedures to achieve that? Thanks and Regards Yan Cheng CHEOK --- On Mon, 1/4/10, Alban Hertroys wrote: > From: Alban Hertroys > Subject: Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key > To: "Yan Cheng Cheok" > Cc: pgsql-general@

[GENERAL] timestams in the the pg_standby output

2010-01-04 Thread Tim Uckun
Is there a way to get pg_standby to put timestamps in the output it generates? I am currently piping the output to a log fie but since it contains no timestamps it's of limited use to me. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: h

Re: [GENERAL] Some issues about data type convert

2010-01-04 Thread donniehan
>> Um, I think the OP is right. Notice he does: ... >> showing that PG is auto-magically inserting a cast from BIGINT to OID. >>I think the OP is either expecting the CREATE VIEW to fail saying types >>are invalid, or to result in "c1" being cast to BIGINT Yes, that's what i mean. Is that more r

[GENERAL] Shall I use PostgreSQL Array Type in The Following Case

2010-01-04 Thread Yan Cheng Cheok
I realize there is Array data type for PostgreSQL. http://www.postgresql.org/docs/8.1/interactive/arrays.html Currently, I need to use database to store measurement result of a semiconductor factory. They are producing semicondutor units. Every semicondutor units can have variable number of me

Re: [GENERAL] Question on how to conditionally commit or rollback a sql-request

2010-01-04 Thread Daniel Verite
Bergbom Staffan wrote: > I get the following error: > ERROR: SPI execute_plan failed executing query “Commit”: > SPI_ERROR_TRANSACTION > CONTEXT: Pl/pgSQL function “objectdescription_bu” line 9 at SQL statement > > What does this mean and what should I do to be able to do the desired che

[GENERAL] Upgraded from Leopard to Snow Leopard - PostgreSQL won't start anymore

2010-01-04 Thread Matthias Dietrich
Hi, some weeks or months ago I upgraded my Mac from Leopard to Snow Leopard. Because I needed to work a long time remote I didn't use my local dev system and found it broken now. First of all I've got the following error message in my log: FATAL: could not create shared memory segment: In

[GENERAL] ERROR in createlang

2010-01-04 Thread erobles
Hi! i have an error when i try to add/create a plpgsql language in Postgresql 8.3.1 on SCO Openserver 5.0.7 createlang: langauge installation failed: ERROR could not access file "$libdir/plpgsql": No such file or directory. But, the file plpgsql.so exists in the directory, please,could you

[GENERAL] ERROR in createlang / ERROR en createlang

2010-01-04 Thread erobles
Hi! i have an error when i try to add/create a plpgsql language in Postgresql 8.3.1 on SCO Openserver 5.0.7 createlang: langauge installation failed: ERROR could not access file "$libdir/plpgsql": No such file or directory. But, the file plpgsql.so exists in the directory, please,could you

[GENERAL] Question on how to conditionally commit or rollback a sql-request

2010-01-04 Thread Bergbom Staffan
Hi all, Making an update to a db-table I want to check if it is the same data that has already been updated within nearest 0.5 minute before committing The table contains a timestamp-field, registeredatdatetime, that I try to use in a before-update-trigger like: /* TRIGGER: objectdescripti

Re: [GENERAL] Innotop for postgresl

2010-01-04 Thread Erik Jones
On Jan 3, 2010, at 4:10 AM, Alexis Michon wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > Hello, > > Is there any software for postgresql like innotop for mysql ? > I would like to monitor postgresql with Cacti, but i didn't find any > module for that in cacti, do you know a modu

Re: [GENERAL] Upgraded from Leopard to Snow Leopard - PostgreSQL won't start anymore

2010-01-04 Thread Greg Smith
Matthias Dietrich wrote: How can I dump the data from the 32bit database? Does someone has built a postgres binary for this issue? You can build one yourself following the "Reverting to 32-bit Binaries" instructions at http://devoh.com/posts/2009/08/postgresql-snow-leopard (which follow

[GENERAL] Upgraded from Leopard to Snow Leopard - PostgreSQL won't start anymore

2010-01-04 Thread Matthias Dietrich
Hi, some weeks or months ago I upgraded my Mac from Leopard to Snow Leopard. Because I needed to work a long time remote I didn't use my local dev system and found it broken now. First of all I've got the following error message in my log: FATAL: could not create shared memory segment: Inv

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread John DeSoi
On Jan 4, 2010, at 9:32 AM, Chris Withers wrote: > I feel slightly stupid asking this, but this is a Mac, surely there's some > pretty shiny GUI for editing things like this? > (even Windows has the "Services" stuff in Control Panel) > > What am I missing? I've used this in the past but it loo

Re: [GENERAL] Some issues about data type convert

2010-01-04 Thread Tom Lane
Sam Mason writes: > Um, I think the OP is right. Notice he does: ... > showing that PG is auto-magically inserting a cast from BIGINT to OID. Yes, as a quick look into pg_cast will show you, bigint -> oid is an implicit cast: regression=# \dC+ oid List of casts Sour

Re: [GENERAL] Save MySQL? HA

2010-01-04 Thread Mark Williamson
Maybe move this to the mysql mailing list ;) On Mon, Jan 4, 2010 at 11:38 AM, Joshua D. Drake wrote: > On Mon, 2010-01-04 at 12:36 -0500, Bill Moran wrote: > > In response to Alvaro Herrera : > > > > > Chris Browne wrote: > > > > dcor...@connx.com ("Dann Corbit") writes: > > > > > (Commercial use

Re: [GENERAL] Save MySQL? HA

2010-01-04 Thread Joshua D. Drake
On Mon, 2010-01-04 at 12:36 -0500, Bill Moran wrote: > In response to Alvaro Herrera : > > > Chris Browne wrote: > > > dcor...@connx.com ("Dann Corbit") writes: > > > > (Commercial use of MySQL without paying a license fee requires that > > > > projects using the database are also GPL, IIRC). > >

Re: [GENERAL] Save MySQL? HA

2010-01-04 Thread Bill Moran
In response to Alvaro Herrera : > Chris Browne wrote: > > dcor...@connx.com ("Dann Corbit") writes: > > > (Commercial use of MySQL without paying a license fee requires that > > > projects using the database are also GPL, IIRC). > > > > I know I've seen Monty say this sort of thing a lot of times

[GENERAL] converting tables to XML and back

2010-01-04 Thread shulkae
We have few tables which we would like to convert to XML and store it. Another requirement is to convert the stored XML file back to the original tables. This helps us to clone a system. I was thinking to use Perl XML Simple module to generate XML files. How do I again re-create tables from XML?

Re: [GENERAL] Save MySQL? HA

2010-01-04 Thread Alvaro Herrera
Chris Browne wrote: > dcor...@connx.com ("Dann Corbit") writes: > > (Commercial use of MySQL without paying a license fee requires that > > projects using the database are also GPL, IIRC). > > I know I've seen Monty say this sort of thing a lot of times, and his > most recent rant > (

Re: [GENERAL] Save MySQL? HA

2010-01-04 Thread Chris Browne
dcor...@connx.com ("Dann Corbit") writes: > (Commercial use of MySQL without paying a license fee requires that > projects using the database are also GPL, IIRC). I know I've seen Monty say this sort of thing a lot of times, and his most recent rant (

Re: [GENERAL] Some issues about data type convert

2010-01-04 Thread Sam Mason
On Mon, Jan 04, 2010 at 03:55:15PM +0100, Albe Laurenz wrote: > donniehan wrote: > > postgres=# create table test1(c1 OID, c2 BIGINT); > > postgres=# create view v1 as select coalesce(c1,c2) from test1; > > postgres=# \d v1 > > SELECT COALESCE(test1.c1, test1.c2::oid) AS "coalesce" > >FROM tes

Re: [GENERAL] Some issues about data type convert

2010-01-04 Thread Albe Laurenz
donniehan wrote: > I have a question about pg_cast--- data type convert. > Pg provide more data types than sql spec, such as OID. > Internal OID type is unsigned int32 and INT8 is int64. > > Why pg can convert INT8 into OID implicitly while can not > convert OID into INT8 implicitly?

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Chris Withers
Sachin Srivastava wrote: Will setting RunAtLoad to false not stop that? RunAtLoad = false means, the daemon is loaded not executed/launched. If you dont want it to load at system startup. Remove the plist from that directory. (i.e. /Library/LaunchDaemons) I don't want postgres to start on mac

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Sachin Srivastava
On 01/04/2010 08:07 PM, Chris Withers wrote: Sachin Srivastava wrote: Iirc, you have to change: RunAtLoad to RunAtLoad Sachin; can you confirm please? Yes. Though the daemon is loaded during startup. Will setting RunAtLoad to false not stop that? RunAtLoad = false means, the daemon is l

Re: [GENERAL] why non-greedy modifier for one atom changesgreediness of other atoms?

2010-01-04 Thread Albe Laurenz
hubert depesz lubaczewski wrote: >> Example: >> # select x, substring( x from E'^((.*?)(\\.[0-9]+))') from >( values ('ab.123xxx.46hfd'),('a.b.c.d.123xx')) as q (x); >> x| substring >> -+--- >> ab.123xxx.46hfd | ab.1 >> a.b.c.d.123xx | a.b.c.d.1 >> (2 ro

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Chris Withers
Sachin Srivastava wrote: Iirc, you have to change: RunAtLoad to RunAtLoad Sachin; can you confirm please? Yes. Though the daemon is loaded during startup. Will setting RunAtLoad to false not stop that? Chris -- Simplistix - Content Management, Batch P

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Sachin Srivastava
On 01/04/2010 07:13 PM, Dave Page wrote: On Mon, Jan 4, 2010 at 1:42 PM, Chris Withers wrote: Dave Page wrote: On Mon, Jan 4, 2010 at 1:38 PM, Chris Withers wrote: Naoko Reeves wrote: Try check this directory: Library: StartupItems: postgres-plus-8.xx there should

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Dave Page
On Mon, Jan 4, 2010 at 2:32 PM, Chris Withers wrote: > Dave Page wrote: >> >> Iirc, you have to change: >> >>        RunAtLoad >>         >> >> to >> >>        RunAtLoad >>         > > I feel slightly stupid asking this, but this is a Mac, surely there's some > pretty shiny GUI for editing things

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Chris Withers
Dave Page wrote: Iirc, you have to change: RunAtLoad to RunAtLoad I feel slightly stupid asking this, but this is a Mac, surely there's some pretty shiny GUI for editing things like this? (even Windows has the "Services" stuff in Control Panel) What am I

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Dave Page
On Mon, Jan 4, 2010 at 1:42 PM, Chris Withers wrote: > Dave Page wrote: >> >> On Mon, Jan 4, 2010 at 1:38 PM, Chris Withers >> wrote: >>> >>> Naoko Reeves wrote: Try check this directory: Library: StartupItems: postgres-plus-8.xx there should be script to start automatically. >>> >

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Chris Withers
Dave Page wrote: On Mon, Jan 4, 2010 at 1:38 PM, Chris Withers wrote: Naoko Reeves wrote: Try check this directory: Library: StartupItems: postgres-plus-8.xx there should be script to start automatically. /Library/StartupItems is empty. I think putting stuff in there is an old-fashioned way

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Dave Page
On Mon, Jan 4, 2010 at 1:38 PM, Chris Withers wrote: > Naoko Reeves wrote: >> >> Try check this directory: Library: StartupItems: postgres-plus-8.xx >> there should be script to start automatically. > > /Library/StartupItems is empty. > > I think putting stuff in there is an old-fashioned way of d

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Chris Withers
Naoko Reeves wrote: Try check this directory: Library: StartupItems: postgres-plus-8.xx there should be script to start automatically. /Library/StartupItems is empty. I think putting stuff in there is an old-fashioned way of doing things that went out with Mac OS X 10.4, and I'm glad to say i

Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread Grzegorz Jaśkiewicz
insert into foo(a) with recursive t(n) AS (SELECT 10 AS n UNION ALL SELECT n-1 FROM t WHERE n > 0) select n from t; works on 8.5 -- GJ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread A. Kretschmer
In response to Alban Hertroys : > On 4 Jan 2010, at 13:15, A. Kretschmer wrote: > > > In response to Alban Hertroys : > >> On 4 Jan 2010, at 9:53, Yan Cheng Cheok wrote: > >> > >>> For example, "John" place "1.34" priced order. > >>> > >>> (1) Get Customer_ID from Customer table, where name is "

Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread Alban Hertroys
On 4 Jan 2010, at 13:15, A. Kretschmer wrote: > In response to Alban Hertroys : >> On 4 Jan 2010, at 9:53, Yan Cheng Cheok wrote: >> >>> For example, "John" place "1.34" priced order. >>> >>> (1) Get Customer_ID from Customer table, where name is "John" >>> (2) If there are no Customer_ID return

Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread Sam Mason
On Mon, Jan 04, 2010 at 04:53:16AM -0800, Yan Cheng Cheok wrote: > From general point of view, having 3 SQL statement wrapped in a > single stored procedure shall perform better due to reduced overhead > to communicate with SQL server. Is that true? Or that is my false > assumption? I'd be tempted

Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread Yan Cheng Cheok
>From general point of view, having 3 SQL statement wrapped in a single stored >procedure shall perform better due to reduced overhead to communicate with SQL >server. Is that true? Or that is my false assumption? Thanks and Regards Yan Cheng CHEOK --- On Mon, 1/4/10, Alban Hertroys wrote: >

Re: [GENERAL] Migration of db

2010-01-04 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > We have 2 databases test and prod. Now they are out of sync ( of > course they will be to some extent ). But there are some functions in some > schemas. we have to sync from prod to test. What I wanted to ask, is there > any tool that you reco

Re: [GENERAL] SELECT does not find table created by itself

2010-01-04 Thread Albe Laurenz
Magnus Hagander wrote: > > select * FROM (select 1 as a) t2 left join t2 t3 ON TRUE > > causes error > > ERROR:  relation "t2" does not exist > Not entirely sure if this is what you're looking for, but I think a > CTE can solve your problem: > WITH t2 AS (SELECT 1 AS a) > SELECT * FROM t2 LEFT JOI

Re: [GENERAL] set-level update fails with unique constraint violation

2010-01-04 Thread Daniel Verite
David Fetter wrote: > The DEFERRED uniqueness constraints in 8.5alpha3 fix this problem That fix has a drawback: when the unique constraint is violated, the rest of the transaction runs with data that is somehow corrupted, with duplicate values being visible. It may be uneasy to predict i

Re: [GENERAL] 8.5 Alpha3 - broken downloadlink

2010-01-04 Thread Dave Page
On Mon, Jan 4, 2010 at 10:20 AM, Thomas Kellerer wrote: > Hi, > > I was trying to download the windows binaries for 8.5alpha3 but the link on > the EnterpriseDB page > (http://www.enterprisedb.com/products/pgbindownload.do) only returns an > error. > > When I follow the link http://www.enterprised

Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread A. Kretschmer
In response to Alban Hertroys : > On 4 Jan 2010, at 9:53, Yan Cheng Cheok wrote: > > > For example, "John" place "1.34" priced order. > > > > (1) Get Customer_ID from Customer table, where name is "John" > > (2) If there are no Customer_ID returned (There is no John), insert "John" > > (3) Get Cu

Re: [GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Naoko Reeves
Try check this directory: Library: StartupItems: postgres-plus-8.xx there should be script to start automatically. On Mon, Jan 4, 2010 at 1:43 AM, Chris Withers wrote: > Hi All, > > I installed postgres from the enterprisedb-maintained one-click installer at > http://www.postgresql.org/download/m

Re: [GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread Alban Hertroys
On 4 Jan 2010, at 9:53, Yan Cheng Cheok wrote: > For example, "John" place "1.34" priced order. > > (1) Get Customer_ID from Customer table, where name is "John" > (2) If there are no Customer_ID returned (There is no John), insert "John" > (3) Get Customer_ID from Customer table, where name is "

[GENERAL] Some issues about data type convert

2010-01-04 Thread donniehan
Hi guys, I have a question about pg_cast--- data type convert. Pg provide more data types than sql spec, such as OID. Internal OID type is unsigned int32 and INT8 is int64. Why pg can convert INT8 into OID implicitly while can not convert OID into INT8 implicitly? There may be some pr

Re: [GENERAL] why non-greedy modifier for one atom changes greediness of other atoms?

2010-01-04 Thread hubert depesz lubaczewski
On Mon, Jan 04, 2010 at 11:30:51AM +0100, hubert depesz lubaczewski wrote: > Example: > # select x, substring( x from E'^((.*?)(\\.[0-9]+))') from ( values > ('ab.123xxx.46hfd'),('a.b.c.d.123xx')) as q (x); > x| substring > -+--- > ab.123xxx.46hfd | ab.1 >

[GENERAL] why non-greedy modifier for one atom changes greediness of other atoms?

2010-01-04 Thread hubert depesz lubaczewski
Example: # select x, substring( x from E'^((.*?)(\\.[0-9]+))') from ( values ('ab.123xxx.46hfd'),('a.b.c.d.123xx')) as q (x); x| substring -+--- ab.123xxx.46hfd | ab.1 a.b.c.d.123xx | a.b.c.d.1 (2 rows) I found in docs, that this is what happens, but I

[GENERAL] 8.5 Alpha3 - broken downloadlink

2010-01-04 Thread Thomas Kellerer
Hi, I was trying to download the windows binaries for 8.5alpha3 but the link on the EnterpriseDB page (http://www.enterprisedb.com/products/pgbindownload.do) only returns an error. When I follow the link http://www.enterprisedb.com/getfile.jsp?fileid=824 then I get a 404 Page with the followi

[GENERAL] Insert Data Into Tables Linked by Foreign Key

2010-01-04 Thread Yan Cheng Cheok
Customer == Customer_ID | Name Order == Order_ID | Customer_ID | Price To insert an order, here is what I need to do usually, For example, "John" place "1.34" priced order. (1) Get Customer_ID from Customer table, where name is "John" (2) If there are

[GENERAL] how do I disable automatic start on mac os x?

2010-01-04 Thread Chris Withers
Hi All, I installed postgres from the enterprisedb-maintained one-click installer at http://www.postgresql.org/download/macosx. However, it starts automatically when the machine boots up, and I'd like it only to start when I manually start it. I've found an entry in launchd: $ sudo launchc

Re: [GENERAL] stats collector process: WRDSK = WRDSK_CANCEL?

2010-01-04 Thread Magnus Hagander
On Mon, Jan 4, 2010 at 06:28, lls wrote: > 22.12.2009 21:40, Magnus Hagander пишет: > > On Tue, Dec 22, 2009 at 10:30, Лев Ласкин wrote: > > > Hi. > We have installed Postgresql 8.3.3. When we see the output of atop-d, we see > just such a string > > db0: ~ # atop 15 > ATOP - db0 2009/12/22 12:14

Re: [GENERAL] Using autogenerated primary key in transaction

2010-01-04 Thread A. Kretschmer
In response to Andrus : > INSERT generates SERIAL primary key column value automatically. > > How to save this value for use in same transaction ? > How to get autogenerated primary key for >=8.0 servers ? There are some functions to get that value: test=# create table andrus(id serial primary

Re: [GENERAL] SELECT does not find table created by itself

2010-01-04 Thread Magnus Hagander
2010/1/2 Andrus : > select * FROM (select 1 as a) t2 left join t2 t3 ON TRUE > > causes error > > ERROR:  relation "t2" does not exist > > How to fix so that table t2 is created only once ? Not entirely sure if this is what you're looking for, but I think a CTE can solve your problem: WITH t2 AS (

Re: [GENERAL] Using autogenerated primary key in transaction

2010-01-04 Thread John R Pierce
Andrus wrote: How to get autogenerated primary key for >=8.0 servers ? currval('sequencename') -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Using autogenerated primary key in transaction

2010-01-04 Thread Andrus
INSERT generates SERIAL primary key column value automatically. How to save this value for use in same transaction ? Only way I have found is to create temporary table. To emulate real database table for testcase I used command: create temp table test ( vmnr serial primary key, name text ) on

[GENERAL] FM format modifier does not remove leading zero from year

2010-01-04 Thread Andrus
Command: select to_char(DATE'2009-1-1','FMDD.FMMM.FMYY') Result observed: 1.1.09 Result expected: 1.1.9 How to fix ? Andrus. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] SELECT does not find table created by itself

2010-01-04 Thread Andrus
select * FROM (select 1 as a) t2 left join t2 t3 ON TRUE causes error ERROR: relation "t2" does not exist How to fix so that table t2 is created only once ? Andrus. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgr