Re: [GENERAL] postgres connection problem via python pg DBI

2008-06-05 Thread Colin Wetherbee
Dan Joo wrote: db=pg.connect('aqdev','localhost',5432,None,None,'postgres',None) From the commandline the connection works great, but from a cgi-script it barfs with the following message: *InternalError*: could not create socket: Permission denied My (obvious, granted) guess is that you're

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-25 Thread Colin Wetherbee
Rhys Stewart wrote: The example I provided earlier was a very simplified model of the table I'm working with after a self join. The table in question contains geographic data (linestrings) PostGIS LINESTRINGs? and I have written a function to return a textual representation Like

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Colin Wetherbee
Roberts, Jon wrote: On 23/04/2008 20:33, Roberts, Jon wrote: create table ugly [...snip...] create or replace function fn_ugly() returns setof ugly as [...snip...] create temporary table temp_ugly [...snip...] select * from fn_ugly(); [...snip...] Heh heh - I think we get the point!

[GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Greetings. I have a question regarding storing computed values. Essentially, it's a question about caching, and I'm willing to implement a cache on the client side or using pg_memcache, but I wonder if I can do this in a PostgreSQL table, instead? The background is that I'm using PostGIS

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Richard Broersma wrote: On Mon, Apr 21, 2008 at 10:34 AM, Colin Wetherbee [EMAIL PROTECTED] wrote: I would like to have a table that contains a connection for each distinct pair of points (point1 to point2 is the same as point2 to point1). This table would then be automatically updated every

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Colin Wetherbee wrote: SELECT connect(p_start.location, p_end.location) FROM foo JOIN points AS p_start ON foo.point_id_start = points.point_id JOIN points AS p_end ON foo.point_id_end = points.point_id WHERE foo.id = 8192; As I didn't test this code, my syntax was slightly incorrect

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Richard Broersma wrote: On Mon, Apr 21, 2008 at 11:02 AM, Colin Wetherbee [EMAIL PROTECTED] wrote: Let's say my points table looks like this: point_id | location -+-- 1 | 0101... -- some PostGIS geometry string 2 | 0101... And, my foo table, which

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Colin Wetherbee wrote: Richard Broersma wrote: On Mon, Apr 21, 2008 at 11:02 AM, Colin Wetherbee [EMAIL PROTECTED] wrote: Let's say my points table looks like this: point_id | location -+-- 1 | 0101... -- some PostGIS geometry string 2 | 0101

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Richard Broersma wrote: On Mon, Apr 21, 2008 at 11:19 AM, Colin Wetherbee [EMAIL PROTECTED] wrote: My impression of functional indexes is that they're useful mostly in WHERE queries, like the following. SELECT foo, bar, baz FROM some_table WHERE lower(foo) = 'qux'; In this case, the index

Re: [GENERAL] Storing computed values

2008-04-21 Thread Colin Wetherbee
Richard Broersma wrote: On Mon, Apr 21, 2008 at 12:24 PM, Colin Wetherbee [EMAIL PROTECTED] wrote: Right, but the problem I see is that my locations are not actually stored in foo. Since many rows of foo can reference the same location, the locations are stored in a separate table

[GENERAL] Suggestion for psql command interpretation

2008-04-15 Thread Colin Wetherbee
I just made a typo in psql, and it resulted in something I wouldn't have expected. js=# \timimng Showing only tuples. js=# \t Tuples only is off. I also wouldn't have expected \timimng to have been interpreted as \timing, which I tried to type in the first place, but perhaps a typo like

Re: [GENERAL] Suggestion for psql command interpretation

2008-04-15 Thread Colin Wetherbee
Colin Wetherbee wrote: I just made a typo in psql, and it resulted in something I wouldn't have expected. Oh, um, this was in the 8.3.1 psql. Colin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [GENERAL] Suggestion for psql command interpretation

2008-04-15 Thread Colin Wetherbee
Tom Lane wrote: Colin Wetherbee [EMAIL PROTECTED] writes: I just made a typo in psql, and it resulted in something I wouldn't have expected. js=# \timimng Showing only tuples. This is related to the discussion about whether to require a space between a backslash command name and its

Re: [GENERAL] Suggestion for psql command interpretation

2008-04-15 Thread Colin Wetherbee
Tom Lane wrote: Colin Wetherbee [EMAIL PROTECTED] writes: I just thought I'd report it here in case it wasn't supposed to happen, but from what you say, it seems like it's a feature. Well, it's more of a historical hangover. Personally I'd not have much problem with breaking backward

Re: [GENERAL] Most Occurring Value

2008-04-07 Thread Colin Wetherbee
Mike Ginsburg wrote: There is probably a really simple solution for this problem, but for the life of me I can't see to think of it. I have three tables --contains u/p for all users in the site TABLE users (user_id INT primary key, username VARCHAR(50), password TEXT) --list of all possible

Re: [GENERAL] Autograph Annoucement (ERD Tool)

2008-04-03 Thread Colin Wetherbee
Colin Fox wrote: There were a number of people asking about ERD tools here a while ago, so I decided to publish one that I've put together. It's called Autograph, and you can find it on the pg foundry: http://pgfoundry.org/projects/autograph/ Looks handy. I'd like to give it a try.

Re: [GENERAL] Autograph Annoucement (ERD Tool)

2008-04-03 Thread Colin Wetherbee
Colin Wetherbee wrote: Colin Fox wrote: Autograph is really just an XSL stylesheet, used in combination with graphviz, xsltproc, convert and the downloadXml.py program from Scott Kirkwood's xmltoddl package. I'm familiar with graphviz and xsltproc, but what is convert? Is this Imagemagick's

Re: [GENERAL] Autograph Annoucement (ERD Tool)

2008-04-03 Thread Colin Wetherbee
Colin Fox wrote: Colin Wetherbee wrote: Colin Wetherbee wrote: Colin Fox wrote: Autograph is really just an XSL stylesheet, used in combination with graphviz, xsltproc, convert and the downloadXml.py program from Scott Kirkwood's xmltoddl package. I'm familiar with graphviz and xsltproc

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-03 Thread Colin Wetherbee
Leif B. Kristensen wrote: On Wednesday 2. April 2008, Tomasz Ostrowski wrote: Go for it. Even 64 (I like round numbers) would not be too much. Geek test: Do you find the above statement odd? Yes: 0, No: +10. (Sorry for being massively off-topic :-)) I had the same thought. ;) Colin --

