Re: [SQL] [PERFORM] SQL Query Performance - what gives?

2009-08-18 Thread Tom Lane
be a lot easier to reconsider your representation of permissions. You'd be likely to get significantly better results, not to mention have more-readable queries, if you stored them as a group of simple boolean columns. regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] LOG: unexpected EOF on client connection

2009-08-05 Thread Tom Lane
the malfunction. Nonsense ... regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Create table command fails with permission denied

2009-08-04 Thread Tom Lane
(not the one that owns the data directory). regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Order of operations in ascii vs archive format (moderately urgent)

2009-07-21 Thread Tom Lane
pg_dump -Fc dumpfile pg_restore dumpfile textfile2 diff textfile textfile2 If these don't produce the same results something is broken. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] Order of operations in ascii vs archive format (moderately urgent)

2009-07-21 Thread Tom Lane
, anyway). regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Request new version to support on commit drop for create temp table ... as select ?

2009-07-14 Thread Tom Lane
. Didn't you notice that message was from 2005? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Request new version to support on commit drop for create temp table ... as select ?

2009-07-14 Thread Tom Lane
-createtableas.html regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] FW: Query length limitation in postgres server 8.2.9

2009-07-09 Thread Tom Lane
ja...@aers.ca writes: I've simplified the query to make it easier to look at. We need to see the table/index declarations. The query by itself is just about useless. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] FW: Query length limitation in postgres server 8.2.9

2009-07-09 Thread Tom Lane
ja...@aers.ca writes: \d search_site1_2009_03_13 And MyColumn1 is really which column? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] FW: Query length limitation in postgres server 8.2.9

2009-07-09 Thread Tom Lane
you update those indexes. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] FW: Query length limitation in postgres server 8.2.9

2009-07-09 Thread Tom Lane
space needed to index the NULL entries. They aren't going to affect search speed noticeably for non-NULL entries, I think. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] ERROR: function expression in FROM may not refer to other relations of same query level

2009-07-08 Thread Tom Lane
=# select unnest(ids) from tempa; unnest 1 2 3 (3 rows) Pre-8.4, you need a version of unnest() that's coded in C or SQL; plpgsql won't do. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] FW: Query length limitation in postgres server 8.2.9

2009-07-07 Thread Tom Lane
is relevant to proving it's legal to use the index? Given the lack of any schema information in the complaint, I suppose I can't rule that out, but one would hope the OP would have mentioned such a thing. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Order of WITH RECURSIVE output

2009-07-06 Thread Tom Lane
Andreas Joseph Krogh andr...@officenet.no writes: If I omit ORDER BY, is the output *guaranteed* (according to some standard) to be ordered No. It's not necessary to read any other details to answer that ... regards, tom lane -- Sent via pgsql-sql mailing list (pgsql

Re: [SQL] it's not NULL, then what is it?

2009-07-01 Thread Tom Lane
Tena Sakai tsa...@gallo.ucsf.edu writes: So they were null, Yes! and null turns out to be a seven-character blank string!? I don't understand how that happens. Mr Tom Lane hinted that it might be a bug in sprintf... Well, that was before I read the messages where it turned out

Re: [SQL] Partitioned tables not using index for min and max 8.2.7?

2009-07-01 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] uniqueness constraint with NULLs

2009-06-29 Thread Tom Lane
. The race condition isn't. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] date_trunc should be called date_round?

2009-06-29 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] .psql_history: No such file

2009-06-26 Thread Tom Lane
/.psql_history: No such file or directory ___ Apparently the postgres account still has HOME set to /var/lib/pgsql. You'll want to make that point to some directory that actually exists. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Composite primary keys

2009-06-23 Thread Tom Lane
Harald Fuchs hari.fu...@gmail.com writes: I tried to throw some invalid SQL to PostgreSQL and found its reaction confusing: test(# language char(3) NULL, This is documented as being a no-op specification. regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] Composite primary keys

2009-06-23 Thread Tom Lane
KEY will create implicit index t_pkey for table t ALTER TABLE (barring remembering the NULL clause in the catalogs, which seems entirely silly). So I'm not sure how interesting it is to complain about the single-command case. regards, tom lane -- Sent via pgsql-sql

Re: [SQL] polymorphic function in 7.4 vs. 8.3

2009-06-11 Thread Tom Lane
returning record CONTEXT: SQL statement select * from dd_test( $1 ) PL/pgSQL function test_trg line 7 at SQL statement regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] polymorphic function in 7.4 vs. 8.3

