Re: [GENERAL] how to do merge in postgres (with upsert as not supported)

2015-02-27 Thread Thomas Kellerer
Tong Michael schrieb am 26.02.2015 um 21:23: hey, guys, I came across a merge statement when I'm trying to convert stored procedures from Mysql to Postgres: __ __ merge into db.ChargePeriod d using ( select ba.ClientID ... ... That can't be MySQL - MySQL does

Re: [GENERAL] how to do merge in postgres (with upsert as not supported)

2015-02-27 Thread Jim Nasby
On 2/26/15 2:23 PM, Tong Michael wrote: I saw some people use with upsert as, but my pgAdmin version(1.8) doesn't support it. Anyone has any ideas how to do merge in postgres? Actually, this feature is in active development and will hopefully make it into 9.5. In the meantime, take a

[GENERAL] how to do merge in postgres (with upsert as not supported)

2015-02-26 Thread Tong Michael
hey, guys, I came across a merge statement when I'm trying to convert stored procedures from Mysql to Postgres: merge into db.ChargePeriod d using ( select ba.ClientID , ba.BillingAccountID , bs.BillingScheduleID , @CodeWithholdD as WithholdTypeID from

Re: [GENERAL] How to do incremental / differential backup every hour in Postgres 9.1?

2013-08-02 Thread Kevin Grittner
Jeff Janes jeff.ja...@gmail.com wrote: Neil McGuigan neilmcgui...@gmail.com wrote: Trying to do an hourly hot incremental backup of a single postgres server (windows). Can you explain what incremental backup means to you?  I find that there is a surprising variety of opinions about what

Re: [GENERAL] How to do incremental / differential backup every hour in Postgres 9.1?

2013-07-26 Thread Amit Langote
On Fri, Jul 26, 2013 at 7:24 AM, Neil McGuigan neilmcgui...@gmail.com wrote: Trying to do an hourly hot incremental backup of a single postgres server (windows). I have the following setup in postgresql.conf: max_wal_senders=2 wal_level=archive archive_mode=on archive_command='copy %p

Re: [GENERAL] How to do incremental / differential backup every hour in Postgres 9.1?

2013-07-26 Thread Giuseppe Broccolo
Hi Neil, Il 26/07/2013 00:24, Neil McGuigan ha scritto: Trying to do an hourly hot incremental backup of a single postgres server (windows). I have the following setup in postgresql.conf: max_wal_senders=2 wal_level=archive archive_mode=on archive_command='copy %p c:\\postgres\\archive\\%f'

Re: [GENERAL] How to do incremental / differential backup every hour in Postgres 9.1?

2013-07-26 Thread Jeff Janes
On Thu, Jul 25, 2013 at 3:24 PM, Neil McGuigan neilmcgui...@gmail.com wrote: Trying to do an hourly hot incremental backup of a single postgres server (windows). Can you explain what incremental backup means to you? I find that there is a surprising variety of opinions about what these terms

[GENERAL] How to do incremental / differential backup every hour in Postgres 9.1?

2013-07-25 Thread Neil McGuigan
Trying to do an hourly hot incremental backup of a single postgres server (windows). I have the following setup in postgresql.conf: max_wal_senders=2 wal_level=archive archive_mode=on archive_command='copy %p c:\\postgres\\archive\\%f' I did a base backup with pg_basebackup -U postgres -D

[GENERAL] How to do a full-text search words within some proximity of each other?

2012-09-24 Thread W. Matthew Wilson
I noticed in elastic search (ES), you can do queries like a b~4 I think this query will match stuff like a b and a x x b but not something like a x x x x x x x x b. I'm not sure if this kind of thing is possible with postgresql full text search. Is it possible? I understand that I can do

Re: [GENERAL] How to do a full-text search words within some proximity of each other?

2012-09-24 Thread Oleg Bartunov
something like this ? http://www.sai.msu.su/~megera/wiki/2009-08-12 http://www.sai.msu.su/~megera/postgres/talks/algebra-fts.pdf Unfortunately, we get no support for this work, so we stop maintaining phrase-search patch. I even thinking about kikstarter.com to get money for this project :)

Re: [GENERAL] How to do this ?

2011-05-19 Thread Adarsh Sharma
Esmin Gracic wrote: On Wed, May 18, 2011 at 1:25 PM, Adarsh Sharma adarsh.sha...@orkash.com mailto:adarsh.sha...@orkash.com wrote: Dear all, I explain in the simple terms : Our application stores data in a format that is not best fitted to analyze. _*Table news