Re: [GENERAL] Autograph Annoucement (ERD Tool)

2008-04-03 Thread Colin Wetherbee
Colin Wetherbee wrote: Also, is there a way to forcibly remove tables and views from the output? In all.xml, I only list the tables I want, but in addition to those, I also get my PostGIS tables and all the views I've created within the schema. And... If I set the tablemode to detailed

Re: [GENERAL] pg_dump ignoring without oids

2008-04-03 Thread Colin Wetherbee
Chris Velevitch wrote: I'm transferring a database from 7.4.7 to 7.4.13 using 8.1.11 utilities and pg_dump leaves out the without oids clause in the create table commands. I've confirmed the original tables are created without oids by using pgadmin3 v1.8.2. How do I get the table created

Re: [GENERAL] referencing column aliases in select list

2008-04-03 Thread Colin Wetherbee
Seb wrote: --cut here---start- SELECT table1.col1 - table2.col1 AS diff1, table1.col2 + table2.col2 AS sum1, sum1 - diff1 FROM table1 INNER JOIN table2 ON (table1.id = table2.id) --cut here---end---

Re: [GENERAL] [pgsql-general] Daily digest v1.8030 (22 messages)

2008-03-31 Thread Colin Wetherbee
[EMAIL PROTECTED] wrote: Message Digest Volume 1 : Issue 8030 : index Format Messages in this Issue: 200803/1324: Re: casting from integer to boolean 200803/1325: Re: casting from integer to boolean 200803/1326: Re: casting from integer to boolean 200803/1327: Re: Survey:

Re: [GENERAL] [pgsql-general] Daily digest v1.8030 (22 messages)

2008-03-31 Thread Colin Wetherbee
Tom Lane wrote: Brett Hoerner [EMAIL PROTECTED] writes: On Mon, Mar 31, 2008 at 10:54 AM, Colin Wetherbee [EMAIL PROTECTED] wrote: I received eight of these unwanted digests last night and early this morning, after never seeing them before. Is this a new configuration change that I need to go

Re: [GENERAL] table of US states' neighbours

2008-03-28 Thread Colin Wetherbee
Richard Broersma wrote: On Thu, Mar 27, 2008 at 11:33 PM, Michael Fuhr [EMAIL PROTECTED] wrote: Or a few minutes with shapefiles and PostGIS, using the latter's spatial functions to identify geometries that touch. Below are the results of such an operation; I haven't verified the entire

