Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Gauthier, Dave
24, 2015 12:50 PM To: Gauthier, Dave Cc: Postgres General Subject: Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows) Hi Dave: On Wed, Jun 24, 2015 at 3:44 PM, Gauthier, Dave wrote: > Hi: I'm trying to get a 10,000 ft understanding of the

Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Gauthier, Dave
o:a...@squeakycode.net] Sent: Wednesday, June 24, 2015 10:10 AM To: Gauthier, Dave; Postgres General Subject: Re: [GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows) On 6/24/2015 8:44 AM, Gauthier, Dave wrote: > Hi: I'm trying to get a 10,000 f

[GENERAL] DB access speeds, App(linux)<->PG(linux) vs App(linux) <->MSSql(Windows)

2015-06-24 Thread Gauthier, Dave
Hi: I'm trying to get a 10,000 ft understanding of the difference in DB access speeds for two different scenarios... Scenario 1: Apps are on linux. PG DB is on linux (different server than apps) Scenario 2: Apps are on linux. MSSql DB is on Windows (obviously a different server) The

Re: [GENERAL] Synchronizing a table that is two different databases : Need to dump a table a insert from db1 and change the insert statements into UPDATE statements

2014-03-27 Thread Gauthier, Dave
In theory, you could write a script that opens both DBs, then systematically inserts or updates records in the destination DB table based on what's in the source DB table. Brute force, but automatable. From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Beh

Re: [GENERAL] Postgresql GROUP BY "SIMILAR" but not equal values

2014-02-06 Thread Gauthier, Dave
What about a regexp match ? -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Tom Lane Sent: Thursday, February 06, 2014 10:32 AM To: alexandros_e Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Postgresql GROUP BY

[GENERAL] need elegant way to store and query tables with variable headers

2013-10-08 Thread Gauthier, Dave
Hi: Longshot, but here goes Someone is asking me for a way to architect a model which will store basic table data (columns with names and rows), but the number and name of the columns are both variables. I'll call these "data-tables" here. Example, Store this "data-table" 'col1'

Re: [GENERAL] Why are stored procedures looked on so negatively?

2013-07-25 Thread Gauthier, Dave
I have a DB that relies heavily on recursive stored procedures that tap reflexive tables that store hierarchical data. These procedures are called from queries and return record streams. Temp tables are used to store collected data as the procedure runs up/down the hierarchy. And many other

Re: [GENERAL] Why are stored procedures looked on so negatively?

2013-07-24 Thread Gauthier, Dave
I find stored procedures to be a God-send. The alternative, external code, is the risky, difficult and often poorer performing approach to the problems sp's solve. What better way to interact programatically with your database than WITH your database? The only people that I see frown upon th

[GENERAL] How to implement a value alias or synonym

2013-07-10 Thread Gauthier, Dave
Hi: v9.0.1 on linux Is there a way to query on synonyms of a value transparent to the user? For example, a column called "animal" can have any text value, including 'horse' and 'cow' and 'pig'. But I want the user to find all the animal='pig' records if they specify 'hog' instead. So..

[GENERAL] case not sensitive to null condition ?

2013-04-30 Thread Gauthier, Dave
v9.0.1 on linux thedb=# select ||bicolumn||, coalesce(permitted_values,'is_null'), case permitted_values when NULL then 'null' else ||permitted_values|| end from bi_constraints limit 2; ?column?| coalesce| case +---+

[GENERAL] indexing elements of a csv ?

2013-03-12 Thread Gauthier, Dave
Hi: v9.0.1 on linux. I have a table with a column that is a csv. Users will select records based upon the existence of an element of the csv. There is an index on that column but I'm thinking that it won't be of much use in this situation. Is there a way to facilitate these queries? Exampl

Re: [GENERAL] Visual query builder for PosgreSQL?

2013-02-16 Thread Gauthier, Dave
Many, many (many) years ago, while working at DIGITAL EQUIPMENT (before it bellied up), I worked with a relational DB they created called "RDB". Someone at DEC wrote an sql development gui in Xwindows called "InstantSQL". It was really great. All the tables of the DB were icons, you could dra

Re: [GENERAL] How to get stored procedure args list from metadata tables ?

