[SQL] Peer-review requested of soft-delete scheme

2013-04-16 Thread Mark Stosberg
s. I think that would make it unlikely for a developer or reviewer to mess up SELECTs involving the statement. Inserts/Updates/Delete statements against the table are view, and coud reference the underlying table directly. Is this sensible? Is there another approach to soft-deletes I should be c

Re: [SQL] Need help revoking access WHERE state = 'deleted'

2013-02-28 Thread Mark Stosberg
On 02/28/2013 02:08 PM, Tom Lane wrote: > Mark Stosberg writes: >> # Explicitly grant access to the view. >> db=> grant select on entities_not_deleted to myuser; >> GRANT > >> # Try again to use the view. Still fails >> db=> SELECT 1 FROM entities_

Re: [SQL] Need help revoking access WHERE state = 'deleted'

2013-02-28 Thread Mark Stosberg
On 02/28/2013 01:02 PM, Ben Morrow wrote: > Quoth m...@summersault.com (Mark Stosberg): >> >> We are working on a project to start storing some data as "soft deleted" >> (WHERE state = 'deleted') instead of hard-deleting it. >> >> To make su

[SQL] Need help revoking access WHERE state = 'deleted'

2013-02-28 Thread Mark Stosberg
" table with the "entities_not_deleted" table However, this isn't working, I "permission denied" when trying to use the view. (as the same user that has had their SELECT access removed to the underlying table.) We are not stuck on this design. What's a recomm

Re: [SQL] Fun with Dates

2012-10-29 Thread Mark Fenbers
be something simple!   thanks! Mark <> -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Fun with Dates

2012-10-29 Thread Mark Fenbers
NOW() ) ) + ' days' In other words, if today is the 29th of the month, I want to select data that is within 29 days old... WHERE obstime >= NOW() - INTERVAL '29 days' How do I craft a query to do use a variable day of the month? Mark

Re: [SQL] complex query

2012-10-27 Thread Mark Fenbers
pe as appropriate. Thanks!  Your idea worked like a champ! Mark <> -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] complex query

2012-10-27 Thread Mark Fenbers
nstead of "col3").  I could use UNION to simplify, except that UNION will return 2 rows, and the code that receives my resultset is only expecting 1 row. Is there a better way to go about this? Thanks for any help you provide. Mark <> -- Sent vi

[SQL] Aggregates puzzle

2011-03-31 Thread Mark Fenbers
, then I need to add "value" to the GROUP BY clause, which makes the MAX(value) function report *each row* as a maximum. So, how can I revise my SQL to report the obstime that the MAX(value) occurred? Any help is sincerely appreciated. Mark <> -- Sent via pgsql-sql mailing lis

[SQL] recommended data model for a search?

2011-02-15 Thread Mark Stosberg
y indexable for quick look-ups, and would allow us to create a unique index that doesn't have a problem with null values, too. Is this a reasonable approach, or is there a better design I'm overlooking? Thanks, Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To

[SQL] import ignoring duplicates

2010-05-16 Thread Mark Fenbers
f the file. I am looking for an option/switch to tell psql (or the \copy command) to skip over any duplicate key constraint viloations and continue to load any data that doesn't violate a duplicate key constraint. Is there such an option? Mark <> -- Sent via pgsql-sql mailing

Re: [SQL] Simple aggregate query brain fart

2010-03-18 Thread Mark Fenbers
Thanks, Joe and Tom.  You cleared the webs out of my brain.  I used HAVING before, but not lately and I got rusty. Mark Tom Lane wrote: Mark Fenbers writes: I want to do: SELECT id, count(*) FROM mytable WHERE count(*) > 2 GROUP BY id; But this doesn

[SQL] Simple aggregate query brain fart

2010-03-18 Thread Mark Fenbers
(that column cnt does not exist). When using an GROUP/ORDER BY clause, I can refer to a column number (e.g., GROUP BY 1) instead of a column name, but how can I refer to my unnamed second column in my where clause? Mark <> -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) T

[SQL] Linked list with CTE