Re: [GENERAL] table of US states' neighbours

2008-03-27 Thread Colin Wetherbee
brian wrote: I'd like to add a table, state_neighbours, which joins each state with all of its neighbour states. Does anyone know where I can find such a list? I'm not interested in nearest neighbour, just any connected state. That sounds like something you could create in 20 minutes with a

Re: [GENERAL] Survey: renaming/removing script binaries (createdb, createuser...)

2008-03-27 Thread Colin Wetherbee
Gregory Williamson wrote: No can do, already taken: man pg Reformatting pg(1), please wait... PG(1) User Commands PG(1) NAME pg - browse pagewise through text files Good catch. Haven't used

Re: [GENERAL] Survey: renaming/removing script binaries (createdb, createuser...)

2008-03-26 Thread Colin Wetherbee
Zdeněk Kotala wrote: 1) What type of names do you prefer? --- a) old notation - createdb, createuser ... b) new one with pg_ prefix - pg_createdb, pg_creteuser ... c) new one with pg prefix - pgcreatedb, pgcreateuser ... d) remove them - psql is the solution e)

Re: [GENERAL] [postgis-users] how many min. floating-points?

2008-03-21 Thread Colin Wetherbee
John Smith wrote: On Thu, Mar 20, 2008 at 2:16 PM, Colin Wetherbee [EMAIL PROTECTED] wrote: Please don't cross-post, especially since nobody on the PostGIS mailing list answered your previous question. please don't cross-post my cross-post. if i wanted to post it to the postgresql list, i

Re: [GENERAL] [postgis-users] how many min. floating-points?

2008-03-20 Thread Colin Wetherbee
John Smith wrote: guys, Please don't cross-post, especially since nobody on the PostGIS mailing list answered your previous question. how many min. floating-points must a server hardware support for postgresql+postgis? does postgresql+postgis do much floating-point math to make a

Re: [GENERAL] [postgis-users] how many min. floating-points?

2008-03-20 Thread Colin Wetherbee
Sam Mason wrote: On Thu, Mar 20, 2008 at 02:02:12PM -0400, John Smith wrote: how many min. floating-points must a server hardware support for postgresql+postgis? does postgresql+postgis do much floating-point math to make a difference? can someone give postgresql+postgis application examples

Re: [GENERAL] Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP

2008-03-13 Thread Colin Wetherbee
Adrian Klaver wrote: On Thursday 13 March 2008 4:49 am, David Gagnon wrote: Hi all, I think the title says everything:-) I just what a way to create a TEMP for the current transaction only. If possible I don't want to create the TEMP table first, specify all column types, etc. CREATE

Re: [GENERAL] Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP

2008-03-13 Thread Colin Wetherbee
Adrian Klaver wrote: On Thursday 13 March 2008 2:46 pm, Colin Wetherbee wrote: Adrian Klaver wrote: On Thursday 13 March 2008 4:49 am, David Gagnon wrote: Hi all, I think the title says everything:-) I just what a way to create a TEMP for the current transaction only. If possible I

Re: [GENERAL] Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP

2008-03-13 Thread Colin Wetherbee
Tom Lane wrote: Colin Wetherbee [EMAIL PROTECTED] writes: Adrian Klaver wrote: Try CREATE TEMP TABLE foo ON COMMIT DROP AS (SELECT 1 AS a, 2 AS b) ; I don't know what version the OP is using, but that doesn't work on 8.1: Seems to be there in 8.2 and up. In 8.2: cww=# BEGIN; BEGIN cww

Re: [GENERAL] Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP

2008-03-13 Thread Colin Wetherbee
Colin Wetherbee wrote: Tom Lane wrote: Colin Wetherbee [EMAIL PROTECTED] writes: Adrian Klaver wrote: Try CREATE TEMP TABLE foo ON COMMIT DROP AS (SELECT 1 AS a, 2 AS b) ; I don't know what version the OP is using, but that doesn't work on 8.1: Seems to be there in 8.2 and up. In 8.2

Re: [GENERAL] Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP

2008-03-13 Thread Colin Wetherbee
Tom Lane wrote: Colin Wetherbee [EMAIL PROTECTED] writes: Colin Wetherbee wrote: cww=# CREATE TEMP TABLE foo ON COMMIT DROP AS (SELECT 1 AS a, 2 AS b); FWIW, the output of \h CREATE TABLE in both 8.1 and 8.2 suggest that this should be possible. \h CREATE TABLE AS is what describes