2013-02-15 Thread Gauthier, Dave
Is there anything like this soln for v8.3.4 ? I know, I know, just upgrade. But its out of my hands. -Original Message- From: Pavel Stehule [mailto:pavel.steh...@gmail.com] Sent: Wednesday, February 13, 2013 9:24 AM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re

[GENERAL] Need regexp_replace help

2013-02-14 Thread Gauthier, Dave
Trying ( and failing) to get this to run... select regexp_replace(pg_get_functiondef(proname::regproc),E'[ ]+\\+\n','\n') from pg_proc where proname = 'maketime'; Goal is to remove the space padding and the "+" at the end of each line in the dump of pg_get_functiondef, something that could actu

Re: [GENERAL] How to get stored procedure args list from metadata tables ?

2013-02-13 Thread Gauthier, Dave
] Sent: Wednesday, February 13, 2013 9:26 AM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to get stored procedure args list from metadata tables ? On 02/13/2013 06:13 AM, Gauthier, Dave wrote: > Hi: > > Looking for a table or view which contains the list of

Re: [GENERAL] How to get stored procedure args list from metadata tables ?

2013-02-13 Thread Gauthier, Dave
Excellent ! Thank You very much ! -Original Message- From: Albe Laurenz [mailto:laurenz.a...@wien.gv.at] Sent: Wednesday, February 13, 2013 9:30 AM To: Gauthier, Dave; pgsql-general@postgresql.org Subject: RE: How to get stored procedure args list from metadata tables ? Dave Gauthier

[GENERAL] How to get stored procedure args list from metadata tables ?

2013-02-13 Thread Gauthier, Dave
Hi: Looking for a table or view which contains the list of arguments that are passed to a stored procedure. Doesn't seem to be in pg_proc.prosrc or other pg_proc columns. Thanks in Advance for any help.

Re: [GENERAL] PG V9 on NFS

2013-02-12 Thread Gauthier, Dave
OK, with the help of this feedback, they caved and will keep it local storage. Thanks ! -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] PG V9 on NFS

2013-02-11 Thread Gauthier, Dave
Can PG V9.1* support a DB that's on an NFS disk? I googled around, but nothing popped out. Also, would you happen to know the answer to this for MySQL v5.5*? Thanks in Advance.

Re: [GENERAL] noobie question

2013-01-24 Thread Gauthier, Dave
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steve Clark Sent: Thursday, January 24, 2013 12:46 PM To: Jeff Janes Cc: Chris Angelico; pgsql-general@postgresql.org Subject: Re: [GENERAL] noobie question On 01/24/2013

Re: [GENERAL] noobie question

2013-01-24 Thread Gauthier, Dave
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steve Clark Sent: Thursday, January 24, 2013 11:47 AM To: pgsql Subject: [GENERAL] noobie question Hi list, This may be really simple - I usually do it using a procedura

Re: [GENERAL] DB alias ?

2013-01-24 Thread Gauthier, Dave
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Shridhar Daithankar Sent: Wednesday, January 23, 2013 10:32 PM To: pgsql-general@postgresql.org Cc: Gauthier, Dave; Rob Sargent Subject: Re: [GENERAL] DB alias ? On Wednesday, January 23, 2013 09

Re: [GENERAL] DB alias ?

2013-01-23 Thread Gauthier, Dave
ginal Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steve Crawford Sent: Wednesday, January 23, 2013 4:38 PM To: Rob Sargent Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] DB alias ? On 01/23/2013 01:16 PM, Rob Sargent wrote: > O

Re: [GENERAL] DB alias ?

2013-01-23 Thread Gauthier, Dave
On Behalf Of Rob Sargent Sent: Wednesday, January 23, 2013 4:16 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] DB alias ? On 01/23/2013 02:10 PM, Gauthier, Dave wrote: > Nope. Think of it this way, a new DB is created on day 1 of every month. So > there's a DB called

Re: [GENERAL] DB alias ?

2013-01-23 Thread Gauthier, Dave
h. In the meantime, I want those who try to connect to FEB to connect to JAN (for example). -Original Message- From: Joshua D. Drake [mailto:j...@commandprompt.com] Sent: Wednesday, January 23, 2013 4:04 PM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] DB alias ?

[GENERAL] DB alias ?

