Re: [GENERAL] Geographic data sources, queries and questions

2007-05-28 Thread John D. Burger
same kind of goals we did. Anyway, I will send our schema under separate cover, and I will investigate sending you the data as well. - John D. Burger MITRE ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your

Re: [GENERAL] Geographic data sources, queries and questions

2007-05-28 Thread John D. Burger
he number of US "terms of sovereignty" that exist. Yah, that's my point - some data sources might lump all these together as state/province level entities, and some might not. - John D. Burger MITRE ---(end of broadcast)--- TIP 1: i

Re: [GENERAL] Geographic data sources, queries and questions

2007-05-29 Thread John D. Burger
standards. - John D. Burger MITRE ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Geographic data sources, queries and questions

2007-05-30 Thread John D. Burger
Even ISO country codes are not guaranteed to be stable I'm not sure where the idea that primary keys must be stable comes from. There's nothing necessarily wrong with updating a primary key. All a primary key does is uniquely identify a row in a table. If that id changes over time, that's

Re: [GENERAL] Seq Scan

2007-06-01 Thread John D. Burger
Tyler Durden wrote: I'm having some problems in performance in a simple select count(id) from I have 700 000 records in one table, and when I do: # explain select (id) from table_name; -[ RECORD 1 ] QUERY PLAN | Seq Scan on t

Re: [GENERAL] querying the age of a row

2007-06-07 Thread John D. Burger
Lonni J Friedman wrote: I have a need to determine which rows in a specific table are less than 24 hours old. I've tried (and failed) to do this with the age() function. And on the suggestion of a timestamp column with DEFAULT NOW(): Unfortunately, its too late now. The database (and its ta

Re: [GENERAL] Aggregates

2007-06-21 Thread John D. Burger
er join message using (userid) group by userid, user.name, user.address; As to whether this is faster or prettier than a subquery, I dunno. - John D. Burger MITRE ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send

Re: [GENERAL] Aggregates

2007-06-21 Thread John D. Burger
Richard Huxton wrote: Ah, but this just includes the time of the last message, not its data. Oops, I read the OP's question as "date and time", rather than "data and time". Nevermind. :) - John D. Burger MITRE ---

Re: [GENERAL] date time function

2007-06-29 Thread John D. Burger
nute - does this have to do with the varying number of days in different months? Thanks. - John D. Burger MITRE ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] greatest/least semantics different between oracle and postgres

2007-06-30 Thread John D. Burger
Tom Lane wrote: Anyway, there's no doubt that we can point to the behavior of MAX/MIN as defense for what we made GREATEST/LEAST do, so I'm inclined to leave their behavior alone, at least until such time as they're actually standardized. I don't think I buy this - MIN and MAX are aggregate

Re: [GENERAL] Q:Aggregrating Weekly Production Data. How do you do it?

2007-09-18 Thread John D. Burger
e issues (but I have not looked closely at it). You can also see Wikipedia for one of the most well known, due to Knuth/Wellford: http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance - John D. Burger MITRE ---(end of broadcast)---

Re: [GENERAL] Performance Issues (was: "like" vs "substring" again)

2007-09-18 Thread John D. Burger
tter plan. I don't know the details of your setup, but you can do things like this with any ordered type: where test between '11' and '113' or test >= '114' I know this does not match the exact semantics of your query, but hopefully you get the

Re: [GENERAL] access privileges: grant select on (all current and future tables)?

2007-09-28 Thread John D. Burger
rivileges to tables which do not yet exist, which I discovered in this thread: http://archives.postgresql.org/pgsql-general/2007-02/msg00911.php If you follow the thread, you'll find that one reply pointed to some existing functions for managing this stuff. I found these usef

[GENERAL] Lifting WHERE conditions out of inner select

2007-10-08 Thread John D. Burger
select results were the same in both cases, but I'm willing to believe that's an accident of our data. (Sorry if no one can answer my question without the table definitions, etc. - it seemed worthwhile trying to get away without that for now.) Thanks. - John D. Burger

Re: [GENERAL] Lifting WHERE conditions out of inner select

2007-10-09 Thread John D. Burger
the actual pulling would take some code that doesn't exist now, too, Okay, good to know. The situation is obviously easy to avoid, I just found the contrast surprising. Thanks. - John D. Burger MITRE ---(end of broadcast)--- TIP 1: if