Re: [GENERAL] Array load from remote site through Perl/DBI

2008-03-11 Thread Colin Wetherbee
Gauthier, Dave wrote: I have a perl/dbi app that loads my DB with sequential and discrete insert statements. Runs very fast and I’m satisfied with it. Now I have to run the same app from a different site, but loading my local DB. The “one at a time” inserts take too long, probably because

Re: [GENERAL] loading a psql input file on win xp

2008-03-08 Thread Colin Wetherbee
akshay bhat wrote: The ConceptNet 3 database, as a PostgreSQL input file. You will need to be running a PostgreSQL server to install ConceptNet 3. i was earlier suggested to use following command to add it to database psql -d your_database_name -f conceptnet-2007-09-25.psql however i do not

Re: [GENERAL] how do you write aggregate function

2008-03-04 Thread Colin Wetherbee
Justin wrote: The help is not real clear nor can i find examples how to write an aggregate function. Examples: http://www.postgresql.org/docs/8.2/static/xaggr.html I searched the archive of the mail list and did not find anything The online documentation is excellent for these sorts of

Re: [GENERAL] Documenting a DB schema

2008-03-04 Thread Colin Wetherbee
Shahaf Abileah wrote: It would be great if the documentation could be kept as close to the code as possible – that way we stand a chance of keeping it up to date. So, in the same way that Java docs go right there on top of the class or method definitions, it would be great if I could attach

Re: [GENERAL] Problems making client perl connection to postgres server

2008-03-01 Thread Colin Wetherbee
[EMAIL PROTECTED] wrote: I need to connect a windows client running activestate perl 5.8.8 to a postgres database running on windows 2003 server. I have loaded DBI:pg module and DBD with various degrees of success. When I run a simple test script to make a connection to the postgres database I

Re: [GENERAL] issue with an assembled date field

2008-02-29 Thread Colin Wetherbee
Chris Bowlby wrote: test=# select tab.dr_prod_date FROM test-# (SELECT ('01/01/0'::text || substring(ilch.lot_id::text, 5, 1))::date AS dr_prod_date FROM my_lot_test ilch) AS tab test-# where tab.dr_prod_date = '2/5/08' limit 1; ERROR: invalid input syntax for type date: 01/01/0W Using

Re: [GENERAL] HELP FOR LOADING a .psql file (same question again but explained neatly)

2008-02-28 Thread Colin Wetherbee
akshay bhat wrote: hello i am new to psql or any database stuff. i have downloaded an .psql file from internet and wish to open it and see the data inside. i am working on windows xp and have installed the software successfully. please help i am my wits end. it is huge file 800mb and is

Re: [GENERAL] syntax errors at line 1 when executing every command

2008-02-28 Thread Colin Wetherbee
Steven De Vriendt wrote: I'm using the latest postgreSQL with the lastest postgis. When executing every command I want to use, I get the following error message: postgis=# createdb; ERROR: syntax error at or near createdb LINE 1: createdb; What other commands are you trying? createdb is

Re: [GENERAL] Space wasted by denormalized data

2008-02-28 Thread Colin Wetherbee
Decibel! wrote: I wrote this query to identify how much space is being wasted in a database by denormalized data. For each field in each table, it calculates how much space the field is taking in it's table as well as indexes, then it calculates how much space would be needed if that field was

Re: [GENERAL] How to monitor the progress of a stored procedure?

2008-02-27 Thread Colin Wetherbee
Kynn Jones wrote: I have a stored procedure that has been running for a very long time. Before doing the current real run, I tested the procedure on a toy case and confirmed that it produced the right result. So I know that when it finishes it will be OK, but I can't tell whether it will

Re: [GENERAL] [SQL] Deploying PostgreSQL on virtualized hardware

2008-02-26 Thread Colin Wetherbee
TJ O'Donnell wrote: I've been running PostgreSQL on a virtual server for several years now. I'm using VMWare with a Windows host and Linux guest. I've configured it to let Linux use a raw partition as a disk. Before I used a separate partition, the virtual disk had been a Windows file. Using

[GENERAL] Deploying PostgreSQL on virtualized hardware

2008-02-25 Thread Colin Wetherbee
In a couple months, I'm going to be considering how best to deploy an application I have that uses PostgreSQL as its back-end. It also makes heavy use of Perl under mod_perl and UMN MapServer with a sprinkling of PostGIS. I've recently become intrigued by the idea of virtualized servers [0],

