Re: [GENERAL] Connect to postgresql database using Perl

2010-03-30 Thread Pavel Stehule
Hello 2010/3/31 dipti shah : > Hi, > > Could anyone please provide me an example to connect to a postgresql > database using Perl language and accessing the tables, schemas, and other > postgresql objects. > http://www.felixgers.de/teaching/perl/perl_DBI.html http://structbio.vanderbilt.edu/chazi

[GENERAL] Connect to postgresql database using Perl

2010-03-30 Thread dipti shah
Hi, Could anyone please provide me an example to connect to a postgresql database using Perl language and accessing the tables, schemas, and other postgresql objects. Thanks, Dipti

Re: [GENERAL] Running Windows on a Mac partition

2010-03-30 Thread John Gage
This response came in as I was mea culpa-ing. Everything here is correct to the best of my knowledge. And I am very glad to be warned not to go between the two OS's. Thank you, John Personally, what I'd do would be create a virtual machine image with something like VMWare - something that is

Re: [GENERAL] Running Windows on a Mac partition

2010-03-30 Thread John Gage
Unfortunately, but no unexpectedly, I have been moderately stupid in this question. Using Bootcamp, the OS's are *not* running simultaneously. Hence, the server, which is on the Mac is not running when Win is running. There is the possibility for the Mac to *read* files in Win, but that i

Re: [GENERAL] Running Windows on a Mac partition

2010-03-30 Thread Craig Ringer
John Gage wrote: > I just wondered if I could access the same 8.4.2 server from the Windows > partition (XP via "Bootcamp") as I do from the Mac partition on my Mac? If I understand correctly, Boot Camp doesn't permit both Mac OS X and Windows to run at the same time, right? You can run one or the

Re: [GENERAL] Running Windows on a Mac partition

2010-03-30 Thread John Gage
a method of "dual booting" Windows and Mac OS. Meaning, that either one or the other would be running at any given point of time. The impression I was under was that both OSes were active and you just flipped between the two with a sort of super alt-tab command. In the case of Bootcamp, onl

Re: [GENERAL] User action accounting

2010-03-30 Thread Craig Ringer
Joshua Berry wrote: > Hello All, > > I have a few PHP/Clarion based applications that don't currently track > who created and modified records. I'd like to be able to track all user > and timestamp pairs for INSERT/UPDATEs by way of triggers. > > The problem is that I currently use the same role

[GENERAL] Unsubscribe

2010-03-30 Thread Wojtek
unsubscribe

Re: [GENERAL] plPgSQL + CDIR/INET types ...

2010-03-30 Thread Steve Atkins
On Mar 30, 2010, at 7:09 PM, Marc G. Fournier wrote: > > Has anyone either played with, or gotten to work, a plPgSQL function that > would take: 192.168.1.1/24 and determine the start and end IP from that? Or > even start IP + # of IPs in the subnet? If that was a valid cidr value (like 192.

[GENERAL] plPgSQL + CDIR/INET types ...

2010-03-30 Thread Marc G. Fournier
Has anyone either played with, or gotten to work, a plPgSQL function that would take: 192.168.1.1/24 and determine the start and end IP from that? Or even start IP + # of IPs in the subnet? Marc G. FournierHub.Org Hosting Solutions S.A. scra...@hub.org

Re: [GENERAL] Migration - not null default '0' -> not null default 0 - confused

2010-03-30 Thread Adrian Klaver
On Tuesday 30 March 2010 4:59:30 pm Jeff Davis wrote: > On Tue, 2010-03-30 at 16:32 -0700, Adrian Klaver wrote: > > 8.3 tightened up type casting. You cannot INSERT a '0' without casting it > > to an integer i.e '0'::integer. > > I don't think that's accurate: > > postgres=# select version(); > >

Re: [GENERAL] Migration - not null default '0' -> not null default 0 - confused

2010-03-30 Thread Steve Atkins
> platform | character varying(8) | not null default 'OTHER'::character varying > time | integer | not null default 0 > page | text | > type | integer | not null default 0 > user_id | integer | not null default 0 &

Re: [GENERAL] Migration - not null default '0' -> not null default 0 - confused

2010-03-30 Thread Jeff Davis
On Tue, 2010-03-30 at 16:32 -0700, Adrian Klaver wrote: > 8.3 tightened up type casting. You cannot INSERT a '0' without casting it to > an > integer i.e '0'::integer. I don't think that's accurate: postgres=# select version(); version