2010-03-14 Thread Mark Lubratt
ents... Thus, if I give the query any node in a linked list, I'd like the entire tree returned. e.g. If I give the query 'A', I'd like it to return the ROOT, A, B, C, D, E, F, G tree. If I give the query 'Y', I'd like it to return the Z, Y tree. I hope I made sense... Thanks! Mark

Re: [SQL] SQL Subqueries on each result row

2009-09-24 Thread Mark J Camilleri
index_dates LEFT JOIN index_dates z2 ON z2.indx IN (index_dates.indx, index_dates.indx-1, index_dates.indx-2) GROUP BY index_dates.the_date ORDER BY index_dates.the_date; DROP TABLE index_dates; RESULT: DATE| SUM --- 2009-09-19|1 2009-09-20|3 2009-09-21|9 2009-09-24|17{inserted instead of 22 Sep} 2009-10-25|16{inserted instead of 23 Sep} Regs, Mark

Re: [SQL] Rewrite without correlated subqueries

2009-08-20 Thread Mark Fenbers
.  Your new query would not include the ... IN ( ) syntax... Mark bricklen wrote: Hi All, I'm having some trouble wrapping my head around the syntax to rewrite a query using correlated subqueries, to using outer joins etc. The query: SELECT  ps.userid,    SUM( ps.hits

[SQL] drop PW

2009-06-13 Thread Mark Fenbers
tried: ALTER USER george PASSWORD ''; and that looked like it succeeded, but running psql again prompted me and when I just hit Enter, it complained that no password was supplied. So how do I turn off being prompted for a password for george. (I am aware of the security risks...) Ma

[SQL] Best practices for geo-spatial city name searches?

2009-02-24 Thread Mark Stosberg
primary key, and a zipcode as an additional column. Then, by joining on the zipcodes table, the coordinates for a city could be found. Is there any other way I should be considering data modelling to support searches on zipcodes and cities? Thanks! Mark -- . . . . . . . . . . . .

Re: [SQL] Aggregates with NaN values

2008-12-05 Thread Mark Roberts
to get a behvavior where they are "ignored" by an > aggregate? > > Thanks, > Sean > Have you considered using a where clause? -Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Left Join Question

2008-11-18 Thread Mark Roberts
wrong with it. The planner will likely pare down tasks to its result set before joining to the other joins (which are all keyed on various fields from task). I know that we have lots of joins like this scattered all over our code, but we usually use inner joins unless there's a specif

Re: [SQL] For each key, find row with highest value of other field

2008-10-03 Thread Mark Roberts
2008-04-01 | bar A | 2008-03-01 | foo B | 2008-03-01 | baz B | 2008-02-01 | bar C | 2008-06-03 | foo C | 2008-04-04 | baz C | 2008-03-04 | bar (8 rows) Time: 0.520 ms MYDATABASE=> select distinct on (key) key, date, value from aaa order by key, date desc; key |date| value

Re: [SQL] exclusion query

2008-09-22 Thread Mark Roberts
feel like there's a solution involving group by tugging at the back of my mind, but I can't quite put my finger on it. Sorry if this isn't quite what you're asking for. -Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] RE: [SQL] Why *no* ambig.uous complain in select part?

2008-08-22 Thread Mark Roberts
select col1, col2 from T1 left outer join T2 using (col1, col2) where T2.col1 is not null -Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Question on partitioning

2008-08-21 Thread Mark Roberts
Please kindly advice me on this > > Many thanks in advance for your kind help > > Best, > Oliveiros I would expect partitioning to work. I've heard tell that fine grained partitioning coupled with check constraints can even eliminate the need for certain indexes. I do know that c

[SQL] vacuum in single-user mode

2008-08-08 Thread Mark Fenbers
VACUUM FULL, but I cannot find out how to do that, either. Can anyone lend some advice, please? Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] DELETE with JOIN

2008-08-07 Thread Mark Roberts
und a way, usually > DELETE FROM a WHERE a.b_id IN (SELECT id FROM b WHERE second_id > = ?) This is akin to: delete from a where (a.key1, a.key2, a.key3) in (select key1, key2, key3 from b) I use this every day for millions of rows per delete and it works just fine and in a very reasonable time

