Re: [GENERAL] Cursor Example Needed

2013-10-29 Thread Perry Smith
On Oct 28, 2013, at 6:50 PM, Adrian Klaver wrote: > On 10/28/2013 04:36 PM, Perry Smith wrote: >> >> On Oct 28, 2013, at 6:13 PM, John R Pierce wrote: >> >>> On 10/28/2013 3:58 PM, Adrian Klaver wrote: >>>> The docs do a good job of illustrating: >

Re: [GENERAL] Cursor Example Needed

2013-10-28 Thread Perry Smith
On Oct 28, 2013, at 6:13 PM, John R Pierce wrote: > On 10/28/2013 3:58 PM, Adrian Klaver wrote: >> The docs do a good job of illustrating: >> >> http://www.postgresql.org/docs/9.3/interactive/plpgsql-cursors.html > > thats for cursors created within a plpgsql function. > > I think what the OP

Re: [GENERAL] Cursor Example Needed

2013-10-28 Thread Perry Smith
On Oct 28, 2013, at 5:21 PM, Adrian Klaver wrote: > On 10/28/2013 02:27 PM, Perry Smith wrote: >> >> On Oct 28, 2013, at 4:11 PM, Merlin Moncure wrote: >> >>> On Mon, Oct 28, 2013 at 4:06 PM, Perry Smith wrote: >>>> When I e

Re: [GENERAL] Cursor Example Needed

2013-10-28 Thread Perry Smith
On Oct 28, 2013, at 4:11 PM, Merlin Moncure wrote: > On Mon, Oct 28, 2013 at 4:06 PM, Perry Smith wrote: >> When I execute the SELECT statement directly I get: >> >> psql:table.sql:28: out of memory for query result > > psql will do this automaticall

[GENERAL] Cursor Example Needed

2013-10-28 Thread Perry Smith
When I execute the SELECT statement directly I get: psql:table.sql:28: out of memory for query result I've read the way around this is to use cursors. So I read and I see that I can use a FOR statement but I need that inside a function. So far, I've come up with this: > CREATE OR REPLACE FUNC

Re: [GENERAL] "Pretend" update

2013-10-01 Thread Perry Smith
On Oct 1, 2013, at 12:23 PM, Adrian Klaver wrote: > On 10/01/2013 10:16 AM, Perry Smith wrote: >> With "make" I can do "make -n" and it just tells me what it would do but >> doesn't actually do anything. >> >> How could I do that with SQL?

[GENERAL] "Pretend" update

2013-10-01 Thread Perry Smith
With "make" I can do "make -n" and it just tells me what it would do but doesn't actually do anything. How could I do that with SQL? I want to write a really complicated (for me) SQL UPDATE statement. I'm sure I won't get it right the first time. Is there an easy way to not really make the c

[GENERAL] Immediate Constraints

2013-08-15 Thread Perry Smith
The direct question is: what is the advantage of an immediate constraint? My habit is to add constraints to my databases and my first lesson was to make them "deferrable". But a recent fight with pg_restore taught me that to do a pg_restore that is complex, you need to defer the constraints. I

Re: [GENERAL] TOC errors

2013-08-02 Thread Perry Smith
On Aug 2, 2013, at 12:29 PM, Perry Smith wrote: > I am doing a restore: > > pg_restore --no-owner -L /tmp/db.list --single-transaction > --dbname=condor3_production $DBFILE > > and I get this error: > > pg_restore: [archiver (db)] Error while PROCESSING TOC: >

[GENERAL] TOC errors

2013-08-02 Thread Perry Smith
I am doing a restore: pg_restore --no-owner -L /tmp/db.list --single-transaction --dbname=condor3_production $DBFILE and I get this error: pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 2056; 0 35202 TABLE DATA adv_ptf_release_maps pedz

[GENERAL] NOTIFY channel

2013-04-26 Thread Perry Smith
Hi, I'm curious what the design assumptions of the LISTEN / NOTIFY are. For example, would it work to have a thousand LISTEN channels open at the same time or would that be abusing the assumptions that were made? In short, I'm trying to understand if I need a few central LISTEN / NOTIFY chann

Re: [GENERAL] Testing Technique when using a DB

2013-03-12 Thread Perry Smith
restore or loading an SQL file is you can have various files for different tests. On Mar 12, 2013, at 10:09 PM, Joe Van Dyk wrote: > On Mar 12, 2013, at 8:42 AM, Perry Smith wrote: > >> I tried posting this from Google Groups but I did not see it come through >> after an hou