Re: [GENERAL] pgfoundry registration

2010-03-30 Thread Jeff Davis
On Thu, 2010-03-25 at 13:05 +0100, Krzysztof Nienartowicz wrote: > Hello, > Is registration to pgFoundry closed on purpose? I get confirmation > emails but am greeted with: > > > > Access denied > > Credentials you entered do not correspond to valid account. > > Could you help or advise, pleas

Re: [GENERAL] Migration - not null default '0' -> not null default 0 - confused

2010-03-30 Thread Adrian Klaver
On Tuesday 30 March 2010 4:49:42 pm Wang, Mary Y wrote: > Ok. Thanks. In that case, I'm going to have a lot of type casting issues. > What's the best way to fix all tables? Write a script to alter those > tables? Any suggestions? > > Mary Wang > > This might help: http://petereisentraut.blogspo

Re: [GENERAL] Migration - not null default '0' -> not null default 0 - confused

2010-03-30 Thread Wang, Mary Y
racter varying time | integer | not null > default 0 > page | text | > type | integer | not null default 0 > user_id | integer | not null default 0 > > Now, the source code doesn't work any more. Here is th

Re: [GENERAL] Migration - not null default '0' -> not null default 0 - confused

2010-03-30 Thread Adrian Klaver
gt; precision platform | character varying(8) | not null default > 'OTHER'::character varying time | integer | not null > default 0 > page | text | > type | integer | not null default 0 > user_id | integer

[GENERAL] Migration - not null default '0' -> not null default 0 - confused

2010-03-30 Thread Wang, Mary Y
| not null default 0 user_id | integer | not null default 0 Now, the source code doesn't work any more. Here is the SQL - INSERT INTO activity_log (day,hour,group_id,browser,ver,platform,time,page,type,user_id) VALUES (20100330,'16','','

Re: [GENERAL] Running Windows on a Mac partition

2010-03-30 Thread Scott Marlowe
On Tue, Mar 30, 2010 at 4:20 PM, Joshua Berry wrote: > > On Tue, Mar 30, 2010 at 4:46 PM, Scott Marlowe > wrote: >> >> On Tue, Mar 30, 2010 at 1:57 PM, John Gage wrote: >> > I just wondered if I could access the same 8.4.2 server from the Windows >> > partition (XP via "Bootcamp") as I do from t

Re: [GENERAL] Running Windows on a Mac partition