Re: [SQL] more than 1000 connections

2008-08-06 Thread Mark Roberts
n you're trying to write. Disclaimer: I work in a data warehousing and we only have 45 concurrent connections right now. OLTP and/or large connection counts isn't really what I spend my days thinking about. ;-) -Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-18 Thread Mark Roberts
Also, lock table is a bit more forceful, because it will affect things that don't bother checking advisory locks (such as users, manual scripts, buggy applications, etc). Don't forget that you can use select for update another locking mechanism as well. Well, that's my

Re: [SQL] How to GROUP results BY month

2008-07-16 Thread Mark Roberts
On Wed, 2008-07-16 at 07:39 +0200, A. Kretschmer wrote: > am Tue, dem 15.07.2008, um 18:15:07 -0700 mailte Mark Roberts > folgendes: > > > > On Tue, 2008-07-15 at 14:31 +0200, A. Kretschmer wrote: > > > am Tue, dem 15.07.2008, um 13:12:39 +0100 mailte Oli

Re: [SQL] How to GROUP results BY month

2008-07-15 Thread Mark Roberts
turns a month_no, and thus will not be suitable for grouping queries that span years. I recommend group by date_trunc('month', <>) -Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Rollback in Postgres

2008-07-11 Thread Mark Roberts
ore information about rollback here: http://www.postgresql.org/docs/8.3/interactive/sql-rollback.html Best of luck in your endeavor :) -Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Re: Best practice for long-lived journal tables: bigint or recycling IDs?

2008-07-09 Thread Mark Stosberg
7483648); > > ERROR: integer out of range > > Hmm, you can alter the sequence so that it wraps around at the point it > reaches INT_MAX. So inserting this number would never actually happen. Ah, that does look like the best solution. I'll confirm that will work for our case

[SQL] Re: Best practice for long-lived journal tables: bigint or recycling IDs?

2008-07-08 Thread Mark Stosberg
On Tue, 8 Jul 2008 17:20:13 -0400 Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Mark Stosberg wrote: > > > > Hello, > > > > I have some tables that continually collect statistics, and then over time > > are > > pruned as the stats are aggregated in

[SQL] Best practice for long-lived journal tables: bigint or recycling IDs?

2008-07-08 Thread Mark Stosberg
manent storage. Both options have some appeal for me. What have others done? Mark -- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark StosbergPrincipal Developer [EMAIL PROTECTED] Summersault, LLC 765-939-9301 ext 202 database driven websit

Re: [SQL] Egroupware infolog query slow (includes query plan)

2008-07-06 Thread Mark Stosberg
I should have mentioned in the last post that PostgreSQL 8.2.9 is in use. I could upgrade to 8.3.x if that is expected to help performance in this case. Mark On Sun, 2008-07-06 at 16:23 -0400, Mark Stosberg wrote: > Hello, > > I could use some help figuring out how to speed u

[SQL] Egroupware infolog query slow (includes query plan)

2008-07-06 Thread Mark Stosberg
finish! I'm not skilled enough at reading the "Explain Analzyze" output to understand what the primary problem is. Thanks! Mark ### SELECT DISTINCT main.* ,( SELECT count(*) FROM egw_infolog sub WHERE sub.info_id_parent=main.info_id AND (

Re: [SQL] GROUP BY on a column which might exist in one of two tables

2008-06-25 Thread Mark Stosberg
1; That was very helpful, Greg. My new design looks much like this. Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] GROUP BY on a column which might exist in one of two tables

2008-06-25 Thread Mark Stosberg
> select > coalesce(h.partner_id, v.partner_id) as partner_id, > coalesce(v.count, 0) as total_views, > coalesce(h.count, 0) as total_hits > from > (select partner_id, count(*) from hits group by partner_id) as h > full outer join > (select partner_id, count(*) from views g

[SQL] GROUP BY on a column which might exist in one of two tables

2008-06-25 Thread Mark Stosberg
OALESCE(hits.partner_id,views.partner_id) which didn't work. I'm stuck on what to try next. Thanks! Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Different type of query

2008-06-11 Thread Mark Roberts
ent_no in (203, 204, 208..) You could also grab the most significant 8 nutrients by doing something like: select nutrient_no, nutrient_value from nutrient_data where ndb_no = 13473 order by nutrient_value desc limit 8 -Mark -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Unable to create function which takes no arguments

2008-06-09 Thread Mark Roberts
IIRC, current_timestamp doesn't require parens. You could try something like this: select extract(epoch from current_timestamp)::int4 as result; -Mark On Mon, 2008-06-09 at 12:05 -0400, Michael Eshom wrote: > I am a project manager for a popular forum system. We are adding >

[SQL] Informix Schema -> PostgreSQL ?

2007-07-03 Thread Mark Fenbers
ma? BTW, what does PostgreSQL call this (what Informix calls a schema)?? Mark ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

[SQL] Requirement for PostgreSQL Database Developer

2007-01-10 Thread Mark
Hi , Location: San Diego, CA [You can also TeleCommute but you have to be on the client side for 2 Weeks in a month] Duration: 6+ months. This is Mark with ProV International, This email is in regards to the requirement we have with one of our direct client in San Diego, CA

[SQL] Requirement for PostgreSQL Database Developer

2006-12-18 Thread Mark
Hi , Location: San Diego, CA [You can also TeleCommute but you have to be on the client side for 2 Weeks in a month] Duration: 6+ months. This is Mark with ProV International, This email is in regards to the requirement we have with one of our direct client in San Diego, CA

[SQL] Requirement for PostgreSQL Database Developer

2006-11-06 Thread Mark
  Hi ,   Location: San Diego, CA [You can also TeleCommute...] Duration: 6+ months.     This is Mark with ProV International, This email is in regards to the requirement we have with one of our direct client in San Diego, CA.   PostgreSQL Database Developer This position

[SQL] Create Function (SQL)

2006-11-04 Thread Mark Simon
from the table (whatever) as out parameters, or as a return type, or can I have a generic table returned from this? Thanks, Mark -- Mark Simon Manngo Net Pty Ltd Phone/Fax: 1300 726 000 mobile: 0411 246 672 email: [EMAIL PROTECTED] web: http://www.manngo.net Resume: http://mark.manngo.net

[SQL] Create View

2006-11-04 Thread Mark Simon
ields from whatever. I thought it should be possible to save the star (*) as part of the view. Otherwise, I run into the problem of not getting all of the fields if I add columns to the table (whatever). Is this an SQL thing or a PostGreSQL thing? Thanks, Mark -- Mark Simon Manngo Net Pty Ltd

Re: [SQL] Temp tables and functions

2006-10-11 Thread Mark R. Dingee
Thanks, Jim. I'll give it a try. On Tue, 2006-10-10 at 21:11 -0500, Jim C. Nasby wrote: > On Tue, Oct 10, 2006 at 03:21:36PM -0400, [EMAIL PROTECTED] wrote: > > Everyone, > > > > I've written a function (language = sql) which uses a temporary table to > > simplify the process; however, when I g

[SQL] INSERT ... SELECT FROM .... FOR UPDATE?

2006-07-14 Thread Mark Stosberg
1/static/sql-select.html#SQL-FOR-UPDATE-SHARE Since it's hard to test for this kind of failure, I wanted to get the opinions of others here if this would be a good idea. Thanks! Mark ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

[SQL] Avoiding RI failure with INSERT ... SELECT FROM

2006-07-12 Thread Mark Stosberg
". Re-running the transaction block a few minutes later worked. What's an alternate design that avoids this possible error? Thanks! Mark ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

[SQL] Requirement for PostgreSQL Database Developer

2006-06-14 Thread Mark
Hi ,           This is Mark with ProV International, This email is in regards to the requirement we have with one of our direct client in San Diego, CA.   PostgreSQL Database Developer This position involves creating tables, views, functions and stored procedures to support front end

Re: [SQL] Good examples of calling slony stored procedures

2006-06-14 Thread Mark Adan
Excellent. I will subscribe to that one. Thanks Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Sullivan Sent: Wednesday, June 14, 2006 09:14 To: pgsql-sql@postgresql.org Subject: Re: [SQL] Good examples of calling slony stored procedures

Re: [SQL] Good examples of calling slony stored procedures

2006-06-14 Thread Mark Adan
Hi Jim I looked there already and didn't find what I needed. I saw this web page from cbbrowne and he briefly talked about using "bare metal" slony functions, but doesn't have any examples. Mark -Original Message- From: Jim Buttafuoco [mailto:[EMAIL PROTECTED] S

Re: [SQL] Good examples of calling slony stored procedures

2006-06-14 Thread Mark Adan
Hi Can somebody direct me to the mailing list for slony. I couldn't find it anywhere on the postgres.org website (which is where I found this list to begin with). Thanks Mark -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 13, 2006 20:27 To: Mark

[SQL] Good examples of calling slony stored procedures

2006-06-13 Thread Mark Adan
Hi I was wondering if where can I find some examples of calling the slony stored procedures instead of using slonik? I want to be able to for example add a table into slony. Thanks Mark Adan ---(end of broadcast)--- TIP 1: if posting/reading

[SQL] Does PG have a database

2006-05-22 Thread Mark Fenbers
ng might differ for each host, so specifying this in the software is not practical. Bottom line: What trick can I use to determine whether a box has a living, breathing Pg database if I don't know the DB owner? Mark ---(end of broadcast)--

Re: [SQL] Looking for some help with cascading updates...

2006-04-18 Thread Mark True
Next silly question, how do you get your database to like plpgsql...I do CREATE LANGUAGE 'plpgsql' and it says it is not defined?--MarkOn 4/18/06, Andreas Kretschmer <[EMAIL PROTECTED]> wrote: Mark True <[EMAIL PROTECTED]> schrieb:> I guess I should have clarified.  I a

Re: [SQL] Looking for some help with cascading updates...

2006-04-18 Thread Mark True
wrote: Mark True <[EMAIL PROTECTED]> schrieb: >> Here is the question:>> I have a situation where I need to create triggers to cascade an insert> operation to many tables to maintain foreign key constraints.>> So at a high level >> INSERT INTO myTable (Name, Add

[SQL] Looking for some help with cascading updates...

2006-04-18 Thread Mark True
Here is the question:I have a situation where I need to create triggers to cascade an insert operation to many tables to maintain foreign key constraints.  So at a high levelINSERT INTO myTable (Name, Address, Zip) VALUES ('Mark', '3 Dingle St.', '01832') myTable has

Re: [SQL] Change date format through an environmental variable?

2006-03-01 Thread Mark Fenbers
I found PGDATESTYLE that solves my problem, but ever since, I've been looking for a comprehensive list of environmental variables that Pg recognizes, but haven't been able to find such a list in any of the books I looked in or the man pages. Anyone know where I can find such a l

[SQL] Change date format through an environmental variable?

2006-03-01 Thread Mark Fenbers
effect if trying to set it as an envvar. Mark ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Given 02-01-2006 to 02-28-2006, output all days.

2006-02-20 Thread Mark R. Dingee
Pedro, Would something such as this suffice? Mark create function get_date_range(date, date) returns setof date as ' DECLARE     cur date; BEGIN     cur := $1;     while cur <= $2 LOOP          return next cur;          cur := cur + interval ''1 day'';     end LOOP

Re: [SQL] group by complications

2006-02-16 Thread Mark Fenbers
Wow!  I didn't know you could have a (select ...) as a replacement for a 'from' table/query.  Your SQL worked as-is, except I had to add a 'limit 1' to the first subquery. Thanks!  I would have never figured that out on my own! Mark chester c young wrote:

[SQL] group by complications

2006-02-13 Thread Mark Fenbers
want to do something like this: select l.lid,l.fs,most_recent(h.obsvalue) from location as l inner join height as h on h.lid = l.lid where l.fs > 0.0 group by l.lid,l.fs; Can someone offer hints, please? Mark ---(end of broadcast)--- TIP 9:

[SQL] pgadmin

2006-01-23 Thread Mark Fenbers
g that I must be doing something wrong. PostgreSQL and PostGIS installed without any problems, but this single utility (pgadmin) is really throwing me for a loop. Does anyone have any ideas I could try? Mark ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Just 1 in a series...

2005-12-02 Thread Mark Fenbers
You might find the "DISTINCT ON" syntax does just what you want --- see the "weather report" example on the SELECT reference page. It's not standard SQL though. This works! Thanks! What would have to be done if I needed a standard SQL solution? Mark -

[SQL] Just 1 in a series...

2005-12-02 Thread Mark Fenbers
are tangled. Can someone please send advice regarding this issue? Mark ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

[SQL] APPEND INTO?

2005-12-01 Thread Mark Fenbers
I want to SELECT INTO mytable WHERE (criteria are met), except that I want to APPEND into an existing table the rows that are selected, instead of creating a new table (which SELECT INTO will do). How can this be done? (Is this what the "FOR UPDATE OF tablename" clause is f

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Mark R. Dingee
find a backdoor into sensitive data. Thanks Mark On Wednesday 02 November 2005 01:59 pm, Bruno Wolff III wrote: > On Tue, Nov 01, 2005 at 17:00:50 -0500, > > "Mark R. Dingee" <[EMAIL PROTECTED]> wrote: > > Bruno, > > > > I use an authenticate() functio

Re: [SQL] PGSQL encryption functions

2005-11-02 Thread Mark R. Dingee
that the methodology is appropriate or that I'm being a bit paranoid? Thanks On Tuesday 01 November 2005 05:13 pm, Tom Lane wrote: > "Mark R. Dingee" <[EMAIL PROTECTED]> writes: > > md5 works, but I've been able to > > brute-force crack it very

Re: [SQL] PGSQL encryption functions

2005-11-01 Thread Mark R. Dingee
ing for an alternative. Any thoughts would be greatly appreciated. Thanks, Mark On Tuesday 01 November 2005 04:28 pm, Bruno Wolff III wrote: > On Tue, Nov 01, 2005 at 14:38:05 -0500, > > "Mark R. Dingee" <[EMAIL PROTECTED]> wrote: > > Everyone, > > > >

Re: [SQL] PGSQL encryption functions

2005-11-01 Thread Mark R. Dingee
I'll check it out. Thanks, Josh On Tuesday 01 November 2005 02:49 pm, Josh Berkus wrote: > Mark, > > > I'm in need of a one-way pgsql script that will take a plain-text string > > and return an ecrypted string (preferably 32 character) . I've been > > usin

[SQL] PGSQL encryption functions

2005-11-01 Thread Mark R. Dingee
Everyone, I'm in need of a one-way pgsql script that will take a plain-text string and return an ecrypted string (preferably 32 character) . I've been using md5('string'), but I'm concerned it's too weak for my needs. Does anyone have any recommendations? Thanks, Mark

[SQL] Age in days

2005-09-12 Thread Mark A. Strivens
days only? Many thanks Mark ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Can EXCEPT Be Used for To Solve This Problem?

2005-08-25 Thread Mark R. Dingee
you can also do select ... order by update_time desc offset 1 limit 1 On Thursday 25 August 2005 10:47 am, Vivek Khera wrote: > On Aug 24, 2005, at 4:47 PM, Lane Van Ingen wrote: > > I want to select 2nd oldest transaction from foo (transaction 3). The > > solution below > > works, but I think t

Re: [SQL] Problem with self-made plpgsql-function / casting

2005-08-20 Thread Mark Dingee
elect fc_editlanguage(123, 'some name', 'some text value', 456) What you need to do is be more specific with the types being passed. Try this instead: select fc_editlanguage(123, 'some name'::varchar, 'some text value'::varchar, 456) Best of luck, Mark On

[SQL] Multi-column returns from pgsql

2005-07-22 Thread Mark R. Dingee
LECT txt1, txt2 FROM mytable LOOP RETURN NEXT rec.txt1; RETURN NEXT rec.txt2; END LOOP; RETURN; END;' language 'plpgsql'; which leaves me parsing multiple records to achieve the desired end result. Anyone have any thoughts? Thanks, Mark --

[SQL] Dumping table definitions

2005-07-18 Thread Mark Fenbers
wanted to check if Pg already had tools to export the table structure (without the data). Does it? Also, Is there a way to export the structure of all tables at once instead of one table at a time? Mark begin:vcard fn:Mark Fenbers n:Fenbers;Mark org:DoC/NOAA/NWS/OHRFC adr:;;1901 South SR 134;

[SQL] Error on dynamic code.

2005-07-14 Thread Mark J Camilleri
TEMENTS-ASSIGNMENT )   Which is basically identical (except for the WHERE clause) to the query returned in the my error message!!   Can anyone help please?   Regs, Mark J Camilleri

Re: [SQL] Sum() rows

2005-05-31 Thread Mark Dilger
Mark Dilger wrote: [EMAIL PROTECTED] wrote: Hi. How can I sum a row and show the sum for each row??? For example, in a finances table that have the total movimentation(debit/credit) in the bank. i.e: CREATE TABLE TB1 (id integer primary key, value numeric); insert into tb1 values (1,20

Re: [SQL] Sum() rows

2005-05-31 Thread Mark Dilger
[EMAIL PROTECTED] wrote: Hi. How can I sum a row and show the sum for each row??? For example, in a finances table that have the total movimentation(debit/credit) in the bank. i.e: CREATE TABLE TB1 (id integer primary key, value numeric); insert into tb1 values (1,20); insert into tb1 values (2,

[SQL] [Fr*e-Content] Embrace the Four Fundamental Laws of Communication

2005-05-31 Thread Mark Susnow, Life Coach
• Request permission from the author to publish this article in print or in a paid for arena. • Contact info: Mark Susnow, Life Coach <mailto:[EMAIL PROTECTED]> Summary: 732 Word Count: In this article, Mark Susnow, teaches us four fundamental truths of communication when embraced

[SQL] DBD::Pg on Enterprise 3

2005-05-20 Thread Mark Fenbers
baseline. Although the module is available for installation, this causes me alarm because our agency has rules regarding installing un-approved modules on official agency equipment. Can anyone tell me what the facts are regarding DBD::Pg and RHEL3?? Thank you! Mark begin:vcard fn:Mark Fenbers

Re: [SQL] Aggregate Functions Template

2005-05-20 Thread Mark Fenbers
Yes, your varlena links are what I was looking for as a source of help... Thanks! Mark Michael Fuhr wrote: On Thu, May 19, 2005 at 03:17:07PM -0400, Mark Fenbers wrote: I need to create an aggregate function to do some math not currently provided by the available tools. Can someone point to

[SQL] Aggregate Functions Template

2005-05-19 Thread Mark Fenbers
nk on how to do this properly from scratch. Thanks for the help! Mark begin:vcard fn:Mark Fenbers n:Fenbers;Mark org:DoC/NOAA/NWS/OHRFC adr:;;1901 South SR 134;Wilmington;OH;45177-9708;USA email;internet:[EMAIL PROTECTED] title:Sr. HAS Meteorologist tel;work:937-383-0430 x246 x-mozilla-html:TRUE url

[SQL] sub-selects

2005-05-16 Thread Mark Fenbers
-select 3 times in the query.  I tried the following: SELECT a, (select b from c where d = e limit 1) AS g, npoints( g )     FROM f     WHERE isValid( g ); But this gave an error regarding "column 'g' does not exist".  How can I avoid making the same sub-select 3 times? Mark

Re: [SQL] Replacing a table with constraints

2005-05-13 Thread Mark Fenbers
True, but Counties has about 8 or 9 rules, view, or pk constraints attached to it.  I don't want to break all these unless I knew of a way to save off the SQL for them beforehand so I can easily rebuild them... Mark Ing. Jhon Carrillo wrote: Use  Drop table YOUR_

[SQL] Replacing a table with constraints

2005-05-13 Thread Mark Fenbers
will not let me 'DELETE FROM Counties;", nor will it let me "DROP TABLE Counties;"  I'm perplexed.  Can someone suggest how I can best get data from Counties to look just like newCounties? Mark begin:vcard fn:Mark Fenbers n:Fenbers;Mark org:DoC/NOAA/NWS/OHRFC adr:;;1901 S

[SQL] default value for select?

2005-05-09 Thread Mark Fenbers
o myColumn if and when "select altColumn ..." returns zero rows? Mark begin:vcard fn:Mark Fenbers n:Fenbers;Mark org:DoC/NOAA/NWS/OHRFC adr:;;1901 South SR 134;Wilmington;OH;45177-9708;USA email;internet:[EMAIL PROTECTED] title:Sr. HAS Meteorologist tel;work:937-383-0430 x246 x-mozilla-html:TRUE

[SQL] Postgres 8 - Database access, new install.

2005-02-24 Thread Mark Roberts
anyone have any idea of how to resolve this problem, I can connect using PGAdminIII but I really would like to be able to login in properly from Command-line also.   Many Thx, Mark. ___ Disclaimer: Great Ormond Street Hospital for Children NHS Trust SECURITY WAR

[SQL] Updating column to link one table to another

2004-12-17 Thread Mark Collette
linked up yet. I need to know how I can UPDATE the FrequentTable rows, where their infrequentId is zero, to point at the last InfrequentTable entry whose timestamp ts is before its own timestamp ts. Can anyone help me with this? Thank you. - Mark Collette ---(end of

[SQL] Explicitly rolling back transaction from within a C-Language function

2004-11-24 Thread Mark Dilger
ation on this subject is also welcome. Thank you for any help, mark __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com ---(end of broadcast)--- TIP 9: the planner

Re: [SQL] Aggregate Function with Argument

2004-10-19 Thread Mark Gibson
STRICT IMMUTABLE; Example: SELECT * FROM array_enum(string_to_array('one,two,three',',')); -- Mark Gibson Web Developer & Database Admin Cromwell Tools Ltd. Leicester, England. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] problems using phpPgAmin

2004-10-19 Thread Mark Gibson
? Have you copied 'conf/config.inc.php-dist' to 'conf/config.inc.php' and configured it? BTW, there is a mailing list for phpPgAdmin at: [EMAIL PROTECTED] -- Mark Gibson Web Developer & Database Admin Cromwell Tools Ltd. Leicester, England.

[SQL] create function atof?

2004-06-05 Thread Mark Tabash
Hello, Is it possible to create a database function that mimics the C function atof? I'm guessing it should look something like this: create function atof(varchar) returns float as '??' language returns null on null input;

Re: [SQL] Elegant way to monitor for changes in a trigger and migrate

2004-05-22 Thread Mark Gibson
rested. It needs some cleaning up first, when I have time. -- Mark Gibson Web Developer & Database Admin Cromwell Tools Ltd. Leicester, England. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] [HACKERS] Materialized View Summary

2004-02-25 Thread Mark Gibson
he mutable bits! Giving you the best of both worlds. I haven't tried this or thought it through very much - too busy - but I'd thought I'd throw it in for a bit o' head scratching, and chin stroking :) Cheers -- Mark Gibson Web Developer & Database Admin Crom

[SQL] create function atof?

2004-02-20 Thread mark
Hello, Is it possible to create a database function that mimics the C function atof? I'm guessing it should look something like this: create function atof(varchar) returns float as '??' language returns null on null input;

Re: [SQL] Date format problems

2004-02-16 Thread Mark Roberts
nd Regards, Mark. >>> Tom Lane <[EMAIL PROTECTED]> 02/16/04 03:34pm >>> "Mark Roberts" <[EMAIL PROTECTED]> writes: > Hi im using the function below to insert data into my db; im using > now() to get the timestamptz, however when inserted in the db the for

[SQL] Tip: a function for creating a remote view using dblink

2004-02-16 Thread Mark Gibson
ames) || '' FROM '' || quote_ident(schema_name) || ''.'' || quote_ident(table_name)) || '') AS rel ('' || trim(trailing '','' from col_defs) || '')''; EXECUTE sql_str; RETURN; END '

  1   2   >