Re: [GENERAL] How to do this ?

2011-05-19 Thread Adarsh Sharma
Any update on this. Please guide. Adarsh Sharma wrote: Dear all, I explain in the simple terms : Our application stores data in a format that is not best fitted to analyze. _*Table news *_category_id Record_id field_name field_value

[GENERAL] How to do this ?

2011-05-18 Thread Adarsh Sharma
Dear all, I explain in the simple terms : Our application stores data in a format that is not best fitted to analyze. _*Table news *_category_id Record_id field_name field_value

Re: [GENERAL] How to do hot backup using postgres

2010-08-17 Thread Ray Stell
On Tue, Aug 17, 2010 at 11:02:20AM +0700, tuanhoanganh wrote: On Sat, Aug 14, 2010 at 10:00 AM, tuanhoanganh hatua...@gmail.com wrote: The process cannot access the file because it is being used by another process. C:\...\8.3\pg_xlog\00010007001B Exclude pg_log from the backup

Re: [GENERAL] How to do hot backup using postgres

2010-08-16 Thread tuanhoanganh
Can anyone answer me ? Thanks you very much Tuan Hoang Anh On Sat, Aug 14, 2010 at 10:00 AM, tuanhoanganh hatua...@gmail.com wrote: I tried to do pitr backup using Postgres 8.3.9 on windows. So I issued SELECT pg_start_backup('test'); After I put the db in backup mode I tried to zip the data

[GENERAL] How to do hot backup using postgres

2010-08-13 Thread tuanhoanganh
I tried to do pitr backup using Postgres 8.3.9 on windows. So I issued SELECT pg_start_backup('test'); After I put the db in backup mode I tried to zip the data directory files with 7z. However I encountered the following errors: The process cannot access the file because it is being used by

[GENERAL] How to do pg_dump + pg_restore within Perl script?

2010-05-10 Thread Kynn Jones
I would like to replicate the following Unix pipe within a Perl script, perhaps using DBD::Pg: % pg_dump -Z9 -Fc -U DB_USER FROM_DB | pg_restore -v -d TO_DB -p SSH_TUNNEL_PORT -h localhost -U DB_USER Of course, I can try to use Perl's system, and the like, to run this pipe verbatim, but I this

Re: [GENERAL] How to do pg_dump + pg_restore within Perl script?

2010-05-10 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I would like to replicate the following Unix pipe within a Perl script, perhaps using DBD::Pg: % pg_dump -Z9 -Fc -U DB_USER FROM_DB | pg_restore -v -d TO_DB -p SSH_TUNNEL_PORT -h localhost -U DB_USER Of course, I can try to use Perl's

Re: [GENERAL] How to do pg_dump + pg_restore within Perl script?

2010-05-10 Thread Joshua D. Drake
On Mon, 2010-05-10 at 17:33 +, Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I would like to replicate the following Unix pipe within a Perl script, perhaps using DBD::Pg: % pg_dump -Z9 -Fc -U DB_USER FROM_DB | pg_restore -v -d TO_DB -p

Re: [GENERAL] How to do pg_dump + pg_restore within Perl script?

2010-05-10 Thread Kynn Jones
On Mon, May 10, 2010 at 1:33 PM, Greg Sabino Mullane g...@turnstep.comwrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I would like to replicate the following Unix pipe within a Perl script, perhaps using DBD::Pg: % pg_dump -Z9 -Fc -U DB_USER FROM_DB | pg_restore -v -d

Re: [GENERAL] How to do pg_dump + pg_restore within Perl script?

2010-05-10 Thread Kynn Jones
On Mon, May 10, 2010 at 2:59 PM, Joshua D. Drake j...@commandprompt.comwrote: On Mon, 2010-05-10 at 17:33 +, Greg Sabino Mullane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I would like to replicate the following Unix pipe within a Perl script, perhaps using

Re: [GENERAL] How to do pg_dump + pg_restore within Perl script?

2010-05-10 Thread Tom Lane
Kynn Jones kyn...@gmail.com writes: But I have not found a way for my script to provide a password when it runs commands like dropdb, createdb, and pg_restore with the -h REMOTE HOST flag. So I end up resorting to SSH-tunneling. This is what I'm trying to avoid. You don't really want to

Re: [GENERAL] How to do pg_dump + pg_restore within Perl script?