2009-06-11 Thread Tom Lane
any answer for you except breaking down the row into columns, which of course is going to be a huge notational PITA. Sure you can't move the DB off 7.4? There would be pretty considerable benefits from adopting some recent release instead. regards, tom lane -- Sent via

Re: [SQL] setting the where clause

2009-06-10 Thread Tom Lane
it forces an actual index probe to happen) and it's not safer (what if one day that PK value exists?). I'd personally go with where false; why not say what you mean rather than forcing humans and computers to deduce that the condition is constant false? regards, tom lane

Re: [SQL] Type inheritance

2009-06-05 Thread Tom Lane
would do the job? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] do unneeded outer joins cost?

2009-06-05 Thread Tom Lane
such an optimization (although I believe someone is working on it for 8.5). It seems likely though that an expensive join condition would be too complex to be amenable to such a proof anyway. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] exists and is not null equivalence in query

2009-05-28 Thread Tom Lane
regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] help with pg_hba.conf

2009-05-22 Thread Tom Lane
? Right, if you can't get into the database then the permissions of objects within it don't matter... regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Distinct oddity

2009-05-13 Thread Tom Lane
the archives ... regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Distinct oddity

2009-05-13 Thread Tom Lane
order is just ASCII. I'm not sure exactly how that might result in the observed odd behavior of DISTINCT, but I bet it's causing it somehow. You'd probably have better luck in the de_DE.ISO8859-1 or de_DE.ISO8859-15 locales. regards, tom lane -- Sent via pgsql-sql mailing

Re: [SQL] Distinct oddity

2009-05-13 Thread Tom Lane
that the root of it is a problem of this type. Tangentally, is there a better way of rolling back a function than a dumb hack like SELECT 1/0? RAISE ERROR? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] Query planning question

2009-05-11 Thread Tom Lane
the right things here. Your first example is fetching 40 times as many rows from retailer_offer as the second one is. If the planner had stuck with the nestloop plan, it would've taken about 40x as long, and been significantly slower than the hash join. regards, tom lane

Re: [SQL] Distinct oddity

2009-05-09 Thread Tom Lane
. What you need to do is dump out the *entire* results of the DISTINCT queries and look for the unmatched lines. I'd try dumping to two files, stripping the 'e' with sed, and then sort/diff. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] performance question

2009-05-08 Thread Tom Lane
an entirely fair comparison. If your expectation is that the database is going to be operating under mostly cached conditions, then you probably ought to adjust the planner cost parameters to reflect that (look at effective_cache_size, and try reducing random_page_cost). regards, tom

Re: [SQL] ascii-betical sort order?

2009-05-08 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Distinct oddity

2009-05-08 Thread Tom Lane
DISTINCT queries and compare them --- looking at the actual data values should give some insight as to what's happening. BTW, what is the datatype of f.bezeichnung, and what locale are you running in? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Creating a RULE for UPDATing a VIEW

2009-05-03 Thread Tom Lane
= old.key_field; BTW, you should also consider adding RETURNING clauses to these rules so that UPDATE RETURNING etc will work on the views. Here at least you can use RETURNING * ... regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] Storing null bytes in bytea

2009-04-27 Thread Tom Lane
layer on the client side is doubling (or perhaps undoubling?) the backslashes for you. Exactly what are you doing with that literal as you build the query? It might help to turn on log_statements so that you can see just what the server is getting. regards, tom lane

Re: [SQL] varchar value comparisons not working?

2009-04-24 Thread Tom Lane
NULLs. A NULL isn't equal to something else, but it isn't unequal either. You could use IS DISTINCT FROM instead of != in your second query. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Variable number or arguments to a function possible?

2009-04-24 Thread Tom Lane
numbers of arguments, but it's reducing to the above underneath. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] finding UNIQUES in information_schema

2009-04-16 Thread Tom Lane
constraints, period. How did you create those indexes? If you made them via SQL-standard PRIMARY KEY or UNIQUE constraint syntax, they should show in the information_schema. Otherwise not. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] finding UNIQUES in information_schema

2009-04-16 Thread Tom Lane
Gerardo Herzig gher...@fmed.uba.ar writes: Tom Lane wrote: No, they contain information about constraints, period. How did you create those indexes? If you made them via SQL-standard PRIMARY KEY or UNIQUE constraint syntax, they should show in the information_schema. Otherwise not. Well

Re: Fw: [SQL] ERROR: operator does not exist: date ~~ unknown

2009-04-12 Thread Tom Lane
it. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] How would I get rid of trailing blank line?

2009-04-02 Thread Tom Lane
look like it --- the final fputc('\n', fout); seems to be done unconditionally in all the output formats. I wonder if we should change that? I'm afraid it might break programs that are used to it :-( regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Stored function not accepting null value?

2009-04-01 Thread Tom Lane
behavior. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] a bit confused about distinct() function

2009-03-29 Thread Tom Lane
it would just be one composite column. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Alter Table/Indexing

2009-03-24 Thread Tom Lane
process any faster by doing that by hand. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] bash postgres

2009-03-23 Thread Tom Lane
the script into psql's stdin, if you prefer that type of notation. The reason you have to do this is that psql doesn't recognize backslash commands in a -c string. There's a school of thought that doesn't want us to allow multiple commands in a -c string, even. regards, tom lane

Re: [GENERAL] [SQL] bash postgres

2009-03-23 Thread Tom Lane
Erik Jones ejo...@engineyard.com writes: On Mar 23, 2009, at 7:05 AM, Tom Lane wrote: The reason you have to do this is that psql doesn't recognize backslash commands in a -c string. There's a school of thought that doesn't want us to allow multiple commands in a -c string, even. Hmm

Re: [SQL] Methods declaration

2009-03-17 Thread Tom Lane
Is it possible to do the same with postgreSql? No, but you can overload function names in Postgres, which can provide a lot of the same notational conveniences. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Inherits is not encouraged?

2009-03-09 Thread Tom Lane
allowed. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] counts of groupings by date year-month

2009-02-27 Thread Tom Lane
to another. Just use count(*) instead. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] = or LIKE ?

2009-02-15 Thread Tom Lane
must not end with escape character regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Grass Root Protectionism

2009-02-08 Thread Tom Lane
D'Arcy J.M. Cain da...@druid.net writes: What's next? Only help white folks? This guy doesn't really deserve being responded to. Just ignore him. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] current_date vs 'now'

2009-02-05 Thread Tom Lane
the date input converter to get invoked at that time. So it'll still work tomorrow. Of course, the cost of the runtime interpretation of the string is what accounts for your speed difference. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] dynamic OUT parameters?

2009-01-30 Thread Tom Lane
Craig Ringer cr...@postnewspapers.com.au writes: 2) Can i make a special type on_the_fly and returning setof that_type? You're better off using SETOF RECORD, at least in my opinion. Another possibility is to return a cursor. regards, tom lane -- Sent via pgsql-sql

Re: [SQL] plpgsql setof help

2009-01-28 Thread Tom Lane
in the PG archives, IIRC. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] problem using twice custom comparision operator

2009-01-23 Thread Tom Lane
anot commutative a b b c = a c transitive It fairly obviously fails the first of these, and I don't have too much confidence in the others. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Derived columns / denormalization

2009-01-15 Thread Tom Lane
, but ... regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] EXECUTE with a prepared plan and NULL

2009-01-04 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] where-used function

2008-12-29 Thread Tom Lane
for yourself. I think it would be kind of painful to do without writing some C code though, because a lot of useful operations like getObjectDescription() aren't exposed at the SQL level. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] index compatible date_trunc in postgres?

2008-12-19 Thread Tom Lane
.) regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Downgrade database and problem with sequences

2008-12-19 Thread Tom Lane
an explicit OWNED BY command, and the only way to make the right dependency magic happen was to use the SERIAL keyword while creating the table. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] How can this be legal syntax

2008-12-16 Thread Tom Lane
command. You can write some pretty ugly code if you choose to :-(. Although the docs also threaten to tighten this up, it's been like that for so long that I'm worried about how much user code we'll break if we do. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql

Re: [SQL] pg_clog/0202 Error

2008-12-16 Thread Tom Lane
about recovering from corrupt data. That particular row is gone beyond recall, but you should be able to clear out the damaged page(s) and at least recover the rest of your table. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] Subquery must return only one column query optimization

2008-12-15 Thread Tom Lane
could write the sub-select as SELECT ROW(rl.reminder_header, rl.reminder_footer) FROM ... We ought to make that happen automatically, but it's not real high on the to-do list. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-14 Thread Tom Lane
of extension functions or future core functions failing to follow this coding rule; but as long as people are lazy and copy-and-paste from the existing models, it should be okay. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [HACKERS] Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-14 Thread Tom Lane
... but this might be too ugly for your taste. If not, when might I expect a fix? 8.3.6, or apply http://archives.postgresql.org/pgsql-committers/2008-12/msg00109.php regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3

2008-12-13 Thread Tom Lane
to process the pg_statistic columns like this --- I've done it myself. And we'd not heard any reports of problems with it before 8.3. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] Is there a bug in PostgreSQL ?

2008-12-11 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Is there a bug in PostgreSQL ?

2008-12-10 Thread Tom Lane
Pascal Tufenkji [EMAIL PROTECTED] writes: I'm writing a query with a left join to a view, and the server is giving me a wrong result. What PG version? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription

Re: [SQL] A DISTINCT problem removing duplicates

2008-12-09 Thread Tom Lane
Richard Huxton [EMAIL PROTECTED] writes: Anyone got anything more elegant? Seems to me that no document should have an empty dup_set. If it's not a match to any existing document, then immediately assign a new dup_set number to it. regards, tom lane -- Sent via pgsql

Re: [SQL] A DISTINCT problem removing duplicates

2008-12-09 Thread Tom Lane
Richard Huxton [EMAIL PROTECTED] writes: Tom Lane wrote: Richard Huxton [EMAIL PROTECTED] writes: Anyone got anything more elegant? Seems to me that no document should have an empty dup_set. If it's not a match to any existing document, then immediately assign a new dup_set number

Re: [SQL] inconsistent automatic casting between psql and function

2008-12-09 Thread Tom Lane
deliberately chose this behavior awhile back, but I wonder whether it does more harm than good. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Permission denied for create table

2008-11-24 Thread Tom Lane
really ought to update that ... among other things, the documentation in recent versions explicitly covers the point above ;-) regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] Interval Format

2008-11-21 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] JOIN results of refcursor functions

2008-11-21 Thread Tom Lane
Milan Oparnica [EMAIL PROTECTED] writes: Is there any way to use INNER, LEFT and RIGHT JOIN between functions returning refcursor type. No. Make them return setof whatever instead. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Query to retrieve all indexed columns

2008-11-19 Thread Tom Lane
in an installed PG file set is the most convenient thing to study. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] array variables

2008-11-13 Thread Tom Lane
? --- {(1,one),(2,two)} (1 row) Whether this is a good idea for a large table is a different question ;-) regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] array variables

2008-11-13 Thread Tom Lane
Pavel Stehule [EMAIL PROTECTED] writes: 2008/11/13 Tom Lane [EMAIL PROTECTED]: Sure you can, if you're using a version new enough to have arrays of composite types. I don't expect so user use devel version ;) My example was done in 8.3. - and result is array of some composite type

Re: [SQL] array variables

2008-11-13 Thread Tom Lane
Pavel Stehule [EMAIL PROTECTED] writes: 2008/11/13 Tom Lane [EMAIL PROTECTED]: My example was done in 8.3. I tested it with error: postgres=# select array(select row(a,b) from f); ERROR: could not find array type for datatype record You left out the cast to a named rowtype --- that's

Re: [SQL] Using UTF strings in pg8.3 - storing hexadecimal values in bytea columns

2008-11-10 Thread Tom Lane
Mario Splivalo [EMAIL PROTECTED] writes: Tom Lane wrote: Exactly what version of pg_dump are you using? What I get from pg_dump doesn't look like that. Bytea fields with -D look more like this: INSERT INTO foo (f1) VALUES ('\\305S\\224\\226\\203)'); Yes, I mistakenly used pg8.2 pg_dump

Re: [SQL] Using UTF strings in pg8.3 - storing hexadecimal values in bytea columns

2008-11-10 Thread Tom Lane
Richard Huxton [EMAIL PROTECTED] writes: Mario Splivalo wrote: That's true, but I'd still like to use hexadecimal notation. You could use decode(): regression=# select decode('c5a4', 'hex'); decode -- \305\244 (1 row) regards, tom lane -- Sent via pgsql

Re: [SQL] Using UTF strings in pg8.3 - storing hexadecimal values in bytea columns

2008-11-10 Thread Tom Lane
('\\305S\\224\\226\\203)'); regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: Res: [SQL] Finding all tables that have foreign keys referencing a table

2008-11-07 Thread Tom Lane
(conkey,1)) as i from pg_constraint where contype = 'f') ss) ss2 where af.attnum = confkey and af.attrelid = confrelid and a.attnum = conkey and a.attrelid = conrelid; Deconstructing those arrays in parallel is a bit of a pain :-( regards, tom lane -- Sent via

Re: Res: [SQL] Finding all tables that have foreign keys referencing a table

2008-11-07 Thread Tom Lane
retrieving that info in a more intuitive way. Unfortunately, the whole point of information_schema is to be standardized; the notion of a PG extension to it is just wrong. Feel free to lobby the SQL committee to fix their oversight ... regards, tom lane -- Sent via pgsql

Re: [SQL] Date Index

2008-11-03 Thread Tom Lane
. What you probably want is just to cast the timestamp to date: cast(ts as date)-- SQL standard syntax ts::date-- traditional Postgres abbreviation regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Seq scan on join, not on subselect? analyze this

2008-11-02 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] trying to repair a bad header block

2008-10-29 Thread Tom Lane
Scott Marlowe [EMAIL PROTECTED] writes: On Wed, Oct 29, 2008 at 4:23 PM, Tom Lane [EMAIL PROTECTED] wrote: If you can tolerate losing the data on that page, just zero out the entire 8K page. dd from /dev/zero is the usual tool. Would zero_damaged_pages work here? I know it's a shotgun

Re: [SQL] simple SQL query

2008-10-29 Thread Tom Lane
, but hard for the system to optimize. Consider recasting as NOT EXISTS instead. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] How to hand over array as variable in plpgsql function?

2008-10-28 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] SQL Statement Missing From Log

2008-10-27 Thread Tom Lane
ignored until end of transaction block With no idea where the SET is coming from. My logging configuration is as follows. What am I doing wrong? How can I get the full failing SQL statement? log_min_error_statement needs to be ERROR or less. regards, tom lane

Re: [SQL] How to hand over array as variable in plpgsql function?

2008-10-27 Thread Tom Lane
precip_arrays WHERE b = precip_control INTO id_result; If you insist on using EXECUTE then you're going to have to fool with converting the array to an appropriate text representation. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] returning count(*) when it is 1, else -1

2008-10-17 Thread Tom Lane
.) regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Order of trigger execution: AFTER DELETE ON EACH ROW doesn't appear to be working properly

2008-10-13 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Problem with delete trigger: how to allow only triggers to delete a row?

2008-10-10 Thread Tom Lane
complicated to use. If the triggers that are privileged to delete deduced rows run as a special user, couldn't the validation triggers look at CURRENT_USER to see whether to allow the delete of a deduced row or not? regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] sequence number in a result

2008-10-09 Thread Tom Lane
. It would be possible to write a C function to do this with a lot less overhead than a sequence entails, but no one's got round to it AFAIK. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] trigger parameters, what am I doing wrong ??

2008-10-09 Thread Tom Lane
; NOTICE: TG_ARGV = 42, TG_NARGS = 1, par = 42 UPDATE 1 You need to show a more complete example of what you're doing. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] 100% CPU at concurent access

2008-10-08 Thread Tom Lane
the same command and getting the same failure. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Accessing elements of bytea[] always returns NULL

2008-10-01 Thread Tom Lane
. You'd likely have better luck asking on pgsql-jdbc. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

<    1   2   3   4   5   6   7   8   9   10   >