[GENERAL] Testing Technique when using a DB

2013-03-12 Thread Perry Smith
I tried posting this from Google Groups but I did not see it come through after an hour so this may be a duplicate message for some. The current testing technique for things like Ruby On Rails has three choices but all of the choices will not work in my case. The first choice is "truncate" whi

Re: [GENERAL] Help me follow...

2012-07-14 Thread Perry Smith
On Jul 14, 2012, at 2:19 PM, Peter Geoghegan wrote: > On 14 July 2012 18:56, Tom Lane wrote: >> I can no longer reproduce a failure when building out-of-tree from a >> tarball on my Fedora 16 box. That's still make 3.82, but Fedora is >> carrying half a dozen patches to the upstream tarball: >>

[GENERAL] Help me follow...

2012-07-14 Thread Perry Smith
I hit "bug 5665". I see threads like this: http://archives.postgresql.org/pgsql-bugs/2011-01/msg00241.php Where / how can I find the diff that went in to fix this? Mostly I'm curious. I can work around the problem but wanted to create a patch file for myself to make deploying to other server

Re: [GENERAL] Help with sql

2012-07-07 Thread Perry Smith
On Jul 6, 2012, at 7:56 PM, Steve Crawford wrote: > On 07/06/2012 02:34 PM, Perry Smith wrote: >> Hi Guys, >> >> This isn't a PostgreSQL specific question but just a SQL question. If this >> is not an appropriate question for this list, please let me know. >

[GENERAL] Help with sql

2012-07-06 Thread Perry Smith
Hi Guys, This isn't a PostgreSQL specific question but just a SQL question. If this is not an appropriate question for this list, please let me know. It is also, perhaps, a really silly question. This query (without the 'explain' keyword) , when executed takes forever and a day: > condor_dev

Re: [GENERAL] Normalize or not?

2011-04-15 Thread Perry Smith
whatever application language you are > using; not rules. > > On Apr 15, 2011, at 8:45, Perry Smith wrote: > >> Mostly, this entire project is for me to learn. What started out as a toy >> has gown into something that about 40 people use each day but it is >> defini

Re: [GENERAL] Normalize or not?

2011-04-15 Thread Perry Smith
search for the > better solution now or whether you should just use the immediately viable > solution until it breaks. > > David J. > > > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Perr

[GENERAL] Normalize or not?

2011-04-14 Thread Perry Smith
on that change the Type of a name is not even being considered. The "Names" and "Types of Associations" tables I think of as a type of constants which will be defined and rarely change. I hope this is reasonably easy to follow. I'm looking forward to your thoughts and c

Re: [GENERAL] unique amount more than one table

2011-04-05 Thread Perry Smith
On Apr 5, 2011, at 5:50 PM, Rob Sargent wrote: > > > On 04/05/2011 04:02 PM, Perry Smith wrote: >> I have five tables each with a "name" field. Due to limitations in my user >> interface, I want a name to be unique amoung these five tables. >> >>

[GENERAL] unique amount more than one table

2011-04-05 Thread Perry Smith
I have five tables each with a "name" field. Due to limitations in my user interface, I want a name to be unique amoung these five tables. I thought I could first create a view with something like: SELECT name, 'table1' as type from table1 UNION ALL SELECT name, 'table2' as type from table2

[GENERAL] tsvector from external files

2009-12-05 Thread Perry Smith
explained with the || operator)... The second approach is to create a large object first but that seems inefficient too. Its also not clear that I can pass a reference to a large object in place of document text either. Thank you, Perry Smith

Re: [GENERAL] I want to search my project source code

2007-10-28 Thread Perry Smith
On Oct 28, 2000, at 9:41 AM, Martin Gainty wrote: Perry- Does cscope support PHP? I don't think so. Exuberant tags suppose a lot of languages but it does not do references (I think) -- just definitions. Thanks for the link M-- - Original Message - From: "Perry Smit

Re: [GENERAL] I want to search my project source code

2007-10-28 Thread Perry Smith
e where is foo defined), then use ctags or etags. There is exuberant ctags here: http://ctags.sourceforge.net/ Perry Smith ( [EMAIL PROTECTED] ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems -

Re: [GENERAL] createdb argument question