2010-05-10 Thread Tom Lane
Kynn Jones kyn...@gmail.com writes: Actually, that was a mistake on my part. That should have been -Ft rather than -Z9 -Fc, since I *don't* want compression (most of the data being transmitted consists of highly incompressible blobs anyway). Regarding SSH, my understanding is that to get

Re: [GENERAL] How to do pg_dump + pg_restore within Perl script?

2010-05-10 Thread Andy Colson
On 5/10/2010 2:46 PM, Kynn Jones wrote: On Mon, May 10, 2010 at 1:33 PM, Greg Sabino Mullane g...@turnstep.com mailto:g...@turnstep.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I would like to replicate the following Unix pipe within a Perl script,

Re: [GENERAL] how to do this select?

2009-02-19 Thread Craig Ringer
Yi Zhao wrote: ok, thanks, I will create a new message when I post next time. And it's nice to reply below the original message, after cutting off the bits that don't matter anymore. It saves space and makes your messages easier for other people to read, which means you are more likely to

Re: [GENERAL] how to do this select?

2009-02-19 Thread A. Kretschmer
In response to Yi Zhao : ok, thanks, I will create a new message when I post next time. about my question, I think distinct can't solve my problem, because I want to get more than one rows. if there is more than (or equal) 2 (eg: 2, 3, 4, 100 ...)rows have the same value of column 'b' , I

[GENERAL] how to do this select?

2009-02-18 Thread Yi Zhao
hi, all, I have a table in postgresql which have 2 columns like this: a|b -- X A X A Y A D B H B E B D B P C when I do select and order by, I got this: a | b ---+--- X | A X | A Y | A D | B H | B | B D | B P | C I want to get the only 2 rows(limit or random) if the column b have

Re: [GENERAL] how to do this select?

2009-02-18 Thread Craig Ringer
Yi Zhao wrote: I want to get the only 2 rows(limit or random) if the column b have the same value. so, the result of the above is a | b ---+--- X | A X | A D | B H | B P | C how to do that, thanks all! I don't understand what you want based on your description and your example results.

Re: [GENERAL] how to do this select?

2009-02-18 Thread Yi Zhao
thanks Ringer. my mean is that: I want less than 2 rows which have the same value of column b! for example, there is 3 columns have the same value A, X | A X | A Y | A I want my result have two of them. thanks. On Thu, 2009-02-19 at 15:49 +0900, Craig Ringer wrote: Yi Zhao wrote: I want

Re: [GENERAL] how to do this select?

2009-02-18 Thread A. Kretschmer
In response to Craig Ringer : I don't understand what you want based on your description and your example results. What do you mean by if the column `b' have the same value ? Additionally, don't hijack other threads by answer to an old message and changing the subject. Your eMails contains a

Re: [GENERAL] how to do this select?

2009-02-18 Thread Craig Ringer
Yi Zhao wrote: thanks Ringer. my mean is that: I want less than 2 rows which have the same value of column b! for example, there is 3 columns have the same value A, X | A X | A Y | A I want my result have two of them. Less than two? ie just one? That's easy: test=# SELECT DISTINCT ON (b)

Re: [GENERAL] how to do this select?

2009-02-18 Thread A. Kretschmer
In response to Yi Zhao : thanks Ringer. my mean is that: I want less than 2 rows which have the same value of column b! for example, there is 3 columns have the same value A, X | A X | A Y | A I want my result have two of them. I think, you are searching for DISTINCT: test=# create

Re: [GENERAL] how to do this select?

2009-02-18 Thread Yi Zhao
ok, thanks, I will create a new message when I post next time. about my question, I think distinct can't solve my problem, because I want to get more than one rows. if there is more than (or equal) 2 (eg: 2, 3, 4, 100 ...)rows have the same value of column 'b' , I want to get only 2 rows. if

Re: [GENERAL] How to do an UPDATE for all the fields that do NOT break a constraint?

2009-01-27 Thread Alban Hertroys
On Jan 26, 2009, at 2:09 PM, Phoenix Kiula wrote: I wonder if this is an SQL limitation or something I'm missing in the PG manual, but I need to run an update on my database (to replace the value of a column to match a new design structure). Easiest is probably to add a new column for the

[GENERAL] How to do an UPDATE for all the fields that do NOT break a constraint?

2009-01-26 Thread Phoenix Kiula
I wonder if this is an SQL limitation or something I'm missing in the PG manual, but I need to run an update on my database (to replace the value of a column to match a new design structure). Due to the new business logic, the replaced value of a field may end up being already present in the

Re: [GENERAL] How to do an UPDATE for all the fields that do NOT break a constraint?