2013-01-23 Thread Gauthier, Dave
Problem: Some users (scripts actually) try to connect to a DB who's name is derived from environmental variables. The DB doesn't exist (yet), and I want them to connect to a different DB for the time being. Is there a way to define an alias for the existing DB that = the db name that doesn't

Re: [GENERAL] Recommendations on plpgsql debugger?

2013-01-15 Thread Gauthier, Dave
One thing I've done in the past is to create a temporary table and insert "raise notice" debug statements to it, incrementing a sequence as it went along. Then just select the message with order by the seq. Useful in the recursive calls I was testing at the time. But it did require that I sti

Re: [GENERAL] alter default privileges problem

2013-01-03 Thread Gauthier, Dave
The fix had to do with connecting as the "insert" user, then setting the default privs. My mistake was to run the "alter default privileges..." as the superuser. From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Gauthier,

[GENERAL] alter default privileges problem

2013-01-03 Thread Gauthier, Dave
v9.1 on linux Connect to postgres DB, then... create user "select" password 'select'; create user "insert" password 'insert'; alter default privileges for user "insert" grant select on tables to "select"; alter default privileges for user "insert" grant select on sequences to "select"; alter def

[GENERAL] Setting default privs for a user doesn't seem to work.

2012-12-06 Thread Gauthier, Dave
What's wrong with this picture. Trying (failing) to create a user called "select" with default select privs and nothing else. Demo below. Comments in red... fcadsql7> psql sde psql (9.1.5) Type "help" for help. sde=# \du List of roles Role name |

Re: [GENERAL] how do I grant select to one user for all tables in a DB?

2012-12-05 Thread Gauthier, Dave
psql (9.1.5) Type "help" for help. sde=> select * from foo; ERROR: permission denied for relation foo sde=> . From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Gauthier, Dave Sent: Wednesday, December 05, 2012 8:00 AM To: Chri

Re: [GENERAL] how do I grant select to one user for all tables in a DB?

2012-12-05 Thread Gauthier, Dave
ubject: Re: [GENERAL] how do I grant select to one user for all tables in a DB? On Wed, Dec 5, 2012 at 2:12 PM, Gauthier, Dave mailto:dave.gauth...@intel.com>> wrote: > V9.1.5 on linux > User "select" created (yup, that's right, they want the user name to > be "s

[GENERAL] how do I grant select to one user for all tables in a DB?

2012-12-04 Thread Gauthier, Dave
V9.1.5 on linux User "select" created (yup, that's right, they want the user name to be "select". Guess what ptivs it is to have! Don't kill the messanger :-) ) postgres=# grant select on all tables in schema sde to "select"; ERROR: schema "sde" does not exist postgres=# \l

Re: [GENERAL] Need sql to pull data from terribly architected table

2012-10-23 Thread Gauthier, Dave
Thanks for the answers. But I also have a predicate... select col1,col2 from foo where col4='c4' and col5 <> 'xxx'; How is that done? From: Richard Broersma [mailto:richard.broer...@gmail.com] Sent: Tuesday, October 23, 2012 3:24 PM To: ch...@chriscurvey.com Cc: Gau

[GENERAL] Need sql to pull data from terribly architected table

2012-10-23 Thread Gauthier, Dave
Here's the deal... Instead of architecting and loading a table like... create teble foo (col1 text, col2 text, col3 text, col4 text, col5 text); insert into foo (col1,col2,col3,col4,col5) values ('c1',null,'c3','c4',null); They did this instead... create table foo (property text, value text); in

Re: [GENERAL] 9.1 vs 8.4 performance

2012-09-21 Thread Gauthier, Dave
One thing I sometimes forget to do after loading up an empty DB with data is to run "analyze". I usually "remember" once I see poor query performance, run the analyze, and its fixed. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org]

Re: [GENERAL] 9.1 vs 8.4 performance

2012-09-21 Thread Gauthier, Dave
If its not too much work, swap them around and retest to see if its really the DB/version or the machine. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Scott Marlowe Sent: Friday, September 21, 2012 3:01 PM To: salah

[GENERAL] when was a db/schema created ?

2012-09-17 Thread Gauthier, Dave
Is there a way to determine when a DB was created (create database...)? Thanks in advance.

[GENERAL] alter view, add/drop column