2010-03-30 Thread Joshua Berry
On Tue, Mar 30, 2010 at 4:46 PM, Scott Marlowe wrote: > On Tue, Mar 30, 2010 at 1:57 PM, John Gage wrote: > > I just wondered if I could access the same 8.4.2 server from the Windows > > partition (XP via "Bootcamp") as I do from the Mac partition on my Mac? > > Assuming both virtual machines (or

Re: [GENERAL] Running Windows on a Mac partition

2010-03-30 Thread Scott Marlowe
On Tue, Mar 30, 2010 at 1:57 PM, John Gage wrote: > I just wondered if I could access the same 8.4.2 server from the Windows > partition (XP via "Bootcamp") as I do from the Mac partition on my Mac? Assuming both virtual machines (or the virtual machine and the host) are up at the same time, it's

[GENERAL] Running Windows on a Mac partition

2010-03-30 Thread John Gage
I just wondered if I could access the same 8.4.2 server from the Windows partition (XP via "Bootcamp") as I do from the Mac partition on my Mac? Thanks, John P.S. In other words, do I have to duplicate everything on the two "machines"? -- Sent via pgsql-general mailing list (pgsql-gene

Re: [GENERAL] Converting time interval to double precision of time unit

2010-03-30 Thread Mike Toews
On 30 March 2010 11:55, Tom Lane wrote: > I think what Mike is actually looking for is > > SELECT extract(epoch from interval '3 days 2 hours 34 minutes'); >  date_part > --- >    268440 Yet better, if I define 1 hour as 3600 seconds (this is only incorrect if the interval spans over a le

Re: [GENERAL] Converting time interval to double precision of time unit

2010-03-30 Thread Tom Lane
Alban Hertroys writes: > On 30 Mar 2010, at 18:29, Mike Toews wrote: >> I'm using 8.3, and I'm trying to work with the interval type, and I >> can't seem to get things right. I've been all over the docs[1,2], and >> there is no mention on how this can be done. >> >> While I can get: >> SELECT '3

Re: [GENERAL] Wiki Updates - 9.0

2010-03-30 Thread Greg Smith
Tyler Hains wrote: At what point does the Wiki start getting updated for new releases? It seems there are some significant changes needed to this page for version 9: http://wiki.postgresql.org/wiki/Replication%2C_Clustering%2C_and_Connection_Pooling We're currently revamping everything

Re: [GENERAL] Wiki Updates - 9.0

2010-03-30 Thread Raymond O'Donnell
On 30/03/2010 18:52, Tyler Hains wrote: > I take it that the user accounts for the Wiki are only granted to > trusted people to keep the info accurate? I’d happily help with general > stuff and let people fill in the details – but didn’t see a way to > register… As I understand it, you just need

[GENERAL] Wiki Updates - 9.0

2010-03-30 Thread Tyler Hains
At what point does the Wiki start getting updated for new releases? It seems there are some significant changes needed to this page for version 9: http://wiki.postgresql.org/wiki/Replication%2C_Clustering%2C_and_Connect ion_Pooling I take it that the user accounts for the Wiki are only granted

Re: [GENERAL] set statement_timeout does not work

2010-03-30 Thread Scott Marlowe
On Mon, Mar 29, 2010 at 8:33 PM, Jun Wang wrote: > Hi, > > I try to set the statement_timeout so that "select pg_stop_backup();" > will not hang if archive command failed. Below are the command and > errors. > Try it by putting the commands in a file and running it like psql . -f mysqlfile.s

Re: [GENERAL] Converting time interval to double precision of time unit

2010-03-30 Thread Alban Hertroys
On 30 Mar 2010, at 18:29, Mike Toews wrote: > I'm using 8.3, and I'm trying to work with the interval type, and I > can't seem to get things right. I've been all over the docs[1,2], and > there is no mention on how this can be done. > > While I can get: > SELECT '3 day 2 hour 34 minute'::interval

Re: [GENERAL] set statement_timeout does not work

2010-03-30 Thread Jun Wang
Hi, I try to set the statement_timeout so that "select pg_stop_backup();" will not hang if archive command failed. Below are the command and Can somebody help on this? Thanks. * From: Ju

Re: [GENERAL] User action accounting

2010-03-30 Thread Steve Atkins
On Mar 30, 2010, at 8:03 AM, Joshua Berry wrote: > Hello All, > > I have a few PHP/Clarion based applications that don't currently track who > created and modified records. I'd like to be able to track all user and > timestamp pairs for INSERT/UPDATEs by way of triggers. > > The problem is th

Re: [GENERAL] Dblink vs calling a function that returns void

2010-03-30 Thread Tom Lane
Merlin Moncure writes: >> You're overthinking the problem.  Imagine void is just a datatype >> (which it is...)  This should work: > but it isn't! void returning functions may not be queried over the > binary protocol (why?), Probably because we never made a send function for type void. Might b

Re: [GENERAL] User action accounting

2010-03-30 Thread Andy Colson
On 3/30/2010 11:13 AM, Joshua Berry wrote: On Tue, Mar 30, 2010 at 10:46 AM, Andy Colson mailto:a...@squeakycode.net>> wrote: When your app/users connect to the db, do they connect as the same user, or each with a different username? The application instances each connect to the datab

[GENERAL] Converting time interval to double precision of time unit

2010-03-30 Thread Mike Toews
I'm using 8.3, and I'm trying to work with the interval type, and I can't seem to get things right. I've been all over the docs[1,2], and there is no mention on how this can be done. While I can get: SELECT '3 day 2 hour 34 minute'::interval .. how can then get the fractional hours of this time i

Re: [GENERAL] Dblink vs calling a function that returns void

2010-03-30 Thread Merlin Moncure
On Mon, Mar 29, 2010 at 12:12 PM, Tom Lane wrote: > Boszormenyi Zoltan writes: >> I need to call a function via dblink that returns a void, i.e. >> technically nothing. > > You're overthinking the problem.  Imagine void is just a datatype > (which it is...)  This should work: but it isn't! void

Re: [GENERAL] User action accounting

2010-03-30 Thread Joshua Berry
On Tue, Mar 30, 2010 at 10:46 AM, Andy Colson wrote: > When your app/users connect to the db, do they connect as the same user, or > each with a different username? > The application instances each connect to the database with the same username. The application currently uses an ODBC connection

Re: [GENERAL] createuser: could not connect to database postgres: FATAL: password authentication failed for user "postgres"

2010-03-30 Thread moataz Elmasry
Oh boy, thnx a mil. That solved my problem :). I also found another tip somewhere to change the password not using passwd but the sql command alter role myuser encrypted password 'mypassword' and that works also with md5. and you are right. suse changed 'trust' to 'md5' and reverting it also so

Re: [GENERAL] createuser: could not connect to database postgres: FATAL: password authentication failed for user "postgres"

2010-03-30 Thread moataz Elmasry
Oh boy, thnx a mil. That solved my problem :) . I also found another tip somewhere to change the password not using passwd but the sql command alter role myuser encrypted password 'mypassword' and that works also with md5. and you are right. suse changed 'trust' to 'md5' and reverting it also

Re: [GENERAL] User action accounting

2010-03-30 Thread Andy Colson
On 3/30/2010 10:03 AM, Joshua Berry wrote: Hello All, I have a few PHP/Clarion based applications that don't currently track who created and modified records. I'd like to be able to track all user and timestamp pairs for INSERT/UPDATEs by way of triggers. The problem is that I currently use the

Re: [GENERAL] hstore equality-index performance question

2010-03-30 Thread Tom Lane
Stefan Keller writes: > I'm trying to optimize the latter query: > # SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a'; The hstore gist and gin opclasses contain support for that. > ...or something like this (which also involves the '->' operator) > # SELECT id FROM mytable WHERE (kvp->'a') = '

Re: [GENERAL] hstore equality-index performance question

2010-03-30 Thread Stefan Keller
You are right, my negligence. I'm trying to optimize the latter query: # SELECT id, (kvp->'a') FROM mytable WHERE kvp ? 'a'; ...or something like this (which also involves the '->' operator) # SELECT id FROM mytable WHERE (kvp->'a') = 'x'; -S. 2010/3/29 Sergey Konoplev : >> My question is, if o

[GENERAL] User action accounting

2010-03-30 Thread Joshua Berry
Hello All, I have a few PHP/Clarion based applications that don't currently track who created and modified records. I'd like to be able to track all user and timestamp pairs for INSERT/UPDATEs by way of triggers. The problem is that I currently use the same role name for each instance of the appl

Re: [GENERAL] createuser: could not connect to database postgres: FATAL: password authentication failed for user "postgres"

2010-03-30 Thread Andy Colson
On 3/30/2010 8:55 AM, moataz Elmasry wrote: Hi List This question has already been asked many times, but I didn't find the answer I'm looking for, so here goes I use postgresql 8.3 on suse 11.2 I already installed postgresql many times wit postgis support on debian/ubuntu machines. Never had p

Re: [GENERAL] different behaviour between select and delete when constraint_exclusion = partition

2010-03-30 Thread Tom Lane
Marc Cousin writes: > Anyway here is the problem : when using constraint_exclusion=partition, a > delete query scans all partitions, when the same query rewritten as a select > is removing partitions as expected. When constraint_exclusion=on, the > partition removal works as expected with the d

Re: [GENERAL] Processor speed relative to postgres transactions per second

2010-03-30 Thread Merlin Moncure
On Mon, Mar 29, 2010 at 12:42 PM, Chris Barnes wrote: > > We have two camps that think that the speed of cpu processors is/aren't > relative to the number of transactions that postgres that can performed per > second. > > I am of the opinion that is we throw the faster processors at the database >

[GENERAL] createuser: could not connect to database postgres: FATAL: password authentication failed for user "postgres"

2010-03-30 Thread moataz Elmasry
Hi List This question has already been asked many times, but I didn't find the answer I'm looking for, so here goes I use postgresql 8.3 on suse 11.2 I already installed postgresql many times wit postgis support on debian/ubuntu machines. Never had problems, now I'm installing it for the fi

[GENERAL] createuser: could not connect to database postgres: FATAL: password authentication failed for user "postgres"

2010-03-30 Thread moataz Elmasry
Hi List This question has already been asked many times, but I didn't find the answer I'm looking for, so here goes I use postgresql 8.3 on suse 11.2 I already installed postgresql many times wit postgis support on debian/ubuntu machines. Never had problems, now I'm installing it for the fi

[GENERAL] different behaviour between select and delete when constraint_exclusion = partition

2010-03-30 Thread Marc Cousin
Hi, I don't know if what's below is a bug or simply not implemented. And I don't really know if, when in doubt, like now, I'd rather pollute general or bugs :) Anyway here is the problem : when using constraint_exclusion=partition, a delete query scans all partitions, when the same query rewrit