2009-01-26 Thread Matthias Karlsson
On Mon, Jan 26, 2009 at 2:09 PM, Phoenix Kiula phoenix.ki...@gmail.com wrote: I wonder if this is an SQL limitation or something I'm missing in the PG manual, but I need to run an update on my database (to replace the value of a column to match a new design structure). Due to the new business

Re: [GENERAL] How to do an UPDATE for all the fields that do NOT break a constraint?

2009-01-26 Thread Phoenix Kiula
On Mon, Jan 26, 2009 at 9:45 PM, Matthias Karlsson matth...@yacc.se wrote: On Mon, Jan 26, 2009 at 2:09 PM, Phoenix Kiula phoenix.ki...@gmail.com wrote: I wonder if this is an SQL limitation or something I'm missing in the PG manual, but I need to run an update on my database (to replace the

Re: [GENERAL] How to do an UPDATE for all the fields that do NOT break a constraint?

2009-01-26 Thread Matthias Karlsson
On Mon, Jan 26, 2009 at 2:53 PM, Phoenix Kiula phoenix.ki...@gmail.com wrote: On Mon, Jan 26, 2009 at 9:45 PM, Matthias Karlsson matth...@yacc.se wrote: On Mon, Jan 26, 2009 at 2:09 PM, Phoenix Kiula phoenix.ki...@gmail.com wrote: I wonder if this is an SQL limitation or something I'm missing

Re: [GENERAL] How often do I need to reindex tables?

2007-04-19 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: Just an FYI ... I remembered what prompted the cron job. We were seeing significant performance degradation. I never did actual measurements, but it was on the order of Bill, why is restoring taking such a

Re: [GENERAL] How often do I need to reindex tables?