2012-09-05 Thread Gauthier, Dave
I googled around and found that adding/dropping columns from views is not available. (if not true, I'm all ears). Given that, what's the best way to do this? I was thinking along the lines of a stored procedure that reads the view's definition, modifies it, drops the view, recreates the view.

Re: [GENERAL] using vars in ddl in procedure call

2012-08-29 Thread Gauthier, Dave
Yup, works like a charm. Thanks Salah and Tom for the advise ! -dave -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Wednesday, August 29, 2012 11:18 AM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] using vars in ddl in procedure call

[GENERAL] using vars in ddl in procedure call

2012-08-29 Thread Gauthier, Dave
Hi: v9.0.1 on linux. Trying (failing) a test to see if I can run ddl in a procedure where elements of the ddl are vars. Consider... create or replace function newcol (text) returns integer as $$ declare newcol alias for $1; begin alter table target add column newcol text; return(0); end

[GENERAL] need substring based on delimiter

2012-08-23 Thread Gauthier, Dave
Hi: I want to create a string from the first 3 elements of a csv (for example). The csv is longer than 3 elements. Example... aaa,bbb,ccc,ddd,eee,fff,ggg I want the string "aaa,bbb,ccc". Tried splitting this to an array (precursor to appending elements 1,2,3), but failed to be able to ref

[GENERAL] Confirming \timing output

2012-08-23 Thread Gauthier, Dave
With \timing set on, I run an update statement and it reports Time: 0.524 ms Is that really 0.524 ms? As in 524 nanoseconds? Also, is this wallclock time or some sort of indication of how much cpu it took? Thanks for any answers !

Re: [GENERAL] Can column name aliases be supported?

2012-08-23 Thread Gauthier, Dave
..@ringerc.id.au] Sent: Thursday, August 23, 2012 9:52 AM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Can column name aliases be supported? On 08/23/2012 09:32 PM, Gauthier, Dave wrote: > The view approach for queries is workable, at least for queries. Thanks fo

Re: [GENERAL] Can column name aliases be supported?

2012-08-23 Thread Gauthier, Dave
Thanks for all the replies ! The real problem has nothing to do with names. I just used that as a vehicle for articulating the problem. The view approach for queries is workable, at least for queries. Thanks for the input on that and the idea to replicate the various aliases in the view! I

[GENERAL] Can column name aliases be supported?

2012-08-22 Thread Gauthier, Dave
Here's the problem I have a table with a column called "last_name". I have one customer who likes to articulate queries and updates for this using column name "last_name" (no problem there) but another who likes to call it "lname" and yet another who likes to call it "surname".So 3 dif

[GENERAL] Passing master tag around in a multi-site master-slave system

2012-06-13 Thread Gauthier, Dave
Here's the problem... Five sites, one DB, all 5 sites have read/write to the DB. If one site goes down, the other 4 should be able to continue to work with the DB (read and write). When the dead site comes back on line, it ought to be able to rejoin the group. If one site become isolated (n

[GENERAL] How to get user privs on a table using select

2012-06-06 Thread Gauthier, Dave
Hi: Inside a perl/dbi script, I want to determine which privs (select, insert, update, delete, ...) user 'foo' has on table 'footable'. There must be metadata tables or a view that has this.

[GENERAL] db alias

2012-06-05 Thread Gauthier, Dave
Hi: I think I know the answer to this, but the desire/need is great enough to get confirmation here. Is there a way to alias a db name for purposes of redirecting connections? For example, you have 2 DBs, DBX and DBY. The users always connect to a DB alias called "USEDB". USEDB points to D

[GENERAL] maybe incorrect regexp_replace behavior in v8.3.4 ?

2012-05-16 Thread Gauthier, Dave
Hi: bi_hsx_a0_latest=# select regexp_replace('xxx','^xxx$','abc'); regexp_replace abc (1 row) expected behavior because there's a match bi_hsx_a0_latest=# select regexp_replace('xxx','^xxxy$','abc'); regexp_replace xxx (1 row) expected because there is no match

[GENERAL] privs drop after alter table

2012-05-03 Thread Gauthier, Dave
v8.3.4 on linux After this.. alter table fred alter column wilma set default 'dino'; ...it appeared that a user that had insert,delete,update privs lost them. I regranded and things went back to normal. Is it correct for those privs to be dropped in this case? If so, why (just curious). Thank