Re: [GENERAL] <> ALL( ... ) and <> ANY ( ... ) didn't behave as expected

2007-10-10 Thread John D. Burger
Richard Broersma Jr wrote: Here is the example that doesn't do what I expect: --find all parents that have a mixture of boys and girls. --but this doesn't return anything SELECT * FROM Parents AS P WHERE 'girl' <> ALL ( SELECT gender FROM Children AS C1

[GENERAL] [OT] xkcd - A webcomic of romance, sarcasm, math, and language

2007-10-12 Thread John D. Burger
DB-related humor: http://xkcd.com/327/ - John D. Burger MITRE ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Selecting K random rows - efficiently!

2007-10-25 Thread John D. Burger
As far as I can tell, all of the proposed solutions lack sample independence. Take the OP's suggested approach of doing something like this: SELECT * FROM mydata WHERE mydata.random_number >= (SELECT RANDOM() OFFSET 0) ORDER BY mydata.random_number ASC LIMIT 100 All you're doing is pi

Re: [GENERAL] select random order by random

2007-11-02 Thread John D. Burger
lumn, despite its renaming. Contrast this with ... order by random; // plain column reference This substantially breaks the principle of least surprise for me. Caveat - this is on 7.4 (sigh), perhaps more modern versions have different behavior. - John D. Burger MITRE

Re: [GENERAL] Array index not used for query on first element?

2007-12-07 Thread John D. Burger
Tom Lane wrote: It seemed reasonable to me that a select on the first element of an array column could use an index on the column, but, as seen in this example, I can't get it to do so: Nope. The operators that go along with a btree index are equality, less than, etc on the whole indexed colu

[GENERAL] How to EXPLAIN statements inside a trigger function?

2007-12-07 Thread John D. Burger
I'm developing some triggers for the first time, and I'm having trouble analyzing their performance. Does anyone have any advice for doing EXPLAIN and the like on statements involving NEW? For instance, I'd like to know what plan PG is coming up with for this fragment of a trigger functio

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

2007-12-08 Thread John D. Burger
So two design patterns for a makeshift UPSERT have been presented - one is to check beforehand, and only insert if the item isn't present already, the other is to do the insert blindly and let PG check for you, and catch any exceptions. I'm also wondering what people's ideas are for a sort

[GENERAL] Array index not used for query on first element?

2007-12-07 Thread John D. Burger
It seemed reasonable to me that a select on the first element of an array column could use an index on the column, but, as seen in this example, I can't get it to do so: => create temp table tempPaths (path int[] primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "

Re: [GENERAL] top posting

2007-12-11 Thread John D. Burger
Quoting the text to which you are responding is often the only way to provide the necessary specific context for your comments. As an illustration, which helps you understand the preceding paragraph better, the extract above, or the mess below? - John D. Burger MITRE On Dec 11, 2007, at 11:54,

Re: [GENERAL] top posting

2007-12-11 Thread John D. Burger
ot;Do you prefer the good x above, or the bad x below?". It's a fair cop (but society's to blame :). Sorry, I thought better of it right after I hit Send. - John D. Burger MITRE ---(end of broadcast)--- TIP 4: Have you search

Re: [GENERAL] Need LIMIT and ORDER BY for UPDATE

2007-12-12 Thread John D. Burger
D. Dante Lorenso wrote: I'd really like to have ORDER BY and LIMIT for UPDATE and DELETE commands. Is this possible? UPDATE invoice i SET reserve_ts = NOW() + '1 hour'::timestamp FROM account a WHERE a.acct_id = i.acct_id AND i.reserve_ts < NOW() AND a.status = 'A' AND i.is_pai

Re: [GENERAL] Better alternative for Primary Key then serial??

2007-12-13 Thread John D. Burger
. It turned out that the natural keys were always positive, so I set up the sequence to range =downward= from 0. - John D. Burger MITRE ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Need LIMIT and ORDER BY for UPDATE

2007-12-13 Thread John D. Burger
ing around such issues, anyway. - John D. Burger MITRE ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] FK check will use index on referring table?

