Re: [GENERAL] any psql \copy tricks for default-value columns without source data?

2014-05-06 Thread Ryan Kelly
t works most of the time. If you have any issues or feature requests feel free to open an issue on github. -Ryan Kelly On Tue, May 6, 2014 at 4:22 PM, David G Johnston wrote: > So, I am trying to import a file into a table and want to assign a sequence > value to each record as it is import

Re: [GENERAL] psql swallowed my "BEGIN;" on reset... user beware?

2013-09-30 Thread Ryan Kelly
On Mon, Sep 09/30/13, 2013 at 11:49:29AM -0400, Moshe Jacobson wrote: > On Sun, Sep 29, 2013 at 2:18 AM, Ken Tanzer wrote: > > > After restarting the server in another window, I was surprised that my > > command did not run in a transaction: > > > > spc_test_scratch=# BEGIN; DROP VIEW IF EXISTS p

Re: [GENERAL] psql swallowed my "BEGIN;" on reset... user beware?

2013-09-30 Thread Ryan Kelly
On Mon, Sep 09/30/13, 2013 at 11:49:29AM -0400, Moshe Jacobson wrote: > On Sun, Sep 29, 2013 at 2:18 AM, Ken Tanzer wrote: > > > After restarting the server in another window, I was surprised that my > > command did not run in a transaction: > > > > spc_test_scratch=# BEGIN; DROP VIEW IF EXISTS p

Re: [GENERAL] psql client memory usage

2013-09-09 Thread Ryan Kelly
row-mode.html I do not expect psql will be adjusted to utilize the new API: http://www.postgresql.org/message-id/caeykp92z2w3vbs4uxwpwub7k4hgw-vepw_wnsui9r5t+cgp...@mail.gmail.com -Ryan Kelly -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] greatest cannot be used as sfunc for CREATE AGGREGATE

2013-06-25 Thread Ryan Kelly
In trying to learn about aggregates, I came across this seemingly odd behavior: (postgres@[local]:5435 08:27:42) [postgres]> CREATE AGGREGATE example_max (TEXT) (SFUNC = greatest, STYPE = TEXT); ERROR: syntax error at or near "greatest" LINE 1: CREATE AGGREGATE example_max (TEXT) (SFUNC = greate

Re: [GENERAL] problem with lost connection while running long PL/R query

2013-05-16 Thread Ryan Kelly
On Thu, May 05/16/13, 2013 at 02:47:28PM +0200, David M. Kaplan wrote: > Hi, > > I have a query that uses a PL/R function to run a statistical model > on data in a postgresql table. The query runs the function 4 times, > each of which generates about 2 million lines of results, generating > a fin

Re: [GENERAL] run COPY as user other than postgres

2013-04-23 Thread Ryan Kelly
COPY > TO. Here is a simple example where the location > '/some/path/to/file/file.csv' is owned by another user and it would be > very spiffy if I could run the COPY TO as that user. Any ideas? > You should use \copy if you're using psql. That will run on the clien

Re: [GENERAL] pulling year out of a timestamp

2013-04-11 Thread Ryan Kelly
On Thu, Apr 04/11/13, 2013 at 10:50:53AM -0500, Kirk Wythers wrote: > I am trying to perform a join between two tables where I need to join "year" > in table 1 with the year component of a timestamp in table 2. > > Something like this: > > table1.year = table2.timestamp > where timestamp has th

Re: [GENERAL] PostgreSQL EXCLUDE USING error: Data type integer has no default operator class

2013-03-22 Thread Ryan Kelly
. > > I've spent quite a bit of time searching for hints on figuring out how to > make this work, or figuring out why it won't work. I've also been trying to > understand CREATE OPERATOR and CREATE OPERATOR CLASS, but those are over my > head for now. Could anyone point

Re: [GENERAL] Rewritten rows on unchanged values

2013-03-22 Thread Ryan Kelly
really seeing a new row. > I'm having trouble understanding why it is necessary to generate a new tuple even when nothing has changed. It seems that the OP understands that MVCC is at work, but is questioning why this exact behavior occurs. I too have the same question. Perhap

Re: [GENERAL] Importing 120 csv files bulk multiple

2013-02-12 Thread Ryan Kelly
You can use \i /path/to/file.txt -Ryan On Tue, Feb 02/12/13, 2013 at 03:14:03PM +, Andrew Taylor wrote: > Hi, > > As per title I need to import a load of csv files. So I wrote a bash script > to generate the statements I needed (attached). However, this is failing on > my ubuntu laptop - it

Re: [GENERAL] Large temporary file generated during query

2012-12-08 Thread Ryan Kelly
On Fri, Dec 12/07/12, 2012 at 05:33:45PM -0800, Jeff Janes wrote: > On Fri, Dec 7, 2012 at 1:58 PM, Ryan Kelly wrote: > > I have a very large query that also touches quite a bit of data. It > > generates a large temporary file (actually, several, because the total > > size

[GENERAL] Large temporary file generated during query

2012-12-07 Thread Ryan Kelly
lso, I suppose this data on-disk can be kept in memory instead by increasing work_mem to a suitable value? Thanks, -Ryan Kelly -- 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] When does CLUSTER occur?

2012-11-29 Thread Ryan Kelly
the "ALTER TABLE gen1011 CLUSTER ON > xgen1011_si_sn" actually clusters the table at that point or if it just tells > it to use that index for clustering? If the latter I assume I need to add a > "CLUSTER gen1011 ON xgen1011_si_sn" line at the end along with an ANALY

Re: [GENERAL] output inserted

2012-11-21 Thread Ryan Kelly
On Wed, Nov 21, 2012 at 02:41:24PM +0100, Peter Kroon wrote: > How to I output the insert in PostgreSQL? > > DROP TABLE IF EXISTS a_001; > CREATE TEMP TABLE a_001( > vl text > ); > DROP TABLE IF EXISTS a_002; > CREATE TEMP TABLE a_002( > vl text > ); > > INSERT INTO a_001 > OUTPUT INSERTED.* INTO

Re: [GENERAL] Using a GIN index on an integer array to model sets of tags

2012-11-17 Thread Ryan Kelly
iltered by a certain set of tags. The original design used one-to-many to store the association between items and tags. When it was replaced with an approach using arrays with gin indexes, the speed up for finding large numbers of items was 20x, and finding smaller subsets was 60x. This was about 18

[GENERAL] Set returning functions in the SELECT list

2012-11-16 Thread Ryan Kelly
nt/static/xfunc-sql.html#XFUNC-SQL-FUNCTIONS-RETURNING-SET but it doesn't seem to be explicitly mentioned there. And yes, I understand doing this is deprecated and my results would probably be better achieved with LATERAL when 9.3 comes out. -Ryan Kelly -- Sent via pgsql-general mailing

Re: [GENERAL] Strategies/Best Practises Handling Large Tables

2012-10-16 Thread Ryan Kelly
That link will be helpful in understanding how partitioning could benefit you. -Ryan Kelly -- 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] Strategies/Best Practises Handling Large Tables

2012-10-12 Thread Ryan Kelly
sharing on the pros and cons of the above, or > if there are any other strategies that I could put in place. > > Thanking you in advance. -Ryan Kelly -- 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, OLAP, and Large Clusters

2012-09-27 Thread Ryan Kelly
On Wed, Sep 26, 2012 at 03:18:16PM -0600, Scott Marlowe wrote: > On Wed, Sep 26, 2012 at 5:50 AM, Ryan Kelly wrote: > > Hi: > > > > The size of our database is growing rather rapidly. We're concerned > > about how well Postgres will scale for OLAP-style qu

Re: [GENERAL] PostgreSQL, OLAP, and Large Clusters

2012-09-27 Thread Ryan Kelly
d-hoc and probably can't be solved with a materialized approach. > > Thanks, > > Stephen Thanks, -Ryan Kelly signature.asc Description: Digital signature

Re: [GENERAL] PostgreSQL, OLAP, and Large Clusters

2012-09-27 Thread Ryan Kelly
On Thu, Sep 27, 2012 at 08:58:05AM +1200, Gavin Flower wrote: > On 26/09/12 23:50, Ryan Kelly wrote: > >Hi: > > > >The size of our database is growing rather rapidly. We're concerned > >about how well Postgres will scale for OLAP-style queries over terabytes >

Re: [GENERAL] PostgreSQL, OLAP, and Large Clusters

2012-09-27 Thread Ryan Kelly
On Thu, Sep 27, 2012 at 08:51:31AM +1000, Ondrej Ivanič wrote: > Hi, > > On 26 September 2012 21:50, Ryan Kelly wrote: > > The size of our database is growing rather rapidly. We're concerned > > about how well Postgres will scale for OLAP-style queries over terabytes &g

[GENERAL] PostgreSQL, OLAP, and Large Clusters

2012-09-26 Thread Ryan Kelly
fort, of course), but given my experiences with Postgres and the support provided by the community that is second to none, I'd very much like to stay with PostgreSQL. Thoughts? -Ryan Kelly -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to you

Re: [GENERAL] Question about permissions on database.

2012-09-22 Thread Ryan Kelly
. You can alternatively make the user a super user: ALTER ROLE your_user WITH SUPERUSER; But this is an even worse idea. If one role owns all the tables in that database, you can make your role a member of that role: GRANT owner_role TO your_role; But are you really sure that your user needs permi

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

2012-09-17 Thread Ryan Kelly
proper mailing list for such feature requests? I think this is explicitly disallowed by the spec. And by Tom: http://archives.postgresql.org/pgsql-general/2002-11/msg01411.php > > Thanks in advance, > Daniel Serodio > -Ryan Kelly -- Sent via pgsql-general mailing list (pgsq

Re: [GENERAL] Official C++ API for postgresql?

2012-09-17 Thread Ryan Kelly
On Mon, Sep 17, 2012 at 11:52:13PM +0400, niXman wrote: > 2012/9/17 Ryan Kelly: > > > http://pqxx.org/development/libpqxx/ > > Last question... > According to the link provided by you, it is said that libpqxx comes > with postgres. But in the archive with postgre

Re: [GENERAL] log_destination = csvlog

2012-09-17 Thread Ryan Kelly
espace character) from SQL statements? Or there > is an "regexp" I can use for this purpose? CSV parsers should handle this correctly. What tools are you trying to use? > > Thanks, > > Edson > -Ryan Kelly -- 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] Official C++ API for postgresql?

2012-09-17 Thread Ryan Kelly
On Mon, Sep 17, 2012 at 10:58:30PM +0400, niXman wrote: > Hello, > > Tell me please, whether there is an official C++ API for postgresql? http://pqxx.org/development/libpqxx/ > > Thanks, > > -- > Regards, > niXman -Ryan Kelly -- Sent via pgsql-general

Re: [GENERAL] psql & unix env variables

2012-08-29 Thread Ryan Kelly
om<http://www.orbitz.com/> | > ebookers.com<http://www.ebookers.com/> | > hotelclub.com<http://www.hotelclub.com/> | > cheaptickets.com<http://www.cheaptickets.com/> | > ratestogo.com<http://www.ratestogo.com/> | > asiahotels.com<http://www.asiaho

Re: [GENERAL] array_length of an empty array

2012-07-29 Thread Ryan Kelly
th the standard: > 1) An specifies a collection whose cardinality > is zero. -Ryan Kelly -- 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] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Ryan Kelly
On Fri, Jul 27, 2012 at 02:06:01PM +, Mark Morgan Lloyd wrote: > Craig Ringer wrote: > >On 07/27/2012 09:28 PM, Ryan Kelly wrote: > >>I recently switched from OSX to Linux and \copy in psql no longer > >>accepts multi-line queries. For instance: >

Re: [GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Ryan Kelly
On Fri, Jul 27, 2012 at 09:49:06PM +0800, Craig Ringer wrote: > On 07/27/2012 09:28 PM, Ryan Kelly wrote: > >I recently switched from OSX to Linux and \copy in psql no longer > >accepts multi-line queries. For instance: > > > >\copy ( > >

[GENERAL] Switching from OSX to Linux, multi-line queries in \copy don't work anymore

2012-07-27 Thread Ryan Kelly
) 4.5.2, 64-bit -Ryan Kelly -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general