Re: [GENERAL] Running/cumulative count using windows

2010-03-30 Thread A. Kretschmer
In response to Oliver Kohll - Mailing Lists : > Hello, > > I'm still reasonably new to windowing functions, having used a few since 8.4 > came out. I wonder if anyone can help with this one. > > I've got a table of email addresses in a CRM system similar to the following: > > CREATE TABLE test(

[GENERAL] Running/cumulative count using windows

2010-03-30 Thread Oliver Kohll - Mailing Lists
Hello, I'm still reasonably new to windowing functions, having used a few since 8.4 came out. I wonder if anyone can help with this one. I've got a table of email addresses in a CRM system similar to the following: CREATE TABLE test( signup_date timestamp, email_address varchar(1000) ); INS

[GENERAL] Get the list of permissions on schema for current user

2010-03-30 Thread dipti shah
Hi, I ran below command to list out all privileges of objects if "mydb" schema. Actually, I want to know what are the permissions "user1" has on mydb schema. Could you please tell me how to do this? mydb=# select pc.relname, pc.relacl from pg_class pc, pg_namespace pn where pc.relnamespace=pn.oid

Re: [GENERAL] insert into test_b (select * from test_a) with different column order

2010-03-30 Thread Szymon Guz
> > > This will not work for me as I do not know in advance what columns > exist in test_a or test_b. I only know they are called the same (and > have the same datatypes). > > So is there a dynamic way in which I can generate the INSERT statement > given the name of the two tables? > > You can writ

[GENERAL] Emphasizing "current item" in subclass of QAbstractItemView

2010-03-30 Thread Davor J.
By default, there is some barely visible dotted rectangle around the QItemSelectionModel::currentIndex (). Has anyone suggestions how to change this efficiently. (i.e. I think adjusting the model data with setData() and Qt::FontRole or Qt::BackgroundRole or something similar isn't the right way

Re: [GENERAL] How to implement word wrap

2010-03-30 Thread Alban Hertroys
On 30 Mar 2010, at 11:32, Andrus wrote: >> Just realised that's not what you're after, but my first point still stands. > > Thank you. > I tried to wrap words at 15 characters using code below. Really, write a stored procedure that accepts (text, line_length) and returns SETOF text. You could

Re: [GENERAL] insert into test_b (select * from test_a) with different column order

2010-03-30 Thread Ole Tange
On Mon, Mar 29, 2010 at 5:09 PM, Leif Biberg Kristensen wrote: > On Monday 29. March 2010 16.51.35 Ole Tange wrote: >> I would like to do this: >> >>   insert into test_b (select * from test_a); > > Per the SQL standard, there's no inherent order between columns. That said, > you'll usually get t

Re: [GENERAL] Get the list of permissions/privileges on schema

2010-03-30 Thread dipti shah
Thanks Ashesh, I ran below command and it is listing all privileges of objects under mydb schema. Actually, I want to know what are the permissions "user1" has on mydb schema. Could you please tell me how to do this? mydb=# select pc.relname, pc.relacl from pg_class pc, pg_namespace pn where pc.re

Re: [GENERAL] How to implement word wrap

2010-03-30 Thread Andrus
Just realised that's not what you're after, but my first point still stands. Thank you. I tried to wrap words at 15 characters using code below. Issues: 1. Table rows places same word to multiple lines. How to remove them so that every word appears only in single row? 2. In last select sum(

Re: [GENERAL] COPY ERROR

2010-03-30 Thread Albe Laurenz
paulo matadr wrote: > When I try to import big file base.txt( 700MB),I get this: > > x=# create table arquivo_serasa_marco( varchar(3000)); > x=# COPY arquivo_serasa_marco from > '/usr/local/pgsql/data/base.txt'; > ERROR: literal newline found in data > HINT: Use "\n" to represent newli