2008-07-24 Thread John D. Burger
sing on one delete). How can I tell what the trigger is doing? I'm using 8.2.5 and I've ANALYZED everything. Thanks. - John D. Burger MITRE -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] ERROR: Could not convert UTF-8 to ISO8859-1

2005-04-28 Thread John D. Burger
r display (xterm, whatever) is set to Latin1, presumably. There are at least three different encoding settings here: how your data is stored in the database, what the server sends to psql, and what your display thinks its getting. These must all be consistent with one anot

Re: [GENERAL] Shorthand for foreign key indices

2005-05-09 Thread John D. Burger
I know that it was decided a fair few releases ago to stop creating an implicit index for each foreign key, By the way, I presume foreign key indices are used to check for referential integrity on insert. Can the query planner also use then somehow? Thanks. - John D. Burger MITRE

Re: [GENERAL] Shorthand for foreign key indices

2005-05-09 Thread John D. Burger
. Is that the case? Thanks. - John D. Burger MITRE ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] numeric precision when raising one numeric to another.

2005-05-20 Thread John D. Burger
I find all these statements about the near-uselessness of NUMERIC^NUMERIC to be pretty amazing. It's fine to say, "no one seems to be asking for this, so we haven't implemented it yet", but, c'mon, folks, Postgres gets used for more than "business cas

Re: [GENERAL] Case insensitive unique constraint

2005-07-15 Thread John D. Burger
ery efficiently. - John D. Burger MITRE ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] GUID for postgreSQL

2005-07-29 Thread John D. Burger
If you use a large enough space for the number you can reduce that probability of an accidental collision to much less than that of catastrophic hardware failure at which point it isn't noticably better than having no chance of collisions. I find the comparison unconvincing - if my hardware cras

Re: [GENERAL] Slow Inserts on 1 table?

2005-08-02 Thread John D. Burger
7;ve gotten around this in a variety of ways, some less principled than others. - John D. Burger MITRE ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Slow Inserts on 1 table?

2005-08-02 Thread John D. Burger
ANALYZE cannot run inside a BEGIN/END block I'll be happy to find out that this restriction's been removed in later versions. - John D. Burger MITRE ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send

Re: [GENERAL] Slow Inserts on 1 table?

2005-08-02 Thread John D. Burger
Your running 7.2? That is all kinds of level of... huh? Why? I'm not running it, my organization is. Not sure how to interpret "all kinds of level of..." Are there any huge suckages that I can use to leverage an update? I'm familiar with some of the smaller ones. -

Re: [GENERAL] Slow Inserts on 1 table?

2005-08-02 Thread John D. Burger
t get their attention. Thanks! - John D. Burger MITRE ---(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

Re: [GENERAL] psqsl -> remote db

2005-08-04 Thread John D. Burger
s it a Mac? If so, and its firewall is on, you may need to open up port 5432. If you have physical access to that machine, you can do this in System Preferences -> Sharing -> Firewall. I can give more details if necessary. - John D. Burger MITRE ---

Re: [GENERAL] Case sensitivity

2005-08-10 Thread John D. Burger
uld strongly suggest you do this instead: LOWER(colname) = LOWER('x') This is far more bullet-proof than lower-casing in the client, in case the client and the server differ (mismatched locales, etc.). If you don't want to use ILIKE for portability reasons (perfectly reasona

Re: [GENERAL] About "ERROR: must be *superuser* to COPY to or from a file"

2005-08-28 Thread John D. Burger
Well, they would have access to every world readable file on the system, ie /etc, /usr, /lib, ... most files are world readable. There's a lot of discussion about this, yet no-one has demonstrated that COPY FROM STDIN isn't just as good and avoids all the issues entirely. Well they're world-re

[GENERAL] max_connections

2005-08-29 Thread John D. Burger
is at least an order of magnitude higher than I need. Would much be saved by dropping this down to 10 or less? I gather I could dial shared_buffers up slightly (SHMMAX is 32M on our Solaris boxes), but is there any substantive benefit to conservatively setting max_connections? Thanks. -

More statistics? [was: [GENERAL] SLOOOOOOOW]

2005-09-05 Thread John D. Burger
t, correct? Thanks. - John D. Burger MITRE ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] SQL - planet redundant data