2007-04-19 Thread Martin Gainty
immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Bill Moran [EMAIL PROTECTED] To: Tom Lane [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Sent: Thursday, April 19, 2007 9:33 AM Subject: Re: [GENERAL] How

Re: [GENERAL] How often do I need to reindex tables?

2007-03-02 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: Just an FYI ... I remembered what prompted the cron job. We were seeing significant performance degradation. I never did actual measurements, but it was on the order of Bill, why is restoring taking such a

Re: [GENERAL] How often do I need to reindex tables?

2007-03-02 Thread Jeff Davis
On Wed, 2007-02-28 at 09:17 -0800, Joshua D. Drake wrote: Bill, you are right but I believe Jim was speaking from a general perspective. Generally speaking you should not have to reindex, or if you do very rarely. I too have a couple of databases we manage that require a reindex more often

Re: [GENERAL] How often do I need to reindex tables?

2007-03-02 Thread Tom Lane
Jeff Davis [EMAIL PROTECTED] writes: Isn't a REINDEX still needed in the case of monotonically increasing keys, such as in a sequence or timestamp index? I also delete tuples, so that results in a forward-shifting range of keys. No, that shouldn't be a problem, if you're maintaining a constant

Re: [GENERAL] How often do I need to reindex tables?

2007-03-02 Thread Jeff Davis
On Fri, 2007-03-02 at 16:39 -0500, Tom Lane wrote: Jeff Davis [EMAIL PROTECTED] writes: Isn't a REINDEX still needed in the case of monotonically increasing keys, such as in a sequence or timestamp index? I also delete tuples, so that results in a forward-shifting range of keys. No, that

Re: [GENERAL] How often do I need to reindex tables?

2007-03-01 Thread Vivek Khera
On Feb 28, 2007, at 5:35 PM, Bill Moran wrote: Just an FYI ... I remembered what prompted the cron job. We were seeing significant performance degradation. I never did actual measurements, but it was on the order of Bill, why is restoring taking such a long time? from other systems

Re: [GENERAL] How often do I need to reindex tables?

2007-03-01 Thread Tom Lane
Bill Moran [EMAIL PROTECTED] writes: Just an FYI ... I remembered what prompted the cron job. We were seeing significant performance degradation. I never did actual measurements, but it was on the order of Bill, why is restoring taking such a long time? from other systems people. At the

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Ezequias Rodrigues da Rocha
This select doesn't return any row. What does it mean ? Ezequias. 2007/2/27, Jim C. Nasby [EMAIL PROTECTED]: On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is, it is a

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Ezequias Rodrigues da Rocha [EMAIL PROTECTED]: 2007/2/27, Jim C. Nasby [EMAIL PROTECTED]: On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is, it is a

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Joshua D. Drake
Bill Moran wrote: In response to Ezequias Rodrigues da Rocha [EMAIL PROTECTED]: 2007/2/27, Jim C. Nasby [EMAIL PROTECTED]: On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is,

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Tom Lane
Bill Moran [EMAIL PROTECTED] writes: I don't agree. I think that regular indexing is mandatory under some workloads. Example: ... There are some additional indexes that I've snipped from the output that also saw some benefit from reindexing, but let's just focus on file_fp_idx. Can you

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Joshua D. Drake [EMAIL PROTECTED]: Bill Moran wrote: In response to Ezequias Rodrigues da Rocha [EMAIL PROTECTED]: 2007/2/27, Jim C. Nasby [EMAIL PROTECTED]: On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: I don't agree. I think that regular indexing is mandatory under some workloads. Example: ... There are some additional indexes that I've snipped from the output that also saw some benefit from

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Tom Lane
Bill Moran [EMAIL PROTECTED] writes: In response to Tom Lane [EMAIL PROTECTED]: Can you describe the usage pattern of that index? I'm curious why it doesn't maintain reasonably static size. How often is the underlying table vacuumed? ... There are 21 jobs, each ranging in size from 2000 -

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: In response to Tom Lane [EMAIL PROTECTED]: Can you describe the usage pattern of that index? I'm curious why it doesn't maintain reasonably static size. How often is the underlying table vacuumed? ...

Re: [GENERAL] How often do I need to reindex tables?

2007-02-28 Thread Bill Moran
In response to Tom Lane [EMAIL PROTECTED]: Bill Moran [EMAIL PROTECTED] writes: In response to Tom Lane [EMAIL PROTECTED]: Can you describe the usage pattern of that index? I'm curious why it doesn't maintain reasonably static size. How often is the underlying table vacuumed? ...

[GENERAL] How often do I need to reindex tables?

2007-02-27 Thread Dhaval Shah
I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is, it is a moderate sized database with moderate usage of tables. Given that, how often do I need to reindex the tables? Do I need to do it everyday? Also with 8.2, I do not have to do

Re: [GENERAL] How often do I need to reindex tables?

2007-02-27 Thread Jim C. Nasby
On Tue, Feb 27, 2007 at 11:26:02AM -0800, Dhaval Shah wrote: I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is, it is a moderate sized database with moderate usage of tables. Given that, how often do I need to reindex the tables? Do I

Re: [GENERAL] How often do I need to reindex tables?

2007-02-27 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/27/07 13:26, Dhaval Shah wrote: I am planning to use 8.2 and the average inserts/deletes and updates across all tables is moderate. That is, it is a moderate sized database with moderate usage of tables. Moderate? -BEGIN PGP

Re: [GENERAL] How to do auto numbering on INT column

2006-08-11 Thread Alban Hertroys
Junkone wrote: CREATE TABLE SYMBOL ( SYMBOL_ID int4 NOT NULL, SYMBOL2EXCHANGE int2 NOT NULL, SYMBOL_ALIAS text[], RELATED_SYMBOLS_OTHER_EXCHANGES int8[], SYMBOL_NAME text, COMPANY_NAME text, SYMBOL2SECTOR int2, SYMBOL2INDUSTRY int4, STOCK_SUMMARY text ) I think you'll want

Re: [GENERAL] How to do auto numbering on INT column

2006-08-11 Thread Brent Wood
Junkone wrote: HI I have a simple table created using PGAdmin III. How do i do a auto numbering on a column SYMBOL_ID? My table is CREATE TABLE SYMBOL ( SYMBOL_ID int4 NOT NULL, SYMBOL2EXCHANGE int2 NOT NULL, SYMBOL_ALIAS text[], RELATED_SYMBOLS_OTHER_EXCHANGES int8[], SYMBOL_NAME

Re: [GENERAL] How to do auto numbering on INT column

2006-08-10 Thread Chris Mair
HI I have a simple table created using PGAdmin III. How do i do a auto numbering on a column SYMBOL_ID? My table is CREATE TABLE SYMBOL ( SYMBOL_ID int4 NOT NULL, SYMBOL2EXCHANGE int2 NOT NULL, SYMBOL_ALIAS text[], RELATED_SYMBOLS_OTHER_EXCHANGES int8[], SYMBOL_NAME text,

[GENERAL] How to do auto numbering on INT column

2006-08-10 Thread Junkone
HI I have a simple table created using PGAdmin III. How do i do a auto numbering on a column SYMBOL_ID? My table is CREATE TABLE SYMBOL ( SYMBOL_ID int4 NOT NULL, SYMBOL2EXCHANGE int2 NOT NULL, SYMBOL_ALIAS text[], RELATED_SYMBOLS_OTHER_EXCHANGES int8[], SYMBOL_NAME text, COMPANY_NAME

Re: [GENERAL] How to do a CREATE DATABASE and then connect to it?

2006-06-04 Thread Joseph Brenner
Terry Lee Tucker [EMAIL PROTECTED] wrote: Joseph Brenner [EMAIL PROTECTED] wrote: Joseph Brenner wrote: After you do a CREATE DATABASE, how do you programatically connect to what you just created? It's not a terribly major point, I'm just wondering if it's true that there's

Re: [GENERAL] How to do a CREATE DATABASE and then connect to it?

2006-06-04 Thread Martijn van Oosterhout
On Sun, Jun 04, 2006 at 02:24:32PM -0700, Joseph Brenner wrote: I think there are two different connects we're talking about here, one is the connection to the postgresql, the other is the connection to the database (i.e. the dbname, which probably should've been called the catalog). My

Re: [GENERAL] How to do a CREATE DATABASE and then connect to it?

2006-06-03 Thread Terry Lee Tucker
On Saturday 03 June 2006 04:07 am, Joseph Brenner [EMAIL PROTECTED] thus communicated: -- -- Joshua D. Drake [EMAIL PROTECTED] wrote: -- -- Joseph Brenner wrote: -- -- After you do a CREATE DATABASE, how do you programatically -- connect to what you just created? -- -- In the psql

Re: [GENERAL] How to do a CREATE DATABASE and then connect to it?

2006-06-03 Thread Frank Finner
On Sat, 3 Jun 2006 04:36:59 -0400 Terry Lee Tucker [EMAIL PROTECTED] thought long, then sat down and wrote: On Saturday 03 June 2006 04:07 am, Joseph Brenner [EMAIL PROTECTED] thus communicated: -- -- Joshua D. Drake [EMAIL PROTECTED] wrote: -- -- Joseph Brenner wrote: -- -- After

[GENERAL] How to do a CREATE DATABASE and then connect to it?

2006-06-02 Thread Joseph Brenner
After you do a CREATE DATABASE, how do you programatically connect to what you just created? In the psql monitor, you'd use the \c command. If the DATABASE already exists when you connect to postgresql, you use the name when you connect (e.g. dbname=...). I'm getting the impression I

Re: [GENERAL] How to do a CREATE DATABASE and then connect to it?

2006-06-02 Thread Joshua D. Drake
Joseph Brenner wrote: After you do a CREATE DATABASE, how do you programatically connect to what you just created? In the psql monitor, you'd use the \c command. If the DATABASE already exists when you connect to postgresql, you use the name when you connect (e.g. dbname=...). I'm

Re: [GENERAL] How to do?

2003-08-06 Thread Franco Bruno Borghesi
mmm... I don't understand. The query brings a resultset just like the one you asked. When you say that 'there's no guarantee that A field is sorted or unique...', what do you mean? The query doesn't care about the A field, it just needs UID to be a candidate key. And I still don't

Re: [GENERAL] How to do?

2003-08-01 Thread Ron Johnson
On Wed, 2003-07-30 at 07:17, Robert Partyka wrote: Hi, Have question How to do such like this: I have: select column list form tables where where statement; how to make one column be row numbers in result? and second one: have select like above and I know that in result is

Re: [GENERAL] How to do?

2003-08-01 Thread Shridhar Daithankar
On 1 Aug 2003 at 9:47, Ron Johnson wrote: On Wed, 2003-07-30 at 07:17, Robert Partyka wrote: Hi, Have question How to do such like this: I have: select column list form tables where where statement; how to make one column be row numbers in result? select oid,name from a;

[GENERAL] how to do a select distinct within pgplsql

2001-04-04 Thread Feite Brekeveld
Hi, I want to do the following: snip> create function ... as ... BEGIN FOR myrec INselect distinct id from table where condition LOOP ENDLOOP; END; Now this doesn't work because the FORINstatment expects a complete record. How to deal with this ? Tried CURSOR but that led to errors too.

[GENERAL] How to do this in Postgres

1999-11-23 Thread Holger Klawitter
Hi there, I tried all I could think of with the following problem, perhaps someone has another idea. I have a table where for each id there may (and often are) multiple rows with some kind of priority. create table data ( id1 int4, id2 int4, lots of data, prio int4 ); The minimal priority is