[GENERAL] regexp operator for array element compares needed

2012-04-12 Thread Gauthier, Dave
Hi: v8.3.4 on linux In plpgsql, I have something like this... if ((string_to_array(check_values_text,',') <@ string_to_array((select permitted_values from bi_constraints where bicolumn = 'fivr'),',')) = 'f') It's just testing all the values in the check_values_text csv are in permitted_values

Re: [GENERAL] v8.3.4 metadata changes while users active

2012-04-05 Thread Gauthier, Dave
I'll be running this as "postgres" Thanks for the help. Hope others may find this useful. -Original Message- From: Bosco Rama [mailto:postg...@boscorama.com] Sent: Thursday, April 05, 2012 12:04 PM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL]

Re: [GENERAL] v8.3.4 metadata changes while users active

2012-04-05 Thread Gauthier, Dave
uot;pg_ctl kill TERM " to do this) Make changes as the DBA Then... alter role selectuser connection limit -1; alter role moduser connection limit -1; Done ! Correct? -Original Message- From: Bosco Rama [mailto:postg...@boscorama.com] Sent: Thursday, April 05, 2012 11:27 AM To: Ga

Re: [GENERAL] v8.3.4 metadata changes while users active

2012-04-04 Thread Gauthier, Dave
adata changes while users active On 04/04/2012 09:26 PM, Gauthier, Dave wrote: > v8.3.4 on linux > > Here's the problem... > > I need toboot them off and prevent them from getting back in so that I > can make the changes, then re-enable them. There are 2 users, lets call > them

[GENERAL] v8.3.4 metadata changes while users active

2012-04-04 Thread Gauthier, Dave
v8.3.4 on linux Here's the problem... I have to make some metadata changes, add columns to a table, add constraints, drop a view, recreate it. I used to be able to do this by booting users off, and then quickly make the changes before they get back in. They now have software that seems to con

Re: [GENERAL] "OLD used in query that is not in a rule"

2012-03-26 Thread Gauthier, Dave
OK, and understood. And yes, I thought it was a global. Thanks Tom. -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Monday, March 26, 2012 10:52 AM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] "OLD used in query that is not in a

[GENERAL] "OLD used in query that is not in a rule"

2012-03-26 Thread Gauthier, Dave
I get... "OLD used in query that is not in a rule" when trying to ref, for example, OLD.tblcol1, from inside a stored procedure. Is this saying you cannot use OLD.* (or NEW.* I suppose) unless it's from within a trigger function (returns type "trigger")? If so, is there some way to tap this in

[GENERAL] Is record handle available to a check constraint stored procedure call?

2012-03-22 Thread Gauthier, Dave
v8.3.4 on Linux I have a check constraint on a column. The constraint decides pass/fail based on the returned status of a stored procedure call that returns either "OK" or "NO". So when the stored procedure is called, there's a living attempt to insert or update a record. Question: Is there

Re: [GENERAL] Preventing access temporarily.

2012-01-26 Thread Gauthier, Dave
. -Original Message- From: Scott Marlowe [mailto:scott.marl...@gmail.com] Sent: Thursday, January 26, 2012 5:39 PM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Preventing access temporarily. On Thu, Jan 26, 2012 at 3:05 PM, Gauthier, Dave wrote: > PG V9.0.

[GENERAL] Preventing access temporarily.

2012-01-26 Thread Gauthier, Dave
PG V9.0.1 on Linux I want to temporarily prevent users from connecting to a DB, let the existing connections finish, , re-enable connections. What's the best way to do that? Thanks in Advance

[GENERAL] add constraint deferrable, syntax error

2012-01-11 Thread Gauthier, Dave
Why am I getting this? xdb=# alter table templates add constraint manager_uid_is_invalid check ((constraint_checker('manager',manager,null,null)) = 'OK') DEFERRABLE ; ERROR: syntax error at or near "DEFERRABLE" LINE 1: ...int_checker('manager',manager,null,null)) = 'OK') DEFERRABLE... v8.3.4 on

Re: [GENERAL] making "\pset pager off" the default

