Re: [GENERAL] Problem with aborting entire transactions on error

2012-12-11 Thread Craig Ringer
that there will be still such numerous questions in the future about > this. Yes, but huge groups of these users' needs can be satisfied with changes to a relatively small number of middleware tools (Rails ActiveRecord, etc) to teach it about subtransactions and how to use them. --

Re: [GENERAL] create table in memory

2012-11-23 Thread Craig Ringer
de a function will be quicker. The same result should be achieved by beginning a transaction, creating the table, then calling the function. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-general ma

Re: [GENERAL] ERROR: query has no destination for result data

2012-11-23 Thread Craig Ringer
structures.html> -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: [GENERAL] ERROR: query has no destination for result data

2012-11-23 Thread Craig Ringer
On 11/23/2012 06:53 PM, Peter Kroon wrote: > When using: > RETURN QUERY( > SELECT 'this is text' > ); > > I get another error: > ERROR: cannot use RETURN QUERY in a non-SETOF function Use a plain SQL function instead of PL/PgSQL, or use `SELECT INTO` and ordina

Re: [GENERAL] w7 vs linux

2012-11-23 Thread Craig Ringer
or hardware, your question isn't much better than "is A faster than B". What's A? What's B? -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: [GENERAL] flush buffer after connection disllowed

2012-11-20 Thread Craig Ringer
lve. The write buffers and WAL are global across the cluster (group of databases), they're not per-database. So you can't really flush just one database as far as I know. You shouldn't generally need to do any kind of explicit flushing anyway. That's why a commit fsync()s. --

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread Craig Ringer
llocated objects with dtors, etc. Otherwise you'll have to translate error handling mechanisms at every boundary between C++ and Pg code, something I'm not even certain is possible to do reliably. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Deve

Re: [GENERAL] Maintaining state across function calls

2012-11-19 Thread Craig Ringer
text is destroyed. I would want to implement this as an aggregate using the standard aggregate / window function machinery. Have a look at how the existing aggregates like string_agg are implemented in the Pg source code. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL De

[GENERAL] EDB installer should check for valid %COMSPEC%

2012-11-18 Thread Craig Ringer
e;"' is not recognized as an internal or external command, operable program or batch file." Since I can find several reports of this spanning over a couple of years, I'd love to see a test for this integrated into the EDB installer. Just verify that popen() actually works before

Re: [GENERAL] Difference between varchar and text?

2012-11-18 Thread Craig Ringer
ends on the PostgreSQL version. Some changes were made to improve that recently; from memory, it used to require rewriting, so people would sometimes work around it with (dodgy and unsafe) hacks directly to the system catalogs. I'm not sure if "recently" is 9.2 or 9.3. -- Craig Ringe

Re: [GENERAL] [HACKERS] Parser - Query Analyser

2012-11-18 Thread Craig Ringer
wish to follow this up, please provide a DETAILED EXAMPLE showing what you are trying to do, as I explained in my previous post. Table definitions, ample data, desired output, detailed explanation of how you get from the input data to the desired output, etc.list -- Craig Ringer

Re: [GENERAL] PG_TERMINATE_BACKEND not working.

2012-11-18 Thread Craig Ringer
oblem you're trying to solve? -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- 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] Using Postgresql 9.2 on windows 7 and windows vista

2012-11-14 Thread Craig Ringer
ficially supported according to what document? Links? -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: htt

Re: [GENERAL] Access disk from plpython

2012-11-14 Thread Craig Ringer
. ... and that's because Python's design - in particular, the introspection features - means the the restricted mode wasn't particularly restricted. See http://docs.python.org/2/library/restricted.html , http://wiki.python.org/moin/SandboxedPython . -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: [GENERAL] general fear question about move PGDATA from one Disc to another

2012-11-13 Thread Craig Ringer
thout having to change the logical location, by mounting the new file system where the system expected it to be already. Again, you can remove /var/lib/postgresql.old when you're sure it's all gone fine. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Devel

Re: [GENERAL] Enabling Autovacuum Postgres 9.1 (was Unexpectedly high disk space usage)

2012-11-12 Thread Craig Ringer
On 11/13/2012 10:29 AM, Craig Ringer wrote: > On 11/13/2012 04:04 AM, Lists wrote: >> >> There's a wealth of how to tune PG instruction that's old and (based >> on this thread alone) often stale enough to be classified as >> disinformative. For example, nea

Re: [GENERAL] Enabling Autovacuum Postgres 9.1 (was Unexpectedly high disk space usage)

2012-11-12 Thread Craig Ringer
#x27;s the question of reindexing before full vacuum. I've > observed that not doing a manual reindex prior to vacuum full did not, > in fact, free up the space, even though I've been told that reindex is > implicit in the vacuum process. (?!) VACUUM FULL, post-9.1, should

Re: [GENERAL] Can dml realize the partition table's rule and make good execution plan?

2012-11-11 Thread Craig Ringer
interesting to enhance the query planner to be smarter about this particular case, but the planner is way past my scary-code-voodoo level so I can't really help there; I'm more interested in usability issues in the tools for any development time I get. -- Craig Ringer -- Sent via pgsq

Re: [GENERAL] Can dml realize the partition table's rule and make good execution plan?

2012-11-11 Thread Craig Ringer
500, and ctest02 using ctest02_id_idx for 600, then combine the results. If so: I'm not aware of any way to make the planner aware that that's possible. It'd be an interesting enhancement, to apply constraint exclusion to values pushed down into partitions, rather than simply to

Re: [GENERAL] Can dml realize the partition table's rule and make good execution plan?

2012-11-11 Thread Craig Ringer
resql.org/docs/9.1/static/ddl-partitioning.html> http://www.postgresql.org/docs/current/static/runtime-config-query.html#GUC-CONSTRAINT-EXCLUSION <http://www.postgresql.org/docs/9.2/static/runtime-config-query.html#GUC-CONSTRAINT-EXCLUSION> -- Craig Ringer

Re: [GENERAL] Using COPY FROM on a subset of the file's column

2012-11-11 Thread Craig Ringer
nt. You could: - \copy into a view that had a view trigger (or possibly rules; untested) to rewrite the incoming inserts and store them in the real target table; or - Just \copy into an UNLOGGED or TEMPORARY table then INSERT INTO ... SELECT the data to the real destination. -- Craig Ringer --

Re: [GENERAL] Running out of memory while making a join

2012-11-10 Thread Craig Ringer
On 11/11/2012 08:54 AM, Craig Ringer wrote: > > Now follow Tom's advice: >> In gdb, >> call MemoryContextStats(TopMemoryContext) >> should produce some useful information on the process's stderr file. > Oh, I forgot to explain how to actually get the outpu

Re: [GENERAL] Running out of memory while making a join

2012-11-10 Thread Craig Ringer
bt then "cont" again, control C, bt again, cont, control c, bt, and provide the copied and pasted backtraces in case they provide additional information about what's going on. -- Craig Ringer

Re: [GENERAL] control file errors

2012-11-10 Thread Craig Ringer
ndiana 11. What's the exact text of the error message? What're you doing in these tests? -- Craig Ringer -- 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] Using hstore, json, lo, etc from C extensions?

2012-11-08 Thread Craig Ringer
On 11/09/2012 02:12 PM, Tom Lane wrote: > Craig Ringer writes: >> With the growing number of extensions that expose useful and >> increasingly widely used custom data types, I'm wondering: is there any >> way to use them from a C extension without going through the SPI

Re: [GENERAL] Running out of memory while making a join

2012-11-08 Thread Craig Ringer
onable. The plan looks pretty harsh, with that big nested loop, but I'm not aware of anything that'd cause that to run out of memory. Personally I'd be attaching a debugger to it and seeing what it was doing while it ran. I'm sure there are smarter ways to trace where the m

[GENERAL] Using hstore, json, lo, etc from C extensions?

2012-11-08 Thread Craig Ringer
start coming up more. Question originally prompted by this SO post: http://stackoverflow.com/questions/13302682/postgresql-udf-in-c-using-hstore -- Craig Ringer <http://www.postgresql.org/docs/9.2/static/extend-extensions.html>

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Craig Ringer
On 11/09/2012 10:36 AM, Alvaro Herrera wrote: > Craig Ringer wrote: > >> It'd be nice to split the tests up into clearer groups - "will fail if >> planner settings are changed; WARNING", "will fail only if incorrect >> result is returned; FATAL" e

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Craig Ringer
change the configuration they won't produce the expected results. That's OK; just make sure other tests are fine. It'd be nice to split the tests up into clearer groups - "will fail if planner settings are changed; WARNING", "will fail only if incorrect result is retu

Re: [GENERAL] pg_hba.conf directory?

2012-11-08 Thread Craig Ringer
sed on pgsql-hackers about making it possible to modify postgresql.conf via SQL commands. This might be a good time to mention your interest in supporting a snippet directory. See the thread by Amit Kapila subject "Proposal for Allow postgresql.conf values to be changed via SQL". -- Cra

Re: [GENERAL] pg_hba.conf directory?

2012-11-08 Thread Craig Ringer
n wonder why it's overwritten. You'll need to provide a "reload" command that rewrites pg_hba.conf and then signals PostgreSQL to reload or uses pg_ctl reload, as well as the usual start and stop commands. -- Craig Ringer

Re: [GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-08 Thread Craig Ringer
27;ve been swapped with each other, or just have totally unexpected values. See the expected/ files for the output that should be produced. -- Craig Ringer

Re: [GENERAL] Running out of memory while making a join

2012-11-08 Thread Craig Ringer
On 11/08/2012 06:20 PM, Carlos Henrique Reimer wrote: > Is there a way to make PostgreSQL 8.3.21 server stop memory bound > backends as PostgreSQL 9.0.0 does? Are there any triggers on the table? What's the setting for work_mem? -- Craig Ringer -- Sent via pgsql-general mailing

Re: [GENERAL] Tuning / performance questions

2012-11-06 Thread Craig Ringer
fsync=off all this time I hope you've also been keeping good backups. BTW, I should've sent you a link to http://wiki.postgresql.org/wiki/Number_Of_Database_Connections in my prior email, where I recommended connection pooling. -- Craig Ringer

Re: [GENERAL] Tuning / performance questions

2012-11-06 Thread Craig Ringer
s_commit = off` and a commit_delay. If that isn't enough, get fast-flushing storage like a good raid controller with a battery backed cache you can put in write-back mode, or some high quality SSDs with power-protected write caches. > full_page_writes = off # recover from partial page writes > As above: I hope your data isn't important to you. -- Craig Ringer

Re: [GENERAL] Question about data corruption issue of 9.1 (pre 9.1.6)

2012-11-05 Thread Craig Ringer
wiki.postgresql.org/wiki/20120924updaterelease) > even if the database never crashed? Based on the wiki, I'd say the answer is "no" if your DB was never shut down for any of the listed causes. It's pretty clear that if it always flushed buffers cleanly then it'll be fine. -- Craig Ringer

Re: [GENERAL] About PostgreSQL as developer

2012-11-04 Thread Craig Ringer
elves. You'll need to check for some common problems like the user trying to put the data directory on a FAT32 volume, which isn't supported, but that isn't hard. -- Craig Ringer -- 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] role does not exist

2012-11-02 Thread Craig Ringer
On 11/03/2012 12:17 PM, Kevin Burton wrote: > I was not aware of the login option. That is probably the solution. Thank you. You can ALTER the user to add the LOGIN right, or just DROP it and re-CREATE it again. CREATE USER is shorthand for CREATE ROLE ... LOGIN -- Craig Ringer -- Sent

Re: [GENERAL] PostgreSQL 8.3 with Java 7

2012-11-02 Thread Craig Ringer
stgreSQL. However, you do not have to do it at the same time as upgrading to Java 7. I would recommend doing the two separately: * Upgrade PgJDBC and test your app with that on the old PostgreSQL * Now upgrade PostgreSQL, test the application on the new PostgreSQL * Finally, upgrade to the new Java

Re: [GENERAL] role does not exist

2012-11-02 Thread Craig Ringer
On 11/01/2012 11:46 PM, Kevin Burton wrote: > Now I get psql: FATAL: role "kevin" is not permitted to log in Did you perhaps CREATE ROLE without the LOGIN option? -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subsc

Re: [GENERAL] Boolean type storage format

2012-11-01 Thread Craig Ringer
(1 row) regress=> SELECT pg_column_size( ROW('t'::boolean, 't'::boolean, 'f'::boolean, 't'::boolean) ); pg_column_size 28 (1 row) -- Craig Ringer -- 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] role does not exist

2012-10-31 Thread Craig Ringer
x27;s documentation on post-install setup steps in /usr/share/doc/[packagename]/README.Debian.gz. See: zless /usr/share/doc/postgresql-?.?/README.Debian.gz -- Craig Ringer

Re: [GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Craig Ringer
-- Nested Loop (cost=0.00..17.58 rows=2 width=32) -> Seq Scan on b (cost=0.00..1.02 rows=2 width=4) -> Index Scan using a_pkey on a (cost=0.00..8.27 rows=1 width=36) Index Cond: (id = b.a_id) (4 rows) These are three very

Re: [GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Craig Ringer
fferent SQL statements optimize down to the same query plan. EXPLAIN and EXPLAIN ANALYZE show the query plans, and I'm not really sure you can go backwards from there to SQL in any consistent and logical way. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] Why PGDLLIMPORT is needed

2012-10-29 Thread Craig Ringer
PGPROC *MyPRoc;" that's nothing to do with the PGDLLIMPORT macro. -- Craig Ringer -- 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 Profiler in Postgre

2012-10-27 Thread Craig Ringer
are written in, etc it's rather hard to say. For PL/PgSQL check out the PL/PgSQL debugger. There's also the `auto_explain` contrib module. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postg

Re: [ADMIN] [GENERAL] Streaming Replication Server Crash

2012-10-22 Thread Craig Ringer
ToDosError may also be of interest: http://msdn.microsoft.com/en-us/library/windows/desktop/ms680600(v=vs.85).aspx <http://msdn.microsoft.com/en-us/library/windows/desktop/ms680600%28v=vs.85%29.aspx> ... but it's in Winternl.h so it's not guaranteed to exist / be compatible between

Re: [ADMIN] [GENERAL] Streaming Replication Server Crash

2012-10-22 Thread Craig Ringer
On 10/22/2012 08:52 PM, Tom Lane wrote: > Craig Ringer writes: >> On 10/19/2012 04:40 PM, raghu ram wrote: >>> 2012-10-19 12:26:46 IST [1338]: [18-1] user=,db= LOG: server process >>> (PID 15565) was terminated by signal 10 > >> That's odd. SIGUSR1 (

Re: [GENERAL] Somewhat automated method of cleaning table of corrupt records for pg_dump

2012-10-22 Thread Craig Ringer
nvalid sizings. Working strictly with a *copy*, does REINDEXing then CLUSTERing the tables help? VACCUM FULL on 8.3 won't rebuild indexes, so if index damage is the culprit a reindex may help. Then, if CLUSTER is able to rewrite the tables in index order you might be able to recover.

Re: [GENERAL] Streaming Replication Server Crash

2012-10-22 Thread Craig Ringer
IGUSR1 (signal 10) shouldn't terminate PostgreSQL. Was the server intentionally sent SIGUSR1 by an admin? Do you know what triggered the signal? Are you running any procedural languages other than PL/PgSQL, or any custom C extensions? Anything that might have unwittingly cleared the s

Re: [GENERAL] retrieving keys from a GIN index on a tsvector column in Postgres 9.1?

2012-10-18 Thread Craig Ringer
is your SO question? http://stackoverflow.com/questions/12961459/retrieving-keys-from-a-gin-index-on-a-tsvector-column-in-postgres-9-1 If so, please link back to SO questions when posting on the mailing list and vice versa, so others who're looking for information later can find both.

Re: [GENERAL] 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered

2012-10-17 Thread Craig Ringer
unique. They expected to get a serialization failure on duplicate insert into "name", not a unique constraint violation. The question wasn't "why doesn't this fail" but "Why does this fail with a different error than I expected". Not that the question made

Re: [GENERAL] database corruption questions

2012-10-17 Thread Craig Ringer
On 10/18/2012 01:06 AM, Daniel Serodio wrote: Craig Ringer wrote: On 10/14/2012 05:53 AM, Heine Ferreira wrote: Hi Are there any best practices for avoiding database corruption? * Maintain rolling backups with proper ageing. For example, keep one a day for the last 7 days, then one a week

Re: [GENERAL] allow servers to access to the same data

2012-10-17 Thread Craig Ringer
ongly recommend that you use replication instead. See http://www.postgresql.org/docs/current/static/high-availability.html <http://www.postgresql.org/docs/8.3/static/high-availability.html> http://wiki.postgresql.org/wiki/Shared_Storage -- Craig Ringer

Re: [GENERAL] allow servers to access to the same data

2012-10-17 Thread Craig Ringer
o do and why, so better advice can be offered. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] 9.1/9.2 SERIALIZABLE: expected serialization failure between INSERT and SELECT not encountered

2012-10-16 Thread Craig Ringer
the insertion of "Bob" in the other transaction to violate serializability? -- Craig Ringer

Re: [GENERAL] Does Postgres Object-Relational Syntax follow Standard?

2012-10-16 Thread Craig Ringer
On 10/17/2012 05:00 AM, Will Rutherdale (rutherw) wrote: Hi. I was having a discussion with people at work about the Postgres object-relational syntax. What syntax specifically? Do you mean table inheritance and SELECT ONLY ? -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] Application takes longer time to fetch large no of records from Postgresql 9.0.3

2012-10-16 Thread Craig Ringer
On 10/16/2012 12:40 PM, Craig Ringer wrote: On 10/16/2012 12:24 PM, Deven Thaker wrote: Hi, My application takes longer time (we see time out even) when data to be fetched from Postgresql 9.0.3 is around 190 records. I am doing an improvement at application level, but from database side any

Re: [GENERAL] Application takes longer time to fetch large no of records from Postgresql 9.0.3

2012-10-15 Thread Craig Ringer
epeat myself. Please read this: https://wiki.postgresql.org/wiki/Slow_Query_Questions then follow up with a complete question including exact query text, EXPLAIN (ANALYZE, BUFFERS) results, etc. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

[GENERAL] SO issue: src/tutorial of 8.3.x fails to compile on Cygwin

2012-10-15 Thread Craig Ringer
of function 'SET_VARSIZE' ... followed by a linker error funcs.o:funcs.c:(.text+0xb6): undefined reference to `_SET_VARSIZE' that's caused by the compiler's assumption tht SET_VARSIZE is a function since the macro doesn't seem to have been included. -- Craig Ringer

Re: [GENERAL] NOTIFY/LISTEN in Postgresql

2012-10-15 Thread Craig Ringer
ing for. Details? Again, an advisory lock may be a candidate. -- Craig Ringer -- 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 42704 - does mean what?

2012-10-15 Thread Craig Ringer
27;]), (ARRAY['c','d'])) SELECT array_agg(x) FROM arr; ERROR: could not find array type for data type text[] -- Craig Ringer -- 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] Re: [GENERAL] Mapping PostgreSQL data types to DB2 Federated Server

2012-10-14 Thread Craig Ringer
On 10/15/2012 09:37 AM, Alexander Gataric wrote: The IBM people aren't being helpful so I thought I'd ask here. Try dba.stackexchange.com . -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.post

Re: [GENERAL] database corruption questions

2012-10-13 Thread Craig Ringer
e always done in the past, but others here are much more experienced with testing gear into production. You can also use pg_test_fsync and diskchecker.pl . See: http://www.postgresql.org/docs/current/static/wal-reliability.html I do repeated plug-pull tests and make sure fsync is being honour

Re: [GENERAL] citext question

2012-10-13 Thread Craig Ringer
in how they are stored, and there's no advantage to using "varchar" over "text". It's similar with citext. While citext doesn't accept a typmod to constrain its length, you can and should use CHECK constraints as appropriate in your data definitions. --

Re: [GENERAL] database corruption questions

2012-10-13 Thread Craig Ringer
On 10/14/2012 05:53 AM, Heine Ferreira wrote: Hi Are there any best practices for avoiding database corruption? I forgot to mention, you should also read: http://www.postgresql.org/docs/current/static/wal-reliability.html -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql

Re: [GENERAL] database corruption questions

2012-10-13 Thread Craig Ringer
On 10/14/2012 11:00 AM, John R Pierce wrote: On 10/13/12 7:13 PM, Craig Ringer wrote: * Use a good quality hardware RAID controller with a battery backup cache unit if you're using spinning disks in RAID. This is as much for performance as reliability; a BBU will make an immense differen

Re: [GENERAL] database corruption questions

2012-10-13 Thread Craig Ringer
what little surge protection they offer is done with a component that wears out after absorbing a few surges, becoming totally ineffective. Since your system should be crash-safe a cheap UPS will do nothing for corruption protection, it'll only help with uptime. -- Craig Ringer -- Sent

Re: [GENERAL] Improve MMO Game Performance

2012-10-13 Thread Craig Ringer
the quickest-and-dirtiest settings possible. I might not even store the transient data in Pg at all, I might well use a system that offers much weaker consistency, atomicicty and integrity guarantees. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Craig Ringer
On 10/11/2012 05:07 PM, Vineet Deodhar wrote: On Thu, Oct 11, 2012 at 1:12 PM, Craig Ringer mailto:ring...@ringerc.id.au>> wrote: The difference between SMALLINT and BOOLEAN (or TINYINT if Pg supported it) is 1 byte per column. If you had 30 smallint columns and quite a few m

Re: [GENERAL] auto-increment field : in a simple way

2012-10-11 Thread Craig Ringer
olname < 32768)); ); With this constraint, whether the storage space requirement would reduce? OR Is it just for validation of data? It's purely validation and has no effect on storage size. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make change

Re: [GENERAL] auto-increment field : in a simple way

2012-10-11 Thread Craig Ringer
longhand way. If you're creating few enough tables that you care about the syntax of defining an unusually small data type for a generated primary key, you're creating few enough that the space doesn't actually matter. -- Craig Ringer -- Sent via pgsql-general mailing

Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread Craig Ringer
erence between SMALLINT and BOOLEAN (or TINYINT if Pg supported it) is 1 byte per column. If you had 30 smallint columns and quite a few million rows it might start making a difference, but it's *really* not worth obsessing about. Unless you have high-column-count tables that contain nothing bu

Re: [GENERAL] Storing large files in multiple schemas: BLOB or BYTEA

2012-10-10 Thread Craig Ringer
lowing the cost of reading and discarding rarely-changed large objects to be avoided. -- Craig Ringer -- 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] Shorthand syntax for triggers

2012-10-10 Thread Craig Ringer
elieve it doesn't matter what you return here. This is a trivial convenience, but not one I'd be against. 5. Way less repetitive typing. If you're repeating the same triggers over and over you may want to look at writing them to be re-usable. See eg: http://wiki.po

Re: [GENERAL] moving from MySQL to pgsql

2012-10-10 Thread Craig Ringer
kup process too. With PostgreSQL you have a couple of options, including log archiving, periodic dumps, and warm standby. Please read the backup chapter of the manual in detail. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your sub

Re: [GENERAL] CTE materializing sets?

2012-10-09 Thread Craig Ringer
imple rewrite. -- Craig Ringer -- 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] CTE materializing sets?

2012-10-09 Thread Craig Ringer
. I'd expect it'd materialize to RAM if the result is within `work_mem` but I'd love to know for sure. -- Craig Ringer -- 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] Moving from Java 1.5 to Java 1.6

2012-10-05 Thread Craig Ringer
DBC on a new Java to support a truly ancient Pg like 7.4. -- Craig Ringer -- 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] Building an home computer for best Poker Tracker performance

2012-10-04 Thread Craig Ringer
is "as much RAM as you can afford". b. How many cpu processors should I assign to my VM?. Should I try assigning 2-4 CPUs for actual play? And if I do, is there an objective way to measure performance? Get rid of the VM. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-

Re: [GENERAL] pros and cons of two security models

2012-10-03 Thread Craig Ringer
-authentication-approach-for-financial-app-on-postgresql When you cross-post, please link. -- Craig Ringer -- 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] pg_typeof equivalent for numeric scale, numeric/timestamp precision?

2012-10-03 Thread Craig Ringer
On 10/03/2012 05:50 AM, Martijn van Oosterhout wrote: On Tue, Oct 02, 2012 at 10:19:18AM +0800, Craig Ringer wrote: Hi all While examining a reported issue with the JDBC driver I'm finding myself wanting SQL-level functions to get the scale and precision of a numeric result from an oper

Re: [GENERAL] Game Server Lags

2012-10-02 Thread Craig Ringer
Use a front-end cache like memcached. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] pg_typeof equivalent for numeric scale, numeric/timestamp precision?

2012-10-01 Thread Craig Ringer
eed to do this from C with a custom function, or via libpq's metadata APIs? And re format_type, am I misunderstanding it or is it just busted for numeric? -- Craig Ringer -- 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] Question about permissions on database.

2012-09-22 Thread Craig Ringer
-role That while that question is about 8.4 so it doesn't cover ALTER DEFAULT PRIVILEGES (http://www.postgresql.org/docs/current/static/sql-alterdefaultprivileges.html), which is the right way to to solve this going forward. It should be useful, though. -- Craig Ringer -- Sent via

Re: [GENERAL] 9.1 vs 8.4 performance

2012-09-22 Thread Craig Ringer
On 09/21/2012 10:32 PM, salah jubeh wrote: I am running queries sequentially on each machine using a database dumped from a life server , and 9.1 server is much slower than 8.4. https://wiki.postgresql.org/wiki/Slow_Query_Questions More detail needed. -- Craig Ringer -- Sent via pgsql

Re: [GENERAL] Using psql -f to load a UTF8 file

2012-09-20 Thread Craig Ringer
and treat it as such, rather than mangling it by interpreting it as the local system encoding. psql should accept UTF-8 with BOM. -- Craig Ringer -- 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] Need psql send email

2012-09-20 Thread Craig Ringer
database. -- Craig Ringer -- 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] Passing row set into PL/pgSQL function.

2012-09-20 Thread Craig Ringer
CT funky_upsert('table', ARRAY['col1','col2'], 'some_curs'); CLOSE some_curs; Internally it could fetch rows from the refcursor into record fields and do what it needed. Personally I'd just do the work app-side. -- Craig Ringer -- Sent via pgsql-

Re: [GENERAL] Passing row set into PL/pgSQL function.

2012-09-19 Thread Craig Ringer
/06/10/why-is-upsert-so-complicated/ -- Craig Ringer -- 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] pg_dump, send/recv

2012-09-19 Thread Craig Ringer
what uses them? Are they only an optional optimization for storing binary data in the database? I don't know what *else* they're used for, but there's a binary wire protocol (albeit a rarely used one) that I'm pretty sure uses them. -- Craig Ringer -- Sent via pgsql-ge

[GENERAL] Getting a leading zero on negative intervals with to_char?

2012-09-19 Thread Craig Ringer
als wildly differently to Oracle anyway: http://sqlfiddle.com/#!4/d41d8/2751 <http://sqlfiddle.com/#%214/d41d8/2751> and it looks like Oracle handling of intervals isn't much like Pg anyway: http://stackoverflow.com/questions/970249/format-interval-with-to-char Arose from trying to find a non-ugly solution to this SO post: http://stackoverflow.com/questions/12335438/server-timezone-offset-value/12338490#12338490 -- Craig Ringer

Re: [GENERAL] drop table if exists ;

2012-09-19 Thread Craig Ringer
ntion is to DROP the object despite the type mismatch, or to ignore it because it's not the type of object they specified to drop. When something is ambiguous or unclear, PostgreSQL will tend to report an error for safety. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-ge

Re: [GENERAL] RFE: Column aliases in WHERE clauses

2012-09-19 Thread Craig Ringer
ation to effectively clone the aliased SELECT term into the WHERE clause? If so, what about functions with side-effects? -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Data recovery after inadvertent update?

2012-09-18 Thread Craig Ringer
tuple', `adminpack', etc. Am I right in guessing that they're pretty much going to require hand data recovery or the use of some custom C extension code to get at the data - if it still exists? -- Craig Ringer

Re: [GENERAL] RFE: Column aliases in WHERE clauses

2012-09-17 Thread Craig Ringer
ething like: SELECT FROM thetable WHERE first_letter > 'a' RESULTS left(value,1) AS first_letter or something, where the order is more obvious. I really dislike the way SQL is written not-quite-backwards. -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@p

Re: [GENERAL] log_destination = csvlog, line breaks interfere in analysis

2012-09-17 Thread Craig Ringer
place? It's not perfect, but it goes a long way toward improving confidence in changes to big (or small) codebases. -- Craig Ringer -- 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] foreign key from array element

2012-09-17 Thread Craig Ringer
esql.org/action/patch_view?id=900 and the linked discussions. -- Craig Ringer -- 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] Index creation takes more time?

2012-09-16 Thread Craig Ringer
Herouth, I don't know if you saw Tomas Vondra's follow-up, as it was only to the list and not CC'd to you. Here's the archive link: http://archives.postgresql.org/message-id/e87a2f7a91ce1fca7143bcadc4553...@fuzzy.cz The short version: "More information required". On 09/09/2012 05:25 PM, Hero

Re: [GENERAL] postgres process got stuck in "notify interrupt waiting" status

2012-09-05 Thread Craig Ringer
even then you'll have to bypass the shared memory lockout (unless you're on Windows). -- Craig Ringer -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

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