2005-09-09 Thread John D. Burger
To store the detailed records the SQL novice would construct one table pr. file and exclude any constant columns since these are redundant (given in summary table). These detailed tables would then have different column schemas - (mn,tmp,wind) for ~58%, (hr,mn,tmp,wind) for ~40%, (d_o_y,hr,mn,t

Re: [GENERAL] SQL - planet redundant data

2005-09-12 Thread John D. Burger
f my own data - I don't know why I never thought of it before. - John D. Burger MITRE ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] How to create case insensitive unique constraint

2005-09-21 Thread John D. Burger
I want to disable dupplicate customer names in a database regardless to case. I tried CREATE TABLE customer ( id SERIAL, name CHARACTER(70)); ALTER TABLE customer ADD constraint customer_name_unique UNIQUE (UPPER(name)); but this is not allowed in Postgres As Csaba suggested, a unique fun

[GENERAL] Mysterious query plan

2005-09-27 Thread John D. Burger
ers (cost=0.00..10830971486.25 rows=2935950 width=8) Filter: (subplan) SubPlan -> Seq Scan on tipsterauxiliary (cost=0.00..3330.04 rows=143604 width=0) and appended below is the verbose output. Any explanation is very much appreciated. Thanks! - John

Re: [GENERAL] optimizing common subqueries

2005-10-05 Thread John D. Burger
As I understand it, Postgres's query planner considers only trees of joins - I don't know what the technical implications are of using DAG plans, other than the obvious blowup in planning space. I was recently in a similar situation, where a script essentially needed to do a self-join on the r

[GENERAL] Problems with group by ... order by

2005-10-05 Thread John D. Burger
I can't figure out why the following doesn't work: select (case when count1 < 300 then 'Other' else country1 end) as country2, sum(count1) as count2 from (select coalesce(country, 'None') as country1, count(*) as count1

Re: [GENERAL] Text->Date conversion in a WHERE clause

2005-10-13 Thread John D. Burger
ns to determine whether cust3 is a date ...) as dateCusts where cust3::text::timestamp > CURRENT_DATE - interval '1 month'; - John D. Burger MITRE I have a table that has some columns which store 'custom' fields so the content varies according to the user that the row

[GENERAL] Equivalent queries and the planner

2005-10-14 Thread John D. Burger
be equivalent. I tested the two queries on small data sets, and they do indeed return the same results.) - John D. Burger MITRE explain select gazPlaceID from gazPlaces where gazPlaceID not in (select gazPlaceID from gazContainers);

Re: [GENERAL] [HACKERS] 'a' == 'a '

2005-10-20 Thread John D. Burger
e chapter and verse? Thanks. - John D. Burger MITRE ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Beyond the 1600 columns limit on windows

2005-11-08 Thread John D. Burger
efficient and practical. In fact, it might be the case that mapping from a sparse DB representation to your internal data structures is =more= efficient than naively using the same representation in both places. - John D. Burger MITRE ---(e

Re: [GENERAL] Expected accuracy of planner statistics

2006-09-29 Thread John D. Burger
Tom Lane wrote: The information we've seen says that the only statistically reliable way to arrive at an accurate n_distinct estimate is to examine most of the table :-(. IIRC I picked an equation out of the literature partially on the basis of it being simple and fairly cheap to compute...

Re: [GENERAL] Expected accuracy of planner statistics

2006-09-29 Thread John D. Burger
have been surprised to find such a nice comment pointing me at the literature. - John D. Burger MITRE ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Array assignment behavior (was Re: [ADMIN] Stored procedure array limits)

2006-09-29 Thread John D. Burger
here other languages where sequences behave similarly? > perl -e '@A = (1, 2, 3); print "@A\n"; $A[10] = 10; print "@A\n";' 1 2 3 1 2 310 - John D. Burger MITRE ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] Two efficiency questions - clustering and ints

2006-10-05 Thread John D. Burger
es in [1, 10]. If I'm only comparing within such ratings, and possibly computing floating point averages, etc., what are the good and bad points of using, say, SMALLINT? What about NUMERIC(1) or (2)? Thanks in advance for the usual brilliant replies! - John D. Burg

Re: [GENERAL] Two efficiency questions - clustering and ints