2011-12-07 Thread Gauthier, Dave
Like a charm. Thanks! -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Wednesday, December 07, 2011 9:57 AM To: pgsql-general@postgresql.org Cc: Gauthier, Dave Subject: Re: [GENERAL] making "\pset pager off" the default On Wednesday, December 07,

[GENERAL] making "\pset pager off" the default

2011-12-07 Thread Gauthier, Dave
Hi: How can I make "pager off" the default when running psql ? v8.3.4 and v9.0.1 on linux.

[GENERAL] plpgsql question

2011-12-05 Thread Gauthier, Dave
v8.3.4 on linux Is there a way to set the query used in a "for rec in (query) loop -> end loop" be a variable? Example if (foo = 'whatever') then sqlstmt := "select x,y,z ..."; else sqlstmt := "select a,b,c ..."; end if ; for therec in sqlstmt loop ... end loop; Thanks in Advance f

[GENERAL] \dT+ does not give elements ?

2011-12-02 Thread Gauthier, Dave
Hi: SImple/quick (hopefully) thedb=# \dT+ List of data types Schema | Name| Internal name | Size | Elements | Description +---+---+---+--+- public | one_string_rec| one_string_rec

Re: [GENERAL] recursive inner trigger call

2011-12-01 Thread Gauthier, Dave
You set the trigger to fire off whenever ed_expore.bv is inserted or updated. Then the trigger updates ed_explore.bv, which fires the update trigger again, etc... . Infinite loop. No? Maybe you just want to use a before trigger to set that value before the insert, then you wouldn't need the

Re: [GENERAL] pg_dump of a v8.3.4 -> v9.0.1

2011-11-23 Thread Gauthier, Dave
: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] pg_dump of a v8.3.4 -> v9.0.1 On 11/23/2011 08:08 AM, Gauthier, Dave wrote: > Hi: > > I have a pg_dump pf a v8.3.4 DB that I would like to bring into a v9.0.1 > PG instance. What is the best way to do this? Note, t

[GENERAL] pg_dump of a v8.3.4 -> v9.0.1

2011-11-23 Thread Gauthier, Dave
Hi: I have a pg_dump pf a v8.3.4 DB that I would like to bring into a v9.0.1 PG instance. What is the best way to do this? Note, the dump file is too big to fit into an editor, but I could sed it if need be. Thanks.

Re: [GENERAL] How to use like with a list

2011-11-18 Thread Gauthier, Dave
12:37 PM, Gauthier, Dave wrote: > bi_dev=# select name from test where name ~ '^(' || replace('jo,mo,do,fo', > ',', '|') || ')l'; > ERROR: argument of WHERE must be type boolean, not type text ah, needs () around the right side of the ~

Re: [GENERAL] How to use like with a list

2011-11-18 Thread Gauthier, Dave
The example was a general case. It won't be jo and mo and fo. In fact, the values will be stored in a csv perl scalar. If you know perl... $str = "jo,mo,do,fo"; Using DBI, I need to "prepare" a query that will accept a string like the one above. So... select name,age,weight from people_ta

[GENERAL] How to use like with a list

2011-11-18 Thread Gauthier, Dave
Hi: How can I search on a csv list of values using "like" where each value is to be appended with a wildcarded string? Example: list = 'jo,mo,do,fo' I want to pull all names from a table with name like.. 'jol%' or 'mol%' or'dol%' or 'sol%' would match "jolly, molly, moleman,dollface, solarboy

[GENERAL] SIGNALNAME in "pg_ctl kill"

2011-11-09 Thread Gauthier, Dave
pg_ctl --help lists the various SIGNALNAME options to use with "pg_ctk kill"... Allowed signal names for kill: HUP INT QUIT ABRT TERM USR1 USR2 I can't find a description of what each does. I'd like to abort just the procpid I enter, but using ABRT has a tendancy to kill lots of other stuff t

Re: [GENERAL] connections and cpu consumption

2011-11-09 Thread Gauthier, Dave
11 2:58 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] connections and cpu consumption On 11/09/11 11:35 AM, Gauthier, Dave wrote: > A... so if the script that has the connection open would only terminate > the transaction, then vacuum wouldn't get behind? > > I act

Re: [GENERAL] connections and cpu consumption

2011-11-09 Thread Gauthier, Dave
g. Thanks! -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: Wednesday, November 09, 2011 2:21 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] connections and cpu consumption On 11/09/11 10:35 AM