2007-10-28 Thread Perry Smith
On Oct 27, 2007, at 3:02 PM, Seneca Cunningham wrote: On Sat, Oct 27, 2007 at 12:56:37PM -0500, Perry Smith wrote: On my Mac systems, this work. On my AIX system it does not. I get: createdb dog -E utf8 createdb: too many command-line arguments (first is "utf8") Try "creat

Re: [GENERAL] createdb argument question

2007-10-27 Thread Perry Smith
On Oct 27, 2007, at 1:41 PM, Michael Glaesemann wrote: On Oct 27, 2007, at 12:56 , Perry Smith wrote: On my Mac systems, this work. On my AIX system it does not. I get: Versions? My AIX is 5.3 close to the latest. Postgres is 8.2.4 I built all of the open source stuff myself using

[GENERAL] createdb argument question

2007-10-27 Thread Perry Smith
For some odd reason, Rails decided to call createdb as: createdb foo_database -E utf8 On my Mac systems, this work. On my AIX system it does not. I get: createdb dog -E utf8 createdb: too many command-line arguments (first is "utf8") Try "createdb --help" for more information. Has anyone els

Re: [GENERAL] pg_dump of only the structure from a client such as ruby

2007-08-05 Thread Perry Smith
On Aug 5, 2007, at 7:37 PM, Tom Lane wrote: PS: *please* see if you can get them to take out the usage of pg_dump's -i switch. Having code invoke that blindly borders on criminal negligence. http://dev.rubyonrails.org/ticket/9198 Thank you again. Take care, Perry Smith ( [EMAIL PROT

Re: [GENERAL] pg_dump of only the structure from a client such as ruby

2007-08-05 Thread Perry Smith
On Aug 5, 2007, at 7:37 PM, Tom Lane wrote: Perry Smith <[EMAIL PROTECTED]> writes: I find it odd that you are resistant to the idea. To me, the advantages are clear if it can be done without a tremendous amount of work. Well, it can't. pg_dump is an enormously complicated and

Re: [GENERAL] pg_dump of only the structure from a client such as ruby

2007-08-05 Thread Perry Smith
On Aug 5, 2007, at 6:07 PM, Michael Glaesemann wrote: On Aug 5, 2007, at 16:31 , Perry Smith wrote: I'm trying to help out the rails people. Currently they have "rake" scripts which call pg_dump, dropdb, createdb, and psql. It would be nicer if this could be done

[GENERAL] pg_dump of only the structure from a client such as ruby