Re: [GENERAL] How to return a large String with C

2008-02-17 Thread Colin Wetherbee
Tom Lane wrote: Stefan Niantschur [EMAIL PROTECTED] writes: So far I have been successfully doing calls to SPI, select the data from the table and return it. However, this works only with string not larger than page size of char[8192]. The strings I expect are much longer and this causes the

Re: [GENERAL] PostgreSQL 8.3 on Debian, Ubuntu

2008-02-15 Thread Colin Wetherbee
Greg Smith wrote: I recall a couple of people asking about when 8.3 would be available for Debian and Ubuntu. Here's an update now that some useful packages have come out this week. Thanks for the summary, Greg. Colin ---(end of broadcast)---

Re: [GENERAL] ERROR: COPY quote must be a single ASCII character

2008-02-08 Thread Colin Wetherbee
Andrej Kastrin wrote: ||5354235||,||some text...|| ||1234567||,||some text...|| ||1234568||,||some text...|| The sql statement I defined was: COPY testtable FROM 'test.txt' WITH DELIMITER AS ',' CSV QUOTE AS '||'; but the error: ERROR: COPY quote must be a single ASCII character I guess

Re: [GENERAL] arrays of floating point numbers / linear algebra operations into the DB

2008-02-01 Thread Colin Wetherbee
Enrico Sirola wrote: Hello, I'd like to perform linear algebra operations on float4/8 arrays. These tasks are tipically carried on using ad hoc optimized libraries (e.g. BLAS). In order to do this, I studied a bit how arrays are stored internally by the DB: from what I understood, arrays are

Re: [GENERAL] OT - pg perl DBI question

2008-01-29 Thread Colin Wetherbee
Colin Wetherbee wrote: CaT wrote: On Tue, Jan 29, 2008 at 05:10:00AM -0800, Glyn Astill wrote: well its using the pgsql_replication_check.pl, which does: -- use Pg; ... So I assume it's not getting past the use Pg line as although it's looking in /usr/lib/perl5 it's

Re: [GENERAL] OT - pg perl DBI question

2008-01-29 Thread Colin Wetherbee
CaT wrote: On Tue, Jan 29, 2008 at 05:10:00AM -0800, Glyn Astill wrote: well its using the pgsql_replication_check.pl, which does: -- use Pg; ... So I assume it's not getting past the use Pg line as although it's looking in /usr/lib/perl5 it's not going to look in

Re: [GENERAL] OT - pg perl DBI question

2008-01-29 Thread Colin Wetherbee
adam_pgsql wrote: this looks to be using the Pg module rather than DBI + DBD::Pg. This one i think: http://www.cpan.org/authors/id/M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz i think thats quite old now though Indeed, that's how it looks. That would be in the libpg-perl package on Debian. In

Re: [GENERAL] Problem of capital case-insensitive letter with accent

2008-01-21 Thread Colin Wetherbee
lan ping wrote: Hi, there In our database, some customers' names contain French accent like É,é,È,è. In one server, case-insensitive search works for capital letters. For example, SELECT lower('ÉÈ') could return éè . But the other server cannot. It is very strange, as the two server use

Re: [GENERAL] Problem of capital case-insensitive letter with accent

2008-01-21 Thread Colin Wetherbee
Pavel Stehule wrote: when database uses different encoding, than is specified in cluster's initialization, then lower, upper doesn't work. Oooh. That's... confusing. Colin ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner

Re: [GENERAL] PL/pgsql function handle CUBE values

2008-01-16 Thread Colin Wetherbee
Rajarshi Guha wrote: Hi, I am trying to write a PL/pgsql function that will take a CUBE variable (which will be a 1D point) and a double precision variable. If the input CUBE is defined as '(x,y,z)'::cube the function would then return a CUBE value of the form

Re: [GENERAL] Getting process id of a connection?

2008-01-04 Thread Colin Wetherbee
Joshua D. Drake wrote: On Fri, 4 Jan 2008 14:59:47 -0800 Webb Sprague [EMAIL PROTECTED] wrote: Hi all, Is there a way to determine the pid of a database connection from within that connection? As a hypothetical example, I would like to be able to do the following: $ps x PID TTY STAT

Re: [GENERAL] SuSE gcc segfault compiling pgsql

2007-12-20 Thread Colin Wetherbee
Marcin wrote: Did anybody face the same problem during the compilation of postgresql 8.2.5 on suse 10.2? I'm using gmake 3.81 In the future, please include subjects in your posts. gcc -I../../include -I../../../../../src/interfaces/ecpg/include -I../../../../../src/interfaces/libpq