[GENERAL] connections and cpu consumption

2011-11-09 Thread Gauthier, Dave
Hi: PG v4.8.3 on Linux I'm using "selcet procpid,current_query from pg_stat_activity" to monitor activity during times when "top" is showing many PG procs with very high cpu usage numbers (all cores at or above 90%). Some of these are procs that map to PG connections with current_query = . W

Re: [GENERAL] adding a column takes FOREVER!

2011-11-01 Thread Gauthier, Dave
I think you need exclusive access to the table in order to add columns (I'll stand/sit corrected if the more experienced responders say different). I've found that you have to either wait for them to get off or kill them first (as in pg_ctl kill ABRT). From: pgsql-general-ow...@postgresql.or

[GENERAL] Can I track DB connections through a generic acct on the basis of linux idsid

2011-10-31 Thread Gauthier, Dave
Hi: PG v8.3.4 on linux. Server is at one corporate site, half the DB users are at that site, the other half are at a different site 2 time zones away. Users from both sites access the DB through the same, generic postgres user accout that has select/insert/update/delete only. And almost all

[GENERAL] does reindex need exclusive table access?

2011-10-31 Thread Gauthier, Dave
v8.3.4 on linux. Does "reindex table foo" require no other users accessing the foo table? Trying to understand why this seems to be stalled when I attempt this on a live DB (if runs fine/fast on a copy of the DB that no one uses). Should I run this inside a transaction? Thanks in Advance !

[GENERAL] matching against a list of regexp?

2011-10-27 Thread Gauthier, Dave
Hi: I need to be able to select all records with a col value that matches any of a list of regexp. Sort of like... select a,b,c from foo where d ~ ('^xyz','blah','shrug$'); Does anyone know the right syntax for this? Thanks!

Re: [GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Gauthier, Dave
, 2011 10:23 PM To: Gauthier, Dave Cc: Merlin Moncure; pgsql-general@postgresql.org Subject: Re: [GENERAL] Reading PG data from MySQL stored procedure On 10/21/2011 03:56 AM, Gauthier, Dave wrote: > The software system they are being forced to use gives them the ability to > send queries to a

Re: [GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Gauthier, Dave
ay, October 20, 2011 3:33 PM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Reading PG data from MySQL stored procedure On Thu, Oct 20, 2011 at 2:22 PM, Gauthier, Dave wrote: > Here's a real long shot, but what the heck... > > > > I have a user that&#

[GENERAL] Reading PG data from MySQL stored procedure

2011-10-20 Thread Gauthier, Dave
Here's a real long shot, but what the heck... I have a user that's using a system that gives him a single MySQL DB handle to work with. He must get all his data through this handle. He wants some of my PG based data. Not only can't he open a new DB handle to my PG DB, but he cannot even run

[GENERAL] live metadata changes v8.3.4

2011-09-27 Thread Gauthier, Dave
Hi: How does one make a metadata change to a DB that's actively being used. Specifically, I want to drop a view, drop some columns from a table that's used in the view, recreate the view without those columns. In the past, I've resorted to connecting as a super user, running "select procpid f

Re: [GENERAL] Deleting one of 2 identical records

2011-09-06 Thread Gauthier, Dave
The identification and deleting of the records using ctids seems to have worked fine. Thanks ! -Original Message- From: Andy Colson [mailto:a...@squeakycode.net] Sent: Tuesday, September 06, 2011 1:55 PM To: Thom Brown Cc: Gauthier, Dave; pgsql-general@postgresql.org Subject: Re

[GENERAL] Deleting one of 2 identical records

2011-09-06 Thread Gauthier, Dave
Hi: If I have a table that has 2 records which are identical with regard to all their column values, is there a way to delete one of them, leaving one remaining? Is there some unique record_id key of some sort I can use for somethign like this? Thanks in Advance!

[GENERAL] init script or procedure

2011-08-24 Thread Gauthier, Dave
Does PG support the use of an init script or procedure? I'm looking for something that'll run unconditionally every time someone makes a DB connection. This script will create a temp table and stuff some data in it for general use within that session. Thanks in Advance for any help!

Re: [GENERAL] Need linux uid in pg-psql

2011-08-19 Thread Gauthier, Dave
M To: Alan Hodgson Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Need linux uid in pg-psql Alan Hodgson writes: > On August 19, 2011 07:01:33 AM Gauthier, Dave wrote: >> Is there a way to get the linux idsid of a user, even for a remote network >> connection? > There&#

[GENERAL] Need linux uid in pg-psql

2011-08-19 Thread Gauthier, Dave
Is there a way to get the linux idsid of a user, even for a remote network connection? If not, is there a way to capture this somehow when the original connection is made and maybe stuff it in a temp table or something using whatever means (a trigger-like mechanism? ) ? Is there a script/func

[GENERAL] Interesting article, Facebook woes using MySQL

2011-07-11 Thread Gauthier, Dave
http://gigaom.com/cloud/facebook-trapped-in-mysql-fate-worse-than-death/ How would PG stack up in a usage situation like this?

Re: [GENERAL] Constraint to ensure value does NOT exist in another table?

2011-06-16 Thread Gauthier, Dave
is static. -Original Message- From: Peter Geoghegan [mailto:pe...@2ndquadrant.com] Sent: Thursday, June 16, 2011 9:56 AM To: Gauthier, Dave Cc: Igor Neyman; Mike Christensen; pgsql-general@postgresql.org Subject: Re: [GENERAL] Constraint to ensure value does NOT exist in another table? On 16 Ju

Re: [GENERAL] Constraint to ensure value does NOT exist in another table?

2011-06-16 Thread Gauthier, Dave
I've dealt with something similar by using a check constraint and a stored procedure. The check constraint calls a stored procedure, passing it (in your case) the key you want to make sure doesn't exist in some other table. The stored procedures queries that other table for the key and passes

[GENERAL] Passing parameters into an in-line psql invocation

2011-06-02 Thread Gauthier, Dave
Hi: I'd like to pass a parameter into an inline psql call that itself calls an sql script, something like... psql mydb -c "\i thesqlscript foo" Where"foo" is the value I want to pass in. Just as good would be the ability to sniff out an environment variable from within the sql script ("thesql

Re: [GENERAL] copy record?

2011-05-26 Thread Gauthier, Dave
; insert into maintable (select * from foo); From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Gauthier, Dave Sent: Thursday, May 26, 2011 4:24 PM To: pgsql-general@postgresql.org Subject: [GENERAL] copy record? Hi: >From within a perl/DBI scr

[GENERAL] copy record?

2011-05-26 Thread Gauthier, Dave
Hi: >From within a perl/DBI script, I want to be able to make a copy of a record in >a table, changing only the value of the primary key. I don't know in advance >what all the columns are, just the table name. I suppose I could pull the column names for the table from the metadata, query the

[GENERAL] Suppress "INSERT x x" messages

2011-05-16 Thread Gauthier, Dave
Hi: Is there a way to suppress the "INSERT x x" and "DELETE y" (etc...) messages in psql? Thanks in advance

Re: [GENERAL] insert order question

2011-05-12 Thread Gauthier, Dave
t statements in the order I desire. Thanks -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Thursday, May 12, 2011 4:06 PM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] insert order question "Gauthier, Dave" writes: > Does...

[GENERAL] insert order question

2011-05-12 Thread Gauthier, Dave
Hi: Does... insert into mytbl (col1) values ('a'),('b'),('c'); ... insert records 'a','b','c' in that order while... insert into mytbl (col1) values ('c'),('b'),('a'); ... insert the records in the opposite order? The order matters because there are triggers on t

[GENERAL] Adding a default value to a column after it exists

2011-04-13 Thread Gauthier, Dave
Is there a way to add a default value definition to an existing column? Something like an "alter table... alter column... default 'foo'". I thought of a clumsy way to do this... create a temp column, set it's value to that of the column to be altered, drop the column to be altered, redefine it

Re: [GENERAL] Access to NEW.column outside of a trigger function.

2011-03-31 Thread Gauthier, Dave
igger sensitive to this deferral is not something that I wanted to devote a lot of time to. It just seemed more natural to keep this as a check constraint. -Original Message- From: Jerry Sievers [mailto:gsiever...@comcast.net] Sent: Thursday, March 31, 2011 4:14 PM To: Gauthier, Dave Cc:

  1   2   3   4   >