2006-10-06 Thread John D. Burger
ownside= to doing it? Here's a simpler question - for static data, should I always cluster on the index I think will be used the most? Thanks. - John D. Burger MITRE ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] A query planner that learns

2006-10-13 Thread John D. Burger
to optionally use parametric modeling (this column is a Gaussian, let's estimate the mean and variance, this one is a Beta distribution ...). Then the smarter planner could spend some cycles applying more sophisticated statistical modeling to problematic tables/columns. - John D. B

Re: [GENERAL] A query planner that learns

2006-10-16 Thread John D. Burger
Jochem van Dieten wrote: I think you might want to check US Patent 6,763,359 before you start writing any code. http://tinyurl.com/yzjdve - John D. Burger MITRE ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ

Re: [GENERAL] timestamp as primary key?

2006-10-19 Thread John D. Burger
key a composite: PRIMARY KEY (user_id_from, user_id_to, message_time) This should cut way down on the possibility of key collision. - John D. Burger MITRE ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] SQL function inlining

2006-10-19 Thread John D. Burger
I'm having trouble figuring out when (if) the planner inlines sql functions (I'm running 7.4). I was assuming that pure sql functions are kind of like views with parameters, but I can't seem to see any cases where functions that select from a table get inlined. For instance: create func

Re: [GENERAL] CREATE TABLE initial value for PRIMARY KEY

2006-10-30 Thread John D. Burger
Maurice Yarrow wrote: So it turned out to be possible to do it like this: CREATE SEQUENCE id_seq; SELECT setval('id_seq',100111); FYI, you could have done this: CREATE SEQUENCE id_seq START 100111; - John D. Burger MITRE ---(end of

Re: [GENERAL] advanced index (descending and table-presorted descending)

2006-11-22 Thread John D. Burger
suppose) and can take a while. Is there any way to convince the planner that the sorts are unnecessary, and it can just zip the two tables together as is? This is under PG 7.4, by the way. Any comments welcome. - John D. Burger MITRE ---(end of broadcast

Re: [GENERAL] Buffer overflow in psql

2006-11-22 Thread John D. Burger
own problems. Sorry for the pedantry ... - John D. Burger MITRE ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Buffer overflow in psql

2006-11-27 Thread John D. Burger
n the OP's code sample seems problematic in the other direction: sprintf(buf, "%u", (unsigned int)PQoidValue(results)); since unsigned int could be as small as 16 bits, thus truncating the OID value. Ok, I'll stop now, I promise. - John D. Burger MITRE

Re: [GENERAL] NULLs ;-)

2006-11-28 Thread John D. Burger
Scott Ribe wrote: where a <> b or (a is null and b is not null) or (a is not null and b is null) In the absence of IS DISTINCT FROM, I think this has the same semantics: where coalesce(a, b) <> coalesce(b, a) although it's not as concise as one might wish. - John

Re: [GENERAL] NULLs ;-)

2006-11-28 Thread John D. Burger
mething like: coalesce(a, 'SOME MAGIC VALUE') <> coalesce(b, 'SOME MAGIC VALUE') and wanted to make it work for any types. Sigh. - John D. Burger MITRE ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Restore database from files (not dump files)?

2006-12-04 Thread John D. Burger
stallation - note that the above is only guaranteed to work if architecture/compiler/etc. are all the same. If the files were created by exactly the same PG instance, then you should be okay. - John D. Burger MITRE ---(end of broadcast)---

Re: [GENERAL] Male/female

2006-12-08 Thread John D. Burger
Steve Crawford wrote: Of course this breaks apart when dealing with that very rare syndrome (name escapes me) where the child appears female at birth but is actually a male whose male sex-organs descend and appear at puberty so I guess we need to add apparent_sex_at_birth. It turns out ther

Re: [GENERAL] MySQL drops support for most distributions

2006-12-13 Thread John D. Burger
The good thing is that there are several companies supporting Postgres, so whatever one of them does it does not affect the market as a whole. Surely there are also third-party companies that provide "support" for MySqueal in some similar sense? - John Burger MITRE

Re: [GENERAL] MySQL drops support for most distributions

2006-12-13 Thread John D. Burger
Joshua D. Drake wrote: Surely there are also third-party companies that provide "support" for MySqueal in some similar sense? Of course :) but... Fortune 2500+ for the most part will *not* use a third party for support for something like MySQL. Sure, but they won't use PG either, for essenti

Re: [GENERAL] MySQL drops support for most distributions

2006-12-13 Thread John D. Burger
Tom Lane wrote: The other point I'd make against John's argument is that there are a whole lot of Fortune 500 companies buying Red Hat support, and RH is effectively a third party for large chunks of Linux. (Of course, there are also large chunks for which Red Hat employees write as much code a

Re: [GENERAL] Question - Query based on WHERE OR

2007-01-11 Thread John D. Burger
Mike Poe wrote: SELECT foo, baz, bar FROM public.table WHERE lastname ~* '$lastname' OR ssn='$ssn'" I need to leave the last name a wildcard in case someone enters a partial name, lower case / upper case, etc. I want the SSN to match exactly if they search by that. The way it's written, if

Re: [GENERAL] Building web sites using a database

2007-01-17 Thread John D. Burger
Well, you could always start with something like Drupal: http://www.drupal.com I get access denied, seems to be here, rather: drupal.org - John Burger MITRE ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Finding bogus dates

2007-01-18 Thread John D. Burger
y more formats than I'd be likely to dream up on my own. - John D. Burger MITRE ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Example of RETURNING clause to get auto-generated keys

2007-01-24 Thread John D. Burger
Ken Johanson wrote: Just to be sure, will the RETURNING clause work with custom sequences (say, non numeric or increment by two) or other types of key generators?... And how will triggers interfere with it (if at all)? RETURNING has nothing to do with sequences per se - it's just a way

Re: [GENERAL] Limit on number of users in postgresql?

2007-01-29 Thread John D. Burger
ed would be to keep the out-of-memory copies of this kind of data in something faster than a flat file - say Berkeley DB. Do either of these things make sense? - John D. Burger MITRE ---(end of broadcast)--- TIP 3: Have you checked our exte

Re: [GENERAL] Limit on number of users in postgresql?

2007-01-29 Thread John D. Burger
I had some ideas about this slow flat file issue, but it's apparently not yet much of an issue, in fact ... Someone talked about the postmaster having to be "at arms' length" from the actual tables. But I was looking at the postmaster code, and it seems to fork a new backend as soon as sel

Re: [GENERAL] counting query

2007-01-29 Thread John D. Burger
Joris Dobbelsteen wrote: Personally I've found nothing that will beat Excel for doing data analysis. Learn to use the pivot table and pivot charts. They are extremely powerful. Funny, there is an on-going discussion about this on one of our internal mailing lists. Excel is perhaps okay for

Re: [GENERAL] Limit on number of users in postgresql?

2007-01-29 Thread John D. Burger
Tom Lane wrote: Since the tables you need to touch are all shared, it's conceivable that this could be hacked around, but it seems awfully messy. Another consideration is that this'd significantly increase the amount of work done before validating that the connection request is authorized,

Fwd: [GENERAL] How to allow users to log on only from my application

2007-02-01 Thread John D. Burger
quite a lot about the secret. If this is an issue, there are more sophisticated combining schemes that give the user no advantage over someone who knows neither half of the secret. - John D. Burger MITRE ---(end of broadcast)--- TIP 6: e

Re: [GENERAL] How to allow users to log on only from my application

2007-02-02 Thread John D. Burger
s others have observed, a determined user can sniff the compound password out if they really wish. I suspect the only really secure approach is some sort of challenge-response algorithm, or a one-time pad in the application - in either case, whatever the black-hat user sniffs off the wire or

Re: [GENERAL] Production systems beware: U.S. Daylight Savings Time comes at a new time this year

2007-02-05 Thread John D. Burger
Sorry if I'm the only one to find this amusing, but I see that the original message was sent twenty minutes =after= I received it. :) - John D. Burger MITRE ---(end of broadcast)--- TIP 3: Have you checked our extensiv

[GENERAL] Recover anything from dropped database?

2007-02-14 Thread John D. Burger
With a slip of the keyboard, I just dropped a database I'd like to have back. I don't have PITR or anything turned on - if nothing else has been done to the cluster since then, is there any way to recover anything at all? Thanks. - John Burger MITRE ---(end of b

Re: [GENERAL] Recover anything from dropped database?

2007-02-14 Thread John D. Burger
John D. Burger wrote: With a slip of the keyboard, I just dropped a database I'd like to have back. I don't have PITR or anything turned on - if nothing else has And no backups? been done to the cluster since then, is there any way to recover anything at all? I have a backup

Re: [GENERAL] Recover anything from dropped database?

2007-02-15 Thread John D. Burger
I have a backup as of last night, but I'd like to recover something more recent if I can. If I'm stuck with the backup, I can just stop the postmaster, drop the whole PG directory into place from the backup, and restart, yes? I presume from the near-deafening silence there's nothing else I

[GENERAL] Anticipatory privileges

2007-02-16 Thread John D. Burger
? Thanks. - John D. Burger MITRE ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Anticipatory privileges

2007-02-17 Thread John D. Burger
Alvaro Herrera wrote: If I am reading the (7.4) docs correctly, privileges can be granted only with respect to tables that exist at the time the GRANT command is given Yes. In fact, I have to individually grant access to each table, and any associated sequences, yes? How dangerous is it

Re: [GENERAL] Anticipatory privileges

2007-02-17 Thread John D. Burger
Tom Lane wrote: How dangerous is it to UPDATE pg_class directly, perhaps copying the relacl column for a table that I've done by hand with GRANT. You can do it, and it will seem to work. However, unless you also make entries in pg_shdepend, bad things will happen if you later drop any of

Re: [GENERAL] Native type for storing fractions (e.g 1/3)?

2007-03-15 Thread John D. Burger
brary that provides rationals, or model my code closely after one. - John D. Burger MITRE ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Fwd: [GENERAL] Native type for storing fractions (e.g 1/3)?

2007-03-15 Thread John D. Burger
rithms pretty easily. I haven't looked, but I would be surprised if there was much OOP in the rational code, it might be fairly trivial to "dumb it down" to C. - John D. Burger MITRE ---(end of broadcast)--- TIP 3: Have y

Re: [GENERAL] planning issue

2007-03-19 Thread John D. Burger
create a function lower index and instead of calling ilike call ~ lower('123') To clarify a little: CREATE INDEX table_a_lower_field_1_idx on table_a ((lower(field_1))); CREATE INDEX table_a_lower_field_2_idx on table_a ((lower(field_2))); SELECT * FROM table_a WHERE id

[GENERAL] LISTEN/NOTIFY and python

2007-03-20 Thread John D. Burger
under the covers, so my client doesn't spin up the cpu? (Yes, I know I could poll-sleep-poll-sleep - that's what I'll do if there's nothing cleaner.) - John D. Burger MITRE ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] LISTEN/NOTIFY and python

2007-03-20 Thread John D. Burger
for the pointers toward this solution. - John D. Burger MITRE ---(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

Re: [GENERAL] Timestamp precision

2007-03-29 Thread John D. Burger
binary exchange of timestamps is complicated. What does libpq do now with timetamps, if the client requests data in binary form? How does the client know whether it's getting floats or integers? - John D. Burger MITRE ---(end of broadcast)-

Re: [GENERAL] Deleted Flag/Unique Constraint

2007-03-29 Thread John D. Burger
On Mar 29, 2007, at 17:39, Bryan Murphy wrote: Is it possible to declare a unique constraint in combination with a deleted flag? For example, if I have a table like this: CREATE TABLE ( ID NOT NULL PRIMARY KEY, Key VARCHAR(32) NOT NULL, Value VARCHAR(32) NOT NULL, Deleted INT NOT NUL

Re: [GENERAL] Deleted Flag/Unique Constraint

2007-03-29 Thread John D. Burger
Bryan Murphy wrote: I think the other guys suggestion will work better. ;) Good lord, yes. Dunno what I was thinking - I use partial indexes all the time, and I know a unique constraint is implemented with an index. Just got carried away, I guess. :) - John Burger MITRE

Re: [GENERAL] COPY FROM - how to identify results?

2007-04-03 Thread John D. Burger
nextval() and sequences are not what I'm looking for. I want to assign the same id to all the rows imported from the same file. Let's say user A is working on portfolio_id 3, and decides to upload a spreadsheet with new values. I want to be able to import the spreadsheet into the staging ta

  1   2   >