Re: [GENERAL]

2007-12-20 Thread Colin Wetherbee
Albe Laurenz wrote: Marcin wrote: Did anybody face the same problem during the compilation of postgresql 8.2.5 on suse 10.2? I'm using gmake 3.81 [...] dynalloc2.pgc:55: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate.

Re: [GENERAL] INDEX on a composite type

2007-12-19 Thread Colin Wetherbee
GMail wrote: When trying to create an index on a composite type, I need to enclose the columns in paranthesis. Is this normal? I don't think so as there's no mention in the friendly manual. I think your problem is similar to one that has been discussed here previously.

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-18 Thread Colin Wetherbee
Colin Wetherbee wrote: My guess, having written this, is that your approach might be more useful for applications that rely heavily on interaction with a database. I'd appreciate any more comments you have on this, though. Tom, Sam, and Ted (a lovely assortment of three-letter names), thank

Re: [GENERAL] thank you

2007-12-18 Thread Colin Wetherbee
Gregory Williamson wrote: Kevin H. wrote on Tue 12/18/2007 7:26 PM Hullo List, This is aimed at everyone in this community who contributes to the Postgres project, but especially at the core folks who continually make this community great through energy, time, money, responses, and

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Colin Wetherbee
Sam Mason wrote: On Sun, Dec 16, 2007 at 06:31:56PM -0500, Colin Wetherbee wrote: If I write one Perl sub for each operation on the table (e.g. one that gets the username and password hash, another that gets the last name and first name, etc.), there will be a whole lot of subs, each of which

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Colin Wetherbee
Sam Mason wrote: Luckily I've been able to design most of the programs I work on as relatively simple layers over a database, I'm not sure if you're able to work like this. I'm not at liberty to divulge much of the application concept, but consider, if you will, an application like Gmail or

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Colin Wetherbee
Ted Byers wrote: --- Colin Wetherbee [EMAIL PROTECTED] wrote: Sam Mason wrote: On Sun, Dec 16, 2007 at 06:31:56PM -0500, Colin Wetherbee wrote: If I write one Perl sub for each operation on the table (e.g. one that gets the username and password hash, another that gets the last name

[GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-16 Thread Colin Wetherbee
Greetings. I am working on a PostgreSQL-backed mod_perl web application that's just in its infancy. Let's say I have a users table that holds about 15 columns of data about each user. If I write one Perl sub for each operation on the table (e.g. one that gets the username and password

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-16 Thread Colin Wetherbee
Tom Lane wrote: Colin Wetherbee [EMAIL PROTECTED] writes: Let's say I have a users table that holds about 15 columns of data about each user. If I write one Perl sub for each operation on the table (e.g. one that gets the username and password hash, another that gets the last name and first

Re: [GENERAL] query

2007-12-14 Thread Colin Wetherbee
marco santillan wrote: I need to be able distribute like my application with postgresql to the final client and since as I can assure or encryptar the database to avoid the command trust. Tu pregunta fue traducida mal. Visita por favor el URL siguiente para la información sobre la comunidad

Re: [GENERAL] SQL design pattern for a delta trigger?

2007-12-10 Thread Colin Wetherbee
Vivek Khera wrote: On Dec 7, 2007, at 11:42 AM, Colin Wetherbee wrote: You can do this with a conditional. Something like the following should work. IF NOT (a query matching your data returns rows) THEN INSERT (your new data) There exists a race condition here unless you've locked your

Re: [GENERAL] SQL design pattern for a delta trigger?

2007-12-10 Thread Colin Wetherbee
Vivek Khera wrote: On Dec 10, 2007, at 5:04 PM, Colin Wetherbee wrote: For what it's worth, the real algorithm would be as follows. I hadn't had enough coffee yet, and I forgot the UPDATE bit. IF (a query matching your old data returns rows) THEN UPDATE with your new data ELSE INSERT your

Re: [GENERAL] SQL design pattern for a delta trigger?

2007-12-07 Thread Colin Wetherbee
Ted Byers wrote: --- Erik Jones [EMAIL PROTECTED] wrote: On Dec 6, 2007, at 2:36 PM, Ted Byers wrote: [snip] What you want to do here for handling the update v. insert is called an UPSERT. Basically, what you do is run the update as if the row exists and catch the exception that is