Re: [GENERAL] Quick-and-Dirty Data Entry with LibreOffice3?

2011-09-27 Thread Rich Shepard
database to LO. All my postgresql databases are in /usr/local/pgsql/data/base/ in numbered subdirectories. I've no idea in which one resides the database I want. Is there a way to determine where my database is located? Thanks, Rich -- Sent via pgsql-general mailing list (pgsql-ge

Re: [GENERAL] Quick-and-Dirty Data Entry with LibreOffice3?

2011-09-27 Thread Rich Shepard
mation anywhere. Guess the most practical thing to do is give up trying to use LO as a front end. I'll just write INSTALL INTO ... statements in emacs then use psql to read them into the table. Thanks all, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] Quick-and-Dirty Data Entry with LibreOffice3?

2011-09-28 Thread Rich Shepard
uot;localhost") (setq sql-postgres-options '("-Uyourusername" "-P" "pager=off")) I'll look for sql-postgres if it will allow me to add rows to an existing table. Many thanks, Rich -- 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] Quick-and-Dirty Data Entry with LibreOffice3?

2011-09-30 Thread Rich Shepard
On Fri, 30 Sep 2011, Vincent Veyron wrote: You get a lot more : this gives you an interface to Postgresql inside an Emacs buffer. Thank you. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

[GENERAL] Selecting All Columns Associated With Maximum Value of One Column

2011-10-05 Thread Rich Shepard
ect that retrieving these data requires nested SELECT statements, and I'd appreciate learning how to retrive such data. Rich -- 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] Selecting All Columns Associated With Maximum Value of One Column

2011-10-06 Thread Rich Shepard
mistry where param = 'TDS' and str_name = 'BurrowCrk') Chris, Thank you. I missed seeing the latter part. This returns 0 rows, but it puts me on the right track. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscript

Re: [GENERAL] Selecting All Columns Associated With Maximum Value of One Column

2011-10-06 Thread Rich Shepard
.5 so I'll carefully read that and upgrade from 9.0.4 (which may also have this function; I'll check). Thanks, Rich -- 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] Selecting All Columns Associated With Maximum Value of One Column

2011-10-06 Thread Rich Shepard
stry; ERROR: column "str_name" does not exist LINE 1: select str_name, site_id, sample_date, param, max(quant) ove... ^ What am I doing incorrectly here? Also, with the window function can I limit the output to a single str_name and param? Rich -- Sent via pgsql-gener

Re: [GENERAL] Selecting All Columns Associated With Maximum Value of One Column

2011-10-06 Thread Rich Shepard
ng for. Though era ing the window query and then adding a (where quant_max = quant) clause would get you closer; quant_max being the column alias for the window expression. Ah. Thanks, David, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

[GENERAL] SELECT statement not working as intended

2011-10-10 Thread Rich Shepard
201 CalifCrk| CalCrk | 1996-09-27 |185 when what I want is only the third line. A clue to the correct syntax is solicited. I'm sure it's something simple that I'm just not seeing. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] SELECT statement not working as intended

2011-10-10 Thread Rich Shepard
? Thanks, Rich -- 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] SELECT statement not working as intended

2011-10-10 Thread Rich Shepard
On Mon, 10 Oct 2011, Henry Drexler wrote: you are also grouping by sample date, those are the largest values for the criteria you have set out in the group by. Henry, As I asked Merlin, what is necessary to get the date that maximum quantity was recorded? A nested SELECT? Thanks, Rich

Re: [GENERAL] SELECT statement not working as intended

2011-10-10 Thread Rich Shepard
On Mon, 10 Oct 2011, John R Pierce wrote: the complication is, there can be more than one date with the same maximum value, so such a query would be ambiguous, or it would return multiple rows. John, The likelihood of that is diminishingly small. Thanks, Rich -- Sent via pgsql-general

[GENERAL] psql died in midst of session

2011-10-12 Thread Rich Shepard
ess failure [1]+ Exit 1 postgres -D /usr/local/pgsql/data pg_xlog is owned by postgres.users and has permissions 755. The /tmp/.S file is not present, either. Please advise me how to recover from whatever happened so I can get postgres up and running again. Thanks,

Re: [GENERAL] psql died in midst of session [FIXED]

2011-10-12 Thread Rich Shepard
On Wed, 12 Oct 2011, Rich Shepard wrote: Please advise me how to recover from whatever happened so I can get postgres up and running again. Fixed. I noticed that the referenced pg_log/ file was owned by root.root rather than by postgres.users so I chown and that did the trick. Strange

Re: [GENERAL] I need to load mysql dump to postgres...

2011-10-13 Thread Rich Shepard
the recommended changes or deletions. Repeat until the entire database or table has been imported. For a one-time conversion it's quicker to do this manually than to spend time trying to find a pre-built solution. If you'll be doing this again, take good notes and the next one will be a b

[GENERAL] Populate Table From Two Other Tables

2012-06-05 Thread Rich Shepard
. Since the string length of site/siteid varies I don't see how to cast both to a working type. Please suggest how I can populate this table while avoiding the operator error. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Populate Table From Two Other Tables

2012-06-05 Thread Rich Shepard
tream and basin columns to the chemistry.txt file. That also eliminates having to export the combined table to a text file. Thanks, Rich -- 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] Populate Table From Two Other Tables

2012-06-05 Thread Rich Shepard
running the script after correcting errors so there should not be a previous row with the same values. Puzzling, Thanks, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
m sites. My proposed statement is, UPDATE waterchem SET waterchem.easting, waterchem.northing = sites.easting, sites.northing FROM sites AS s WHERE waterchem.site = s.name; Is this correct? If not, what approach should I adopt? Rich -- Sent via pgsql-general mailing list (pgsql-general@pos

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
hanks for the correction, Rich -- 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] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
= s.easting northing = s.northing FROM sites AS s WHERE waterchem.site = s.name; The target does not want the table name repeated; postgres looks for a column named 'waterchem.easting'. Regards, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To ma

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
On Tue, 12 Jun 2012, David Johnston wrote: And, to be thorough, you need to put commas between each field you want to update. Did that. Didn't write it that way in the message. Regards, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

[GENERAL] Finding Duplicate Rows during INSERTs

2012-07-09 Thread Rich Shepard
scroll to see them. There must be a better way of doing this. Can I run psql with the tee command to capture errors in a file I can examine? What is the proper/most efficient way to identify the duplicates so they can be removed? TIA, Rich -- Sent via pgsql-general mailing list (pgs

Re: [GENERAL] Finding Duplicate Rows during INSERTs

2012-07-09 Thread Rich Shepard
ht that I had eliminated duplicates in the raw file, but with 128K rows I obviously missed many. Thanks, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Select Rows With Only One of Two Values

2012-07-20 Thread Rich Shepard
reciate learning how to write it. Rich -- 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] Select Rows With Only One of Two Values [RESOLVED]

2012-07-20 Thread Rich Shepard
On Sat, 21 Jul 2012, Chris Angelico wrote: Try this: SELECT DISTINCT param FROM table WHERE indicator=0 EXCEPT SELECT DISTINCT param FROM table WHERE indicator=1 Chris, Thank you. I knew it was simple, and I've not before used the EXCEPT condition. Very much appreciate, Rich --

[GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
All thoughts, suggestions, and recommendations based on your expertise and experience will be most welcome. TIA, Rich -- 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] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
company's stock price by changing assay results. Rich -- 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] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
advice and guidance. Many thanks! Rich -- 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] Avoiding surrogate keys

2010-04-21 Thread Rich Shepard
I'd have name, email, country, status 'mr smith', 'emailaddr...@example.com', 'China', 'Registered' 'mrs jones', 'm...@emailcompany.com', 'Belgium', 'Unconfirmed' Sure. Are there any serious downsides to this

Re: [GENERAL] PostgreSQL vs. Microsoft SQL server

2010-05-01 Thread Rich Shepard
your proposed vendor and have them back up the answers with meaningful support, not marketing fluff from Redmond. Rich -- 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] two different posgres t for Rails development?

2010-08-28 Thread Rich Shepard
rtner, you're correct. It doesn't use SQL, but it's own embedded language. And, while postgres can be used, he prefers mysql and that's directly supported by Rails. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Need help with constraint to prevent overlaps

2008-07-11 Thread Adam Rich
> > I'm building a shift-scheduling app. I want to make a constraint in my > database that prevents one human from being assigned to work two > different jobs at the same time. > > In other words, if I schedule John Doe to mop bathrooms from 10 AM > until > 4 PM, some other manager will not be a

Re: [GENERAL] Complicated GROUP BY

2008-07-11 Thread Adam Rich
> > Dear All, > > I have the following problem with grouping: I want to know the maximum > in a group as well as the maximal element. Example: > > I have a table products_providers: > product | provider | criteria_1 | criteria_2 > > I have a number of products, each of them from a several

Re: [GENERAL] Whassup with this? (Create table xxx like yyy fails)

2008-07-19 Thread Adam Rich
> > childrensjustice=# create table petition_bail like petition_white; > ERROR: syntax error at or near "like" > LINE 1: create table petition_bail like petition_white; > > Huh? > > Yes, the source table exists and obviously as postgres superuser > ("pgsql") I have select permission on the par

[GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-22 Thread Rich Shepard
't write it). Regardless, if I learn why there's a problem I can fix the script and avoid this delay and hassle restarting postgres after the daemon's been shut down. TIA, Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecosystem Servic

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-22 Thread Rich Shepard
;. If I delete that file, is it automatically recreated? I'm using /usr/bin/pg_ctl as user postgres. Thanks, Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecosystem Services, Inc.|Innovation <http://www.appl-ecosys.com>

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-22 Thread Rich Shepard
no pidfile, and no postmaster process. In the past I've managed to start the postmaster daemon manually, but today I seem to have it FUBARed. Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecosystem Services, Inc.|Innovati

Re: [GENERAL] Optimizing a like-cause

2008-07-22 Thread Adam Rich
> > Hello, > > I'm developing a autocomplete Feature using php and PostgreSQL 8.3. > To fill the autocomplete box I use the following SQL Statement: > select * from _table_ where upper( _field_ ) like '%STRING%'; > > This SQL Statement takes 900 ms on a Table with 300.000 entries. > > What can

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-22 Thread Rich Shepard
2 I upgraded postgres manually, not creating and using a Slackware package. It worked just fine until yesterday's reboot. Thanks, Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecosystem Services, Inc.|Innovation <htt

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-22 Thread Rich Shepard
HINT: It looks like you need to initdb. I still have the old pgsql (8.1.13) still in a non-standard directory. I had run initdb after cleaning up the upgrade. Should I do so again? Thanks, Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecos

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-26 Thread Rich Shepard
unning once again. My question is how best to modify the startup script so the postmaster fires up when the system is rebooted. I don't see an option to 'su' to specify the postgres user's password so I can script this. Have you any recommendation? Thanks, Rich -- Richard

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-26 Thread Rich Shepard
t the postmaster after the system reboot. I can try twiddling with the script; it calls pg_ctl, and that should work, but apparently something broke last week. Thanks, Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecosystem Services

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-26 Thread Rich Shepard
On Sat, 26 Jul 2008, Tom Lane wrote: Startup scripts invariably run as root, so 'su' isn't going to ask for a password... Tom, That occurred to me after I wrote the message. Think that I'll tune the script to use a command that I know is working with 8.3.3. Many thank

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-27 Thread Rich Shepard
s attached... You may need to change the dirs in the script yet a bit. Thank you. I think that for some reason using pg_ctl to start the postmaster is no longer working here. As I have time, I'll look into why. Rich -- Richard B. Shepard, Ph.D. | IntegrityCred

Re: [GENERAL] Problems Restarting PostgreSQL Daemon

2008-07-27 Thread Rich Shepard
1/pg_ctl.1 and /usr3/pg813 is not in anyone's path. It's a data storage filesystem and holds the earlier version during the upgrade. And, now that 8.3.3 is running, I'll remove that directory. Postgres' path is: /bin:/usr/bin:/home/postgres/bin:/sbin:/usr/sbin. Ric

Re: [GENERAL] a SQL query question

2008-07-28 Thread Adam Rich
> > Hi, I have a table of the form > > aid pid nmol > - --- --- > 123 34 > 245 3445 > 323 100 > 478 12 > 545 14 > 645 200 > 7null null > > In general, aid is unique, pid and nmol are non-unique. > > What I'm trying to do is to select those rows w

Re: [GENERAL] index speed and failed expectations?

2008-08-04 Thread Adam Rich
> This query from the console: > > select * from stats order by start_time; > > takes 8 seconds before starting its output. Am I wrong in assuming that > the index on start_time should make ORDER BY orders of magnitude > faster? > Or is this already fast enough? Or should I max up some memory (bu

[GENERAL] time math - Bug or expected behavior?

2008-08-26 Thread Adam Rich
I traced a bug in our application down to this basic operation: set timezone to 'US/Eastern'; select '11/02/2008'::timestamptz, '12:10'::time, '11/02/2008'::timestamptz + '12:10'::time; I have a date and a time stored separately and I want to combine them, and use them in some timezone-aware cal

Re: [GENERAL] date range query help

2008-11-19 Thread Adam Rich
> Now user Ben has passed his mobile to user Josh and we issued Josh his > mobile on 2008-10-15. > > 1. Is it possible for me to write a query that will have the fields > > call.call_id, > call.datetime, > mobile_custodian.user_id, > call.mobile_no > call.charge > > that will use call.datetime a

Re: [SQL] [GENERAL] date range query help

2008-11-19 Thread Adam Rich
> >> sorry I get nothing :( > > > > Of course not. None of the dates you gave in the example overlap. > > > > But it should still have the 1st entry with the name Ben? Am I > missing something? Ben's issue dates are in the year 2008. The first call entry is in the year 2007. There are no cust

Re: [GENERAL] why hash on the primary key?

2008-11-28 Thread Adam Rich
> I'm seeing a lot of plans in my database that look like this: > It seems very strange for the planner to decide to build an in-memory > hash table on a column that is already indexed (the primary key, no > less!). But this is happening A LOT - I often see plans where a > majority of the joins ar

[GENERAL] calling a function over several rows

2009-11-16 Thread Adam Rich
Hello, There is an existing function which takes an integer and returns a record. I need to call this function with every integer in a table. Is there a simple shortcut for doing this? I'm looking for something like: select f.* from function(t.value) f, table t Thanks, Adam -- Sent vi

Re: [GENERAL] calling a function over several rows

2009-11-16 Thread Adam Rich
Merlin Moncure wrote: On Tue, Nov 17, 2009 at 1:02 AM, Adam Rich wrote: Hello, There is an existing function which takes an integer and returns a record. I need to call this function with every integer in a table. Is there a simple shortcut for doing this? I'm looking for something

Re: [GENERAL] Any Good Postgresql Courses Offered in the US Area?

2010-02-04 Thread Rich Shepard
ou an application developer who needs to learn SQL? Are you a technical person who supports postgres users? Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Syntax To Create Table As One In Another Database

2011-11-15 Thread Rich Shepard
this information. TIA, Rich -- 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] Syntax To Create Table As One In Another Database

2011-11-15 Thread Rich Shepard
did was display the schema for the table, then use it to create a similar table in the new database. Thanks, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Blank Numeric Column For INSERT

2011-11-23 Thread Rich Shepard
x27;, and another term I don't recall but found nothing. An example: psql:wq.sql:8121: ERROR: syntax error at or near "," LINE 1: ...its) VALUES (214,'SW-6','1992-11-25','oil_grease', ,'mg/L'); What is the approprate way to represent t

Re: [GENERAL] Blank Numeric Column For INSERT

2011-11-23 Thread Rich Shepard
On Wed, 23 Nov 2011, Richard Broersma wrote: My pg.dump files show nulls as: \N Richard, Mine do, too. But, that's not what postgres wants to see in the .sql file. It takes it as a newline (\n) whether quoted or not. Thanks, Rich -- Sent via pgsql-general mailing list (pgsql-ge

Re: [GENERAL] Blank Numeric Column For INSERT

2011-11-23 Thread Rich Shepard
Tom, I must have written Null rather than NULL yesterday evening. That's why it didn't work for me. Must be some other glitches but they scroll up too quickly to read. I'll fix those next. Many thanks. Happy Thanksgiving. Rich -- Sent via pgsql-general mailing list (pgs

[GENERAL] Recommended Protocol: Adding Rows to Table

2011-11-25 Thread Rich Shepard
n the proper way to accomplish this task. Suggestions, recommendations, and your experiences are requested. TIA, Rich -- 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] Recommended Protocol: Adding Rows to Table

2011-11-25 Thread Rich Shepard
x27;s point of a PK, isn't it? There should be only one row with that specific set of column values. The additional columns are unique to that set of PK values. Thanks, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscrip

Re: [GENERAL] Recommended Protocol: Adding Rows to Table

2011-11-25 Thread Rich Shepard
nd one in the fourth quarter. Thanks, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Single Table Select With Aggregate Function

2012-01-03 Thread Rich Shepard
must be in the 'group by' clause. Obviously the syntax is more complex than I thought it would be and I would like a pointer to the correct way to write these queries. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Single Table Select With Aggregate Function

2012-01-03 Thread Rich Shepard
t, too. Much appreciated, Rich -- 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] Single Table Select With Aggregate Function

2012-01-03 Thread Rich Shepard
On Wed, 4 Jan 2012, Ondrej Ivanič wrote: window functions might be helpful: http://www.postgresql.org/docs/9.1/static/tutorial-window.html Thanks. I'll carefully read this. Much appreciated, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chang

[GENERAL] Interval ordering

2012-01-29 Thread Adam Rich
Hello, I have a table with a list of times. When the user provides my application with a desired time, I want to show them the 5 times from the table that are closest to their input. I expected to do this using abs() like such: select mytime from mytable order by abs(usertime-mytime) asc l

Re: [GENERAL] Interval ordering

2012-01-29 Thread Adam Rich
> How about something like: > test(5432)aklaver=>SELECT ts_fld2,now()-ts_fld2 from timestamp_test order by > now()-ts_fld2 limit 5; Thanks Adrian, Let me explain the problem better. Say my table has 24 entries, one for each hour, midnight through 11 pm. If the user enters "6:30 PM", I want to

Re: [GENERAL] Interval ordering

2012-01-29 Thread Adam Rich
>> try this: >> select mytime from mytable order by abs(extract(epoch from >> (usertime-mytime))) asc limit 5; >> SELECT ts_fld2,abs(extract(epoch from '2011-03-25 >> 14:15:25-07'::timestamptz)-extract(epoch from ts_fld2)) from timestamp_test >> order >> by abs(extract(epoch from '2011-03-25 >

[GENERAL] Strategy for Primary Key Generation When Populating Table

2012-02-09 Thread Rich Shepard
e table? If not, or if there's a better way of approaching this task, please clue me in to that. TIA, Rich -- 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] Strategy for Primary Key Generation When Populating Table

2012-02-09 Thread Rich Shepard
Joe Celko taught me to seek natural keys whenever they might exist. They don't here. That's why I specifically mentioned that in my message. The only 'broken client tools' are their consistent uses of Microsoft Excel to store data or providing text reports in pdf with other da

Re: [GENERAL] Strategy for Primary Key Generation When Populating Table

2012-02-09 Thread Rich Shepard
t know for sure. Thanks, Rich -- 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] Strategy for Primary Key Generation When Populating Table

2012-02-09 Thread Rich Shepard
levels are used. Not all organisms can be identified to species; some (such as the round worms, or nematodes) are at the level of order. That means there is no combination of columns that are consistently not NULL. Sigh. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] Strategy for Primary Key Generation When Populating Table

2012-02-09 Thread Rich Shepard
y define a unique key for each row. Rich -- 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] what Linux to run

2012-02-28 Thread Rich Shepard
ly helpful to everyone. Good decision. Now make it happen. :-) Rich -- 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] what Linux to run

2012-02-28 Thread Rich Shepard
iliar allow you to select the applications to upgrade so you can avoid surprises. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Valid Input Syntax for Type DATE

2012-02-29 Thread Rich Shepard
hen I have missing date of the date and time types, how do I validly represent them in the input file? Rich -- 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] Valid Input Syntax for Type DATE

2012-02-29 Thread Rich Shepard
e to worry which columns are set to NOT NULL. This assumes that the NOT NULL columns have default values assigned to them, which is a good idea. Thank you both. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.post

[GENERAL] Move Tables From One Database to Another

2012-03-29 Thread Rich Shepard
ntax and approaches. Your advice will be appreciated. Rich -- 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] Move Tables From One Database to Another

2012-03-29 Thread Rich Shepard
e.sql'. That works. Thanks, Rich -- 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] Move Tables From One Database to Another

2012-03-29 Thread Rich Shepard
On Thu, 29 Mar 2012, Andy Colson wrote: How many tables are we talking about. If its a few tables, I'd rename them: alter table lake rename to lake_old; ... etc then dump it out and restore into the proper db. Andy, This will work just fine. Thanks for the insight. Rich -- Sen

[GENERAL] Formatting time for INSERT INTO

2012-04-25 Thread Rich Shepard
The table has a column 'coll_time' of type time without time zone. New rows for the table are in a .sql file and the time values throw an error at the colon between hours:minutes. Do time values need to be quoted? TIA, Rich -- Sent via pgsql-general mailing list (pgs

Re: [GENERAL] Formatting time for INSERT INTO

2012-04-25 Thread Rich Shepard
On Wed, 25 Apr 2012, Ben Chobot wrote: Yes, (date)time values need to be quoted as if they were strings. Thanks, Ben. I thought that was the case but wanted to confirm it. Much appreciated, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

[GENERAL] Problems With Bad PID and Missing Socket

2008-12-08 Thread Rich Shepard
postgresql, there is no domain socket .s.PGSQL.5432 in /tmp. How do I get it back? Perhaps related to this, when I restart postgres I see: Starting PostgreSQL 19895 PostgreSQL daemon already running and I don't understand why the daemon is already running if I shut down the application. Ric

Re: [GENERAL] Problems With Bad PID and Missing Socket -- UPDATE

2008-12-08 Thread Rich Shepard
On Mon, 8 Dec 2008, Rich Shepard wrote: I upgraded the distribution on my system and am now having problems opening a local application. /var/log/apache/error.log shows: More insight. When I stop the postmaster I see this: [EMAIL PROTECTED] ~]# /etc/rc.d/rc.postgresql stop Shutting down

Re: [GENERAL] Problems With Bad PID and Missing Socket -- UPDATE

2008-12-08 Thread Rich Shepard
have inadvertenly deleted it. Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecosystem Services, Inc.|Innovation <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863 -- Sent via pgsql-general mailing list (pg

Re: [GENERAL] SELECT DISTINCT ... ORDER BY problem

2008-12-08 Thread Adam Rich
> > > > When we get windowing functions, a lot of this pain will go away :) > > > > Yes! Hope it won't be too long now. The patch seems to behave like it > should > now :) > Hopefully we'll see it commited for 8.4. > > Though this does not look too much cleaner at least it's standard SQL: > > A

Re: [GENERAL] Problems With Bad PID and Missing Socket -- FIXED

2008-12-08 Thread Rich Shepard
On Mon, 8 Dec 2008, Rich Shepard wrote: I had this happen several years ago, but do not recall what fixed the bad PID file and socket. The thread had been saved here, but I must have inadvertenly deleted it. Figured out how to fix the problem, but still cannot get SQL-Ledger to load. Time

Re: [GENERAL] Problems With Bad PID and Missing Socket -- FIXED

2008-12-08 Thread Rich Shepard
(/etc/rc.d/rc.postgresql). That command line is in the 'start' section of the script so I have no idea why it didn't work that way. Sigh. Still no access to localhost/sql-ledger/login.pl and that's critical for me. Rich -- Richard B. Shepard, Ph.D. | Integr

Re: [GENERAL] Multi-table CHECK constraint

2008-12-10 Thread Adam Rich
> On Wed, Dec 10, 2008 at 05:58:08PM -0600, Jason Long wrote: > > I need to add some complex constraints at the DB. > > > > For example. > > > > Do not allow a line item of inventory to be changed if it does not > > result in the same number of joints originally shipped. > > > > These will involve

Re: [GENERAL] Relational database design book

2008-12-14 Thread Rich Shepard
ad Rick van der Laans's "Introduction to SQL, 4th Edition." It's a very large book chock full of detailed information written very well. Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecosystem Services, Inc.|Inn

Re: [GENERAL] View vs Constantly Updated Table

2008-12-15 Thread Adam Rich
> if i have a "column" that is a calculation, say a bank balance -> sum > of all the debits and credits...is it more efficient to make a view > that executes the underlying calc query doing the math, or to create a > table that has a column called balance that is updated for each > transaction? >

Re: [GENERAL] Ordering returned rows according to a list

2008-12-22 Thread Adam Rich
> > Hi all, > > I'd like to make a single query that returns a number of rows using a > 'WHERE id IN ()' condition, but I'd like the rows to be > returned in the order in which the ids are given in the list. > > Is this possible? > Depending on how many IDs you have in your list, you can accom

Re: [GENERAL] How to use index in strpos function

2008-12-30 Thread Adam Rich
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Tuan Hoang Anh > Sent: Tuesday, December 30, 2008 10:49 PM > To: pgsql-general@postgresql.org > Subject: [GENERAL] How to use index in strpos function > > I have ta

Re: [GENERAL] Indexing columns with low cardinality: persistent bitmap indexes?

2009-01-12 Thread Adam Rich
> > Hello, > > > > I have a column with a small number of distinct values, indexing this one > > with a standard BTree is useless. How do I can index this column > > efficiently? I searched and it seems that pg doesn't support the creation of > > persistent bitmap indexes... Is that feature planne

Re: [GENERAL] Pet Peeves

2009-01-31 Thread Adam Rich
On Thu, 29 Jan 2009 13:16:17 + Gregory Stark wrote: > So, what do people say? Is Postgres perfect in your world or does it > do some things which rub you the wrong way? I see all the major ones have already been mentioned, so here's some minor ones. - lack of system-level and DDL triggers

Re: [GENERAL] Pet Peeves

2009-02-01 Thread Adam Rich
> On Saturday 31 January 2009 8:47:28 pm Adam Rich wrote: > > On Thu, 29 Jan 2009 13:16:17 + > > > > Gregory Stark wrote: > > > So, what do people say? Is Postgres perfect in your world or does > it > > > do some things which rub you the wrong

Re: [GENERAL] field with Password

2009-02-04 Thread Adam Rich
> >> I would like to create a new table where one of the field would be a > >> user password. Is there any data type for supporting this > >> functionality? Something like Password DataType. I've taken a look > of > >> the available data types in PgAdmin Application and there is nothing > >> simila

Re: [GENERAL] ramblings about password exposure (WAS: field with Password)

2009-02-04 Thread Adam Rich
> On Wed, Feb 04, 2009 at 09:34:56AM -0500, Raymond C. Rodgers wrote: > > You don't need to depend on an external library for this > functionality; > > it's built right into Postgres. Personally, in my own apps I write in > > PHP, I use a combination of sha1 and md5 to hash user passwords, > > wit

<    1   2   3   4   5   6   7   8   >