2007-08-05 Thread Perry Smith
scared and ran away. Perry Smith ( [EMAIL PROTECTED] ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems

Re: [GENERAL] regexp_replace

2007-07-24 Thread Perry Smith
lags parameter is an optional text string containing zero or more single-letter flags that change the function’s behavior. Flag i specifies case-insensitive matching, while flag g specifies replacement of each matching substring rather than only the first one. Perry Smith ( [EMAIL PROTECTED]

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Perry Smith
On Jul 23, 2007, at 8:32 AM, Raymond O'Donnell wrote: On 23/07/2007 14:22, Perry Smith wrote: First, you can specify a password with -P (I think --password works also). psql --help for optins. -P doesn't specify the password - see below: C:\Documents and Settings\rod>psql -

Re: [GENERAL] Need help with bash script and postgresql

2007-07-23 Thread Perry Smith
First, you can specify a password with -P (I think --password works also). psql --help for optins. Usually the DB defaults to trusting everything local (if I'm not mistaken -- someone please correct me if I'm over simplifying). As far as getting your data into the database, I would look at

Re: [GENERAL] Foreign key constraint question

2007-07-22 Thread Perry Smith
be true but I didn't know that when I started down this road). Thank you all for helping, Perry Smith ( [EMAIL PROTECTED] ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems ---(end of b

Re: [GENERAL] Foreign key constraint question

2007-07-20 Thread Perry Smith
On Jul 20, 2007, at 7:01 PM, Jeff Davis wrote: On Fri, 2007-07-20 at 09:27 -0500, Perry Smith wrote: On Jul 20, 2007, at 9:06 AM, Michael Fuhr wrote: On Fri, Jul 20, 2007 at 08:57:25AM -0500, Perry Smith wrote: I want to do something like this: ALTER TABLE companies ADD CONSTRAINT

Re: [GENERAL] Foreign key constraint question

2007-07-20 Thread Perry Smith
On Jul 20, 2007, at 9:06 AM, Michael Fuhr wrote: On Fri, Jul 20, 2007 at 08:57:25AM -0500, Perry Smith wrote: I want to do something like this: ALTER TABLE companies ADD CONSTRAINT fk_companies_item_id FOREIGN KEY (item_id, 'Company') REFERENCES item_bas

[GENERAL] Foreign key constraint question

2007-07-20 Thread Perry Smith
ot;Company" but that seems like a waste. I tried the above and I got a syntax error. Any suggestions? Thank you, Perry Smith ( [EMAIL PROTECTED] ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems

[GENERAL] Concurrency Question

2007-07-16 Thread Perry Smith
I'm trying to clearly understand how foreign key constraints work. I still need some help. The PostgreSQL documentation says: ROW EXCLUSIVE Conflicts with the SHARE, SHARE ROW EXCLUSIVE, EXCLUSIVE, and ACCESS EXCLUSIVE lock modes. The commands UPDATE, DELETE, and INSERT acquire this lock

Re: [GENERAL] deferred check constraints

2007-07-16 Thread Perry Smith
On Jul 16, 2007, at 3:08 PM, Gregory Stark wrote: "Perry Smith" <[EMAIL PROTECTED]> writes: Right now, it would be nice if I could get a check constraint to be deferred. Its a long story. I want a circular constraint. The way things are set up right now, it would be

[GENERAL] deferred check constraints

2007-07-16 Thread Perry Smith
Right now, it would be nice if I could get a check constraint to be deferred. Its a long story. I want a circular constraint. The way things are set up right now, it would be easy if I could defer my check constraint. I'm doing a polymorphic relation. One direction is a simple referenc

Re: [GENERAL] Database Insertion commitment

2007-07-09 Thread Perry Smith
gger should see the data (according to 34.2). "Network delays" does not seem like a valid reason this is not working. My thought is to not use triggers but to use rules. These operate inside the db engine. I hope this helps, Perry Smith ( [EMAIL PROTECTED] ) Ease Software, Inc.

Re: [GENERAL] CASE in ORDER BY clause

2007-07-07 Thread Perry Smith
On Jul 7, 2007, at 2:15 PM, Tom Lane wrote: Perry Smith <[EMAIL PROTECTED]> writes: On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote: # select start_date from show_date # order by # case when start_date > CURRENT_DATE then start_date end desc, # case when s

Re: [GENERAL] CASE in ORDER BY clause

2007-07-07 Thread Perry Smith
On Fri, Jul 06, 2007 at 08:02:54PM +0400, Viatcheslav Kalinin wrote: # select start_date from show_date # order by # case when start_date > CURRENT_DATE then start_date end desc, # case when start_date <= CURRENT_DATE then start_date end asc; I am very novice, but that looks odd to me. I would

Re: [GENERAL] ssl enabling of postgres on Mac OS X

2007-07-06 Thread Perry Smith
On Jul 6, 2007, at 9:57 PM, Michael Hogarth wrote: Hi folks. I successfully compiled/built pg 8.1.9 using --with-openssl on a Mac. I modified the startup config files to enable ssl. Server starts without problems, but when I try to require SSL from pgAdminIII, I get "server does not support S

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Perry Smith
to better work with "real" databases is very possible. If nothing else, as extensions to Rails. Perry Smith ( [EMAIL PROTECTED] ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Perry Smith
db where it would be more efficient. I replied to David as well. You both have similar ideas. I will work on this over the weekend and I hope I can give an update when I'm done. Thank you very much. You have helped me a lot. Perry Smith ( [EMAIL PROTECTED] ) Ease Software, Inc. ( http

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Perry Smith
On Jul 6, 2007, at 8:01 AM, David Fetter wrote: On Thu, Jul 05, 2007 at 09:56:12PM -0500, Perry Smith wrote: I am doing a project using Ruby On Rails with PostgreSQL as the database. I have not seen the term polymorphic used with databases except with Rails so I will quickly describe it

Re: [GENERAL] Polymorphic delete help needed

2007-07-06 Thread Perry Smith
On Jul 6, 2007, at 2:31 AM, PFC wrote: I am doing a project using Ruby On Rails with PostgreSQL as the database. I have not seen the term polymorphic used with databases except with Rails so I will quickly describe it. Instead of holding just an id as a foreign key, the record holds a "type

[GENERAL] Polymorphic delete help needed

2007-07-05 Thread Perry Smith
properly rolled back? Thank you for your help, Perry Smith ( [EMAIL PROTECTED] ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems