Re: [GENERAL] Selective backup script

2011-11-21 Thread Michael Glaesemann
On Nov 21, 2011, at 11:50, Mike Blackwell wrote: Might there be a way to tag those databases somehow so the backup script knows to skip them? Add a table to each database that can be queried by the back up script to store this additional metadata? Michael Glaesemann grzm seespotcode net

Re: [GENERAL] Performance degradation 8.4 - 9.1

2011-11-17 Thread Michael Glaesemann
) AND e1.type = 1 WHERE jobid = 1132730; Michael Glaesemann grzm seespotcode net -- 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] Saving score of 3 players into a table

2011-10-27 Thread Michael Glaesemann
On Oct 27, 2011, at 7:21, Alexander Farber wrote: Thank you Michal and others - On Wed, Oct 26, 2011 at 11:11 PM, Michael Glaesemann g...@seespotcode.net wrote: Get games for a particular user: SELECT g.gid, g.rounds, g.finished FROM pref_games g JOIN pref_scores u USING (gid

Re: [GENERAL] Saving score of 3 players into a table

2011-10-26 Thread Michael Glaesemann
= :id; Now, add the participants for those games SELECT g.gid, g.rounds, g.finished, p.id, p.money, p.quit FROM pref_games g JOIN pref_scores u USING (gid) JOIN pref_scores p USING (gid) WHERE u.id = :id; Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing

Re: [GENERAL] Saving score of 3 players into a table

2011-10-25 Thread Michael Glaesemann
on your app, you might also have finished_games and game_player_results tables. Michael Glaesemann grzm seespotcode net -- 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] function XXX already exists with same argument types

2011-10-05 Thread Michael Glaesemann
The 1st waring is ok, as I've run create language plpgsql before. But why do I get the function warings? Likely someone mistakenly added the functions to template1 of the machine you're restoring onto and they're getting added to the new database when it's created. Michael Glaesemann grzm

Re: [GENERAL] tubles matching

2011-09-28 Thread Michael Glaesemann
. I want to write a pgplsql function to do this Job by iterating through all the coloumns and compare the values. Is there another way to do that ? SELECT * FROM a NATURAL JOIN b; Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] Quick Date/Time Index Question

2011-09-22 Thread Michael Glaesemann
operator rather than =, if you're selecting items, such as BETWEEN or = and , such as WHERE field = date0 AND field date0 + 1 This would use an index on the timestamp column. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] Book

2011-07-20 Thread Michael Glaesemann
On Jul 20, 2011, at 18:11, Andrej andrej.gro...@gmail.com wrote: Can anyone recommend PostgreSQL 9.0 High Performance by G. Smith? Yes. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] pipe text to copy statement stdin input

2011-06-21 Thread Michael Glaesemann
not be possible. Right? Use a .pgpass file Michael Glaesemann grzm seespotcode net -- 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] counterintuitive behaviour in pl/pgsql

2011-05-21 Thread Michael Glaesemann
On May 21, 2011, at 13:44, Pavel Stehule wrote: 2011/5/21 Michael Glaesemann g...@seespotcode.net: It looks like it's just column names stomping on variable names, which is a known issue. This is why a lot of developers (including myself) have conventions of prefixing parameters

Re: [GENERAL] counterintuitive behaviour in pl/pgsql

2011-05-21 Thread Michael Glaesemann
). Michael Glaesemann grzm seespotcode net -- 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] PostgreSQL Core Team

2011-04-27 Thread Michael Glaesemann
On Apr 27, 2011, at 14:48, Dave Page wrote: I'm pleased to announce that effective immediately, Magnus Hagander will be joining the PostgreSQL Core Team. Congratulations, Magnus! Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] forums.postgresql.com.au

2011-04-06 Thread Michael Glaesemann
I frequented the Ruby mailing lists, I ended up purposely filtering out the posts coming from the forum. I found the forum postings to be of much lower quality than the ones coming through the mailing list. Granted, this is anecdotal, and based on my own personal experience. Michael Glaesemann

Re: [GENERAL] adding years to a date field

2011-04-06 Thread Michael Glaesemann
. select (current_timestamp at time zone 'utc' + CAST(3 AS SMALLINT) * interval '1 year'); ?column? 2014-04-06 16:27:30.273562 (1 row) Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Michael Glaesemann
50; http://www.postgresql.org/docs/9.0/interactive/sql-insert.html Michael Glaesemann michael.glaesem...@myyearbook.com -- 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] Data types for IP address.

2011-02-23 Thread Michael Glaesemann
10.1.2.57-10.1.2.123 ?presumably valid in his range system, and certainly NOT a valid CIDR range. If it hasn't been mentioned already, take a look at ip4r. http://pgfoundry.org/projects/ip4r/ Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general

Re: [GENERAL] Speeding up index scans by truncating timestamp?

2011-02-15 Thread Michael Glaesemann
with where foo bar and foo baz ? At this point the question is to satisfy my own curiosity. Providing the table definition, queries, and EXPLAIN and EXPLAIN ANALYZE output would help people provide more specific feedback. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general

Re: [GENERAL] excessive escaping in regular expression functions

2011-01-18 Thread Michael Glaesemann
On Jan 18, 2011, at 14:52, A.M. wrote: Is there a better way? Use dollar quotes or standard quoting instead of E strings. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Michael Glaesemann
. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Removing pgsql_tmp files

2010-11-08 Thread Michael Glaesemann
up on their own? Cheers, Michael Glaesemann michael.glaesem...@myyearbook.com -- 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] Removing pgsql_tmp files

2010-11-08 Thread Michael Glaesemann
On Nov 8, 2010, at 16:03 , Tom Lane wrote: Michael Glaesemann michael.glaesem...@myyearbook.com writes: We've got over 250GB of files in a pgsql_tmp directory, some with modification timestamps going back to August 2010 when the server was last restarted. That's very peculiar. Do you

Re: [GENERAL] unique constraint

2010-10-20 Thread Michael Glaesemann
. This is basically a hierarchy problem. Take a gander around the web for nested sets for examples. Michael Glaesemann grzm seespotcode net -- 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] Deleting orphaned records (not exists is very slow)

2010-09-27 Thread Michael Glaesemann
might want to do them in one go, or in batches. You'll likely want to create an index on orphaned_bar.keycol. You can then add your foreign key and get rid of the trigger on foo when you're done. Hope this helps. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list

Re: [GENERAL] Deleting orphaned records (not exists is very slow)

2010-09-27 Thread Michael Glaesemann
On Sep 27, 2010, at 22:08 , Tim Uckun wrote: update to_be_deleted set mark = true where ctid = any (array( select ctid from to_be_deleted limit 10)); Why are you messing with ctid? Does the table have no key? If not, you should fix that first. Michael Glaesemann grzm seespotcode net

Re: [GENERAL] Deleting orphaned records (not exists is very slow)

2010-09-27 Thread Michael Glaesemann
of your data! Michael Glaesemann grzm seespotcode net -- 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] Alter Table Command Rearranges Rows

2010-09-17 Thread Michael Glaesemann
'; UPDATE 1 This isn't valid syntax: I believe you issued UPDATE users Postgres (nor any other SQL RDBMS) does not guarantee row order unless you specify it with an ORDER BY clause. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] Int to Interval conversion

2010-09-14 Thread Michael Glaesemann
) Michael Glaesemann grzm seespotcode net -- 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 while autovacuuming

2010-09-08 Thread Michael Glaesemann
to 8.1.21 would require less work (and the same downtime) as to apply the patch. Michael Glaesemann grzm seespotcode net -- 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] Why No WHERE clause for INSERT statements

2010-08-17 Thread Michael Glaesemann
[, ...] ) ] SELECT ... WHERE condition This syntax would allow tuples to be inserted only when some condition is true. What I am missing? See above. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] pg_dump and boolean format

2010-08-11 Thread Michael Glaesemann
(SELECT CAST(boolean_column AS INT) FROM my_table) TO STDOUT. Then write a script which reads the exported data files and loads them into your sqlite database. COPY WITH CSV would likely be helpful as well. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] pg_dump and boolean format

2010-08-11 Thread Michael Glaesemann
On Aug 11, 2010, at 18:21 , Scott Frankel wrote: On Aug 11, 2010, at 10:12 AM, Michael Glaesemann wrote: One option is to use COPY to export the data in a format you like. For example: COPY (SELECT CAST(boolean_column AS INT) FROM my_table) TO STDOUT. Then write a script which reads

Re: [GENERAL] Can't EXTRACT number of months from an INTERVAL

2010-06-30 Thread Michael Glaesemann
') as int) / 30; ?column? -- 19 (1 row) And you're dealing only with dates): =# select (cast('2010-06-26' as date) - cast('2008-11-07' as date)) / 30; ?column? -- 19 (1 row) Datetime math can be difficult as it can be very contextual. Michael Glaesemann grzm

Re: [GENERAL] Grant column level permissions

2010-04-08 Thread Michael Glaesemann
permissions? Basically, I want to give permissions to set of users(user-group) to only couple of columns in my table. Have you reviewed the fine documentation? http://www.postgresql.org/docs/8.4/interactive/sql-grant.html Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general

Re: [GENERAL] How to add month.year column validation

2009-12-22 Thread Michael Glaesemann
is always 1 or some other agreed-upon (and documented) value (e.g., CHECK (val = date_truc('month', val))). If the data is date data, you're likely going to want to do other operations on the field which will be much easier if it's already a date value. Michael Glaesemann grzm seespotcode

Re: [GENERAL] How to add month.year column validation

2009-12-22 Thread Michael Glaesemann
it. I cannot change column type to date since other applications are expecting char(7) column. Just so you know, down this road lies madness. I completely agree. Schedule some downtime and make the column a date column. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general

Re: [GENERAL] I need a Postgres Admin $130K + 20K in NYC Any Ideas?

2009-09-15 Thread Michael Glaesemann
meals at restaurants in Manhattan for much less that $30. Michael Glaesemann grzm seespotcode net [1]http://www.nyc.gov/html/tlc/html/passenger/taxicab_rate.shtml -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] array weirdity

2009-09-03 Thread Michael Glaesemann
f (1 row) Michael Glaesemann grzm seespotcode net -- 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] Keys and indexes

2009-09-01 Thread Michael Glaesemann
On Sep 1, 2009, at 7:37 , Alexandr Varlamov wrote: Does indexing working for foreignkeys column automaticaly? No. Or i need create index manually. Yes. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

Re: [GENERAL] Postgre RAISE NOTICE and PHP

2009-08-19 Thread Michael Glaesemann
, Scott. Is there an equivalent in PDO? Looking through the docs I don't see one. It'd also be nice to be able to get at any/all of the additional information that's passed back: warning, context, hint, etc. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] Empty Updates, ON UPDATE triggers and Rules

2009-08-06 Thread Michael Glaesemann
at IF That's not a SELECT query per se: AIUI it's how the evaluation of the NEW != OLD expression is evaluated within the PL/pgSQL function as part of the IF statement (note the line 2 at IF context line). It's just saying the operator doesn't exist for the test_upd rowtype. Michael

Re: [GENERAL] integration of fulltext search in bytea/docs

2009-07-30 Thread Michael Glaesemann
On Jul 30, 2009, at 9:09 , Radek Novotný wrote: Is there possible to create pg trigger that runs shell script? [Please don't top post.] Yes. You can use an untrusted language such as pl/perlu to run system commands. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general

Re: [GENERAL] Upgrading from 8.3 to 8.4 and Integer datatimes?

2009-07-28 Thread Michael Glaesemann
of pg_dump is independent of the binary format: timestamps (and other values) are literal representations. As always, for your own edification and assurance, I'd test this with both a small, toy database and with your production database before your final upgrade. Michael Glaesemann grzm

Re: [GENERAL] Relational Algebra and Aggregate Functions

2009-07-28 Thread Michael Glaesemann
rewritten it as SQL and Relational Theory: How to Write Accurate SQL Code http://www.amazon.com/SQL-Relational-Theory-Write-Accurate/dp/0596523068 Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

Re: [GENERAL] Calculating the difference between timetz values

2009-07-27 Thread Michael Glaesemann
On Jul 27, 2009, at 10:54 , Alexey Klyukin wrote: Hello, I was looking for a way to get the difference (interval) between 2 timetz values, i.e.: I don't have a solution, but am curious what your use case is for timetz (as opposed to timestamptz). Michael Glaesemann grzm seespotcode

Re: [GENERAL] Benetl, a free ETL tool for files using postgreSQL, is out in version 2.9

2009-07-13 Thread Michael Glaesemann
/mailpref/pgsql-general Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] accessing anyarray elements

2009-06-12 Thread Michael Glaesemann
:= upper_bound - lower_bound; cumulative_width := cumulative_width + width; RETURN NEXT; END LOOP; RETURN; END $body$; Any ideas on how I might implement this? Would it require a change in the backend? Cheers, Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list

Re: [GENERAL] i have a problem with judge some words contain chinese word!

2009-03-30 Thread Michael Glaesemann
-++-+++ foo | 3 | foo | 3 | t | t foo bar baz | 11 | foo bar baz | 11 | t | t foo.bar,baz | 11 | foo.bar,baz | 11 | t | t foo案 | 4 | foo | 3 | f | f (4 rows) Michael Glaesemann

Re: [GENERAL] Using null or not null in function arguments

2009-01-23 Thread Michael Glaesemann
) ~ upper(i_lastname)) LIMIT $5 OFFSET $6 $$; Michael Glaesemann grzm seespotcode net -- 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] Annoying Reply-To

2008-10-17 Thread Michael Glaesemann
switching to something that has a reply-to button. I'm very disappointed in Apple. It's not. It has Reply and Reply All buttons for the clicky-clicky folk, and keyboard shortcuts for each as well. Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] grabbing date of last Sunday?

2008-10-10 Thread Michael Glaesemann
| 2008-10-05 (1 row) Michael Glaesemann grzm seespotcode net -- 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] How do I specify intervals in functions?

2008-07-31 Thread Michael Glaesemann
-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.0.2) (1 row) I can't tell as you haven't provided a complete example (always helpful when debugging), but are you sure you're specifying the correct language type (plpgsql in your case)? Michael Glaesemann [EMAIL PROTECTED] -- Sent

Re: [GENERAL] unable to drop a constraint

2008-07-16 Thread Michael Glaesemann
: customer_pkey is an index Are you using slony perchance? This looks like an issue with slony blocking DDL operations: http://lists.slony.info/pipermail/slony1-general/2006-November/005216.html Michael Glaesemann [EMAIL PROTECTED] -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

[GENERAL] functions, transactions, key violations

2008-06-04 Thread Michael Glaesemann
the transaction to be successful. What am I missing? Thanks for your help. Michael Glaesemann grzm seespotcode net [1](http://www.postgresql.org/docs/8.3/interactive/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE ) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] functions, transactions, key violations

2008-06-04 Thread Michael Glaesemann
; Michael Glaesemann grzm seespotcode net CREATE TABLE purchases ( purchase_id SERIAL PRIMARY KEY, item_id INT NOT NULL, purchased_by int NOT NULL, purchase_price INT NOT NULL, purchased_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, purchase_status INT NOT NULL DEFAULT 1

Re: [GENERAL] functions, transactions, key violations

2008-06-04 Thread Michael Glaesemann
; I'm obviously on the cusp of learning something new, or understanding concurrency more deeply, so I'm looking forward to your responses. Cheers, Michael Glaesemann grzm seespotcode net -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] UUID-OSSP for windows.

2008-02-28 Thread Michael Glaesemann
On Feb 27, 2008, at 16:59 , Tim Uckun wrote: citext is not part of core PostgreSQL or something we have any intention to include in the Windows distribution at this time. Is there an alternative for people wanting a case insensitive collation? ORDER BY lower(foo) ? Michael Glaesemann

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

2008-02-28 Thread Michael Glaesemann
is a command line application. You're looking for the CREATE DATABASE SQL command: http://www.postgresql.org/docs/8.3/interactive/sql-createdatabase.html Michael Glaesemann [EMAIL PROTECTED] ---(end of broadcast)--- TIP 3: Have you checked our

Re: [GENERAL] Question about the enum type

2008-02-17 Thread Michael Glaesemann
On Feb 17, 2008, at 21:24 , Tim Hart wrote: But for my own education - what's so unique about the name 'position'? It's an SQL keyword: http://www.postgresql.org/docs/8.3/interactive/sql-keywords- appendix.html Michael Glaesemann grzm seespotcode net ---(end

Re: [GENERAL] Strict-typing benefits/costs

2008-02-16 Thread Michael Glaesemann
' as a date. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Timestamp indexes (why or between does not use index?)

2008-02-16 Thread Michael Glaesemann
the EXPLAIN ANALYZE with seq scans disabled? Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] [OT] Slony + Alter table using pgadmin

2008-01-30 Thread Michael Glaesemann
' in the subject or body (don't include the quotes), and you will get back a message with instructions. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] Read/Write restriction mechanism

2008-01-09 Thread Michael Glaesemann
, not the connections). Um, why are DB-level permissions out? It seems like a natural fit: your writer connects as one role while the readers connect as another. Only grant SELECT access to the readers. Michael Glaesemann grzm seespotcode net ---(end of broadcast

Re: [GENERAL] How to handle 'not a number' in postgresql

2008-01-04 Thread Michael Glaesemann
prevails* Michael Glaesemann [EMAIL PROTECTED] ---(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

Re: [GENERAL] How to handle 'not a number' in postgresql

2008-01-04 Thread Michael Glaesemann
could be a useful value to distinguish between truly unknown quantities (say, that particular machine was not taking measurements during a particular test) and those where you've received a value from a machine and it's NaN. But I agree, it does depend on the application. Michael Glaesemann

Re: [GENERAL] Postgres from PHP in Leopard

2007-12-24 Thread Michael Glaesemann
overwritten. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] How to insert on duplicate key?

2007-12-24 Thread Michael Glaesemann
On Dec 24, 2007, at 22:03 , [EMAIL PROTECTED] wrote: I have googled and currently the only way I can find is do query first and then update or insert. Or alternatively, UPDATE and see if you've affected any rows. If not, insert. Michael Glaesemann grzm seespotcode net

Re: [GENERAL] Requirements for Constraint Trigger's Function

2007-12-22 Thread Michael Glaesemann
On Dec 21, 2007, at 13:12 , Richard Broersma Jr wrote: What is the proper way for the function of a constraint trigger to signal where or not referential integrity was compromised? Should it return some sort of value? Should it raise an exception? The latter. Michael Glaesemann grzm

Re: [GENERAL] self ordering list

2007-12-22 Thread Michael Glaesemann
; INSERT INTO tablename (priority, workitem) VALUES (2, 'new task'); UPDATE tablename SET priority = ABS(priority) WHERE priority 0; $func$; This is in the same vein as methods to maintain nested set-encoded hierarchies, which are also order-dependent. Michael Glaesemann grzm seespotcode

Re: [GENERAL] insert into...

2007-12-09 Thread Michael Glaesemann
On Dec 9, 2007, at 11:05 , Alain Roger wrote: Hi, i would like to understand why the following INSERT INTO statement works : INSERT INTO mytable SELECT nextval('my_sequence'), 'myname', 'myfirstname' ; whereas usually we should do : INSERT INTO mytable VALUES ( SELECT

Re: [GENERAL] storage size of bit data type..

2007-12-05 Thread Michael Glaesemann
| 3bytes --+---+---++++ 9 | 9 | 9 | 10 | 10 | 11 | 11 (1 row) Looks like there's 8 bytes of overhead as well, probably because a bit string is a varlena type. Michael Glaesemann grzm seespotcode net

Re: [GENERAL] Primary Key

2007-11-23 Thread Michael Glaesemann
in the logical sense. Uniqueness is implemented in terms of btree indexes in PostgreSQL. It seems to me you're conflating logical (key) and physical (index) concepts here. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 3

Re: [GENERAL] Composite types for composite primary/foreign keys?

2007-11-19 Thread Michael Glaesemann
find a solution yourself. However, we cannot help you if you don't provide adequate information. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] and then / or else

2007-11-17 Thread Michael Glaesemann
); test_case_in_if - first branch (1 row) Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Composite types for composite primary/foreign keys?

2007-11-17 Thread Michael Glaesemann
not...? What have you actually tried? You can learn a lot by a few minutes of exploration at a psql prompt. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] pg_dump not including custom CAST?

2007-11-17 Thread Michael Glaesemann
it's a built-in system object. What other objects might be susceptible to this? Operators? Operator classes? Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Qeury a boolean column?(using postgresql EJB)

2007-11-17 Thread Michael Glaesemann
thing i can do to maximized my time thanks... I strongly suspect you're not showing us the entire query you're using because this should work. If you want to figure out what's wrong, please provide a self-contained example which displays the behavior you're seeing. Michael Glaesemann grzm

Re: [GENERAL] Qeury a boolean column?(using postgresql EJB)

2007-11-16 Thread Michael Glaesemann
query is returning all of the rows of the table. Either sample doesn't contain any rows where letsaythisisboolean is true or you just haven't looked through all of them yet. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 9

Re: [GENERAL] Regression in 8.3?

2007-11-11 Thread Michael Glaesemann
as intended. If you want to treat a bigint or a date as a string, explicitly cast it. Michael Glaesemann grzm seespotcode net PGP.sig Description: This is a digitally signed message part

Re: [GENERAL] Stored procedure for generation next sequence value

2007-10-29 Thread Michael Glaesemann
On Oct 29, 2007, at 18:59 , Frank Church wrote: Is there a built in function for retrieving the next value of a sequence and updating the sequence counter? http://www.postgresql.org/docs/faqs.FAQ.html#item4.11.2 http://www.postgresql.org/docs/8.2/interactive/functions-sequence.html Michael

Re: [GENERAL] createdb argument question

2007-10-27 Thread Michael Glaesemann
On Oct 27, 2007, at 12:56 , Perry Smith wrote: On my Mac systems, this work. On my AIX system it does not. I get: Versions? Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner

Re: [GENERAL] Selecting tree data

2007-10-26 Thread Michael Glaesemann
nested intervals). Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] How to ALTER a TABLE to change the primary key?

2007-10-26 Thread Michael Glaesemann
: ALTER TABLE / ADD PRIMARY KEY will create implicit index new_pkey for table strings ALTER TABLE COMMIT test=# \d strings; Table public.strings Column | Type | Modifiers --+--+--- a_string | text | not null Indexes: new_pkey PRIMARY KEY, btree (a_string) Michael

Re: [GENERAL] Selecting tree data

2007-10-26 Thread Michael Glaesemann
the tree structure in my app code. Part of the issue is how do you *store* the tree in the database. You have to encode that information somehow. These are all methods to do that. Michael Glaesemann grzm seespotcode net ---(end of broadcast

Re: [GENERAL] find out data types using sql or php

2007-10-26 Thread Michael Glaesemann
were properly split along given and family name lines. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] uniquely indexing Celko's nested set model

2007-10-20 Thread Michael Glaesemann
and to the left of the update must be updated as well. AFAIK, there isn't currently a single best solution for representing trees in SQL. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] uniquely indexing Celko's nested set model

2007-10-20 Thread Michael Glaesemann
in the gaps. You could also do nested sets using numeric rather than integer, which gives you a lot more flexibility. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ

Re: [GENERAL] Problem of installation on Mac

2007-10-19 Thread Michael Glaesemann
On Oct 20, 2000, at 13:05 , Martin Gainty wrote: Martin, it continues to amaze me how you're able to predict and contribute to the discussion 7 years in advance! Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 9

Re: [GENERAL] Questions about LIMIT/OFFSET

2007-10-19 Thread Michael Glaesemann
between the server and your application. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] uniquely indexing Celko's nested set model

2007-10-19 Thread Michael Glaesemann
duplication of this time. Then again, maybe I should add the trigger to be on the safe side :) Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Problem of installation on Mac

2007-10-19 Thread Michael Glaesemann
On Oct 19, 2007, at 13:50 , brian wrote: Michael Glaesemann wrote: On Oct 20, 2000, at 13:05 , Martin Gainty wrote: Martin, it continues to amaze me how you're able to predict and contribute to the discussion 7 years in advance! Michael Glaesemann grzm seespotcode net But temporal

Re: [GENERAL] Calculation of per Capita on-the-fly - problems with SQL syntax

2007-10-16 Thread Michael Glaesemann
in another table: they're not the type of data as the rest. If you do, include the year just like normal and modify the query so it's not joining on the year. If you need to include both with years and without, write your query appropriately to include rows from both tables. Michael

Re: [GENERAL] problem with a column of type timestamp

2007-10-16 Thread Michael Glaesemann
believe it's that one is a *timestamp* while the other is a *time*; Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Calculation of per Capita on-the-fly - problems with SQL syntax

2007-10-15 Thread Michael Glaesemann
Database Applications in SQL[1]. Date, Darwen, and Lorentzos' Temporal Data and the Relational Model[2] is a more general text on the same topic, but isn't directly applicable to ANSI SQL. I suggest looking at least at the first. Hope this helps. Michael Glaesemann grzm seespotcode net

Re: [GENERAL] Foreign Key for PHP serialized data - possible?

2007-10-08 Thread Michael Glaesemann
, not the serialization issue you're having above. I recommend changing your schema. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining

Re: [GENERAL] How to convert rows into HTML columns?

2007-10-05 Thread Michael Glaesemann
-- ORDER BY -- after using crosstab. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message

Re: [GENERAL] Find min year and min value

2007-10-05 Thread Michael Glaesemann
, internet_users.value as internet_users, gdp.value as gdp from internet_users join gdp using (id_country, year) where id_country = 8 order by year limit 1 Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner

Re: [GENERAL] Request: Anyone using bogus / humorous X-Message-Flag headers, could we please turn them off

2007-10-05 Thread Michael Glaesemann
. Whether that means better rule handling or better understanding of various headers, it sounds like Outlook isn't doing the job for you. Perhaps a hybrid approach would be helpful: use another email client for mailing lists and Outlook otherwise. Hope this gives you some ideas. Michael

Re: [GENERAL] Request: Anyone using bogus / humorous X-Message-Flag headers, could we please turn them off

2007-10-05 Thread Michael Glaesemann
headers so I'm not contributing to your problem — hope you find a solution that works for you. Michael Glaesemann grzm seespotcode net ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe

Re: [GENERAL] Request: Anyone using bogus / humorous X-Message-Flag headers, could we please turn them off

2007-10-05 Thread Michael Glaesemann
of the people on the lists have been here for years and have gotten lots of helpful advice, which is why they've stuck around, and are many others that are happy to share their advice and experience. You never know: you might be pleasantly surprised. Best, Michael Glaesemann grzm seespotcode net

  1   2   3   4   5   6   >