[GENERAL] Build in function to verify email addresses

2017-11-15 Thread Nick Dro
I beleieve that every information system has the needs to send emails. Currently PostgreSQL doesn't have a function which gets TEXT and return true if it's valid email address (x...@yyy.com / .co.ZZ) Do you believe such function should exist in PostgreSQL or it's best to let every user to implement

Re: [GENERAL] Indexes being ignored after upgrade to 9.5

2017-07-27 Thread Nick Brennan
aviour you report. Best regards Nick > On 27 Jul 2017, at 00:40, Peter Geoghegan wrote: > >> On Wed, Jul 26, 2017 at 2:05 PM, Peter Geoghegan wrote: >>> On Tue, Jul 25, 2017 at 10:34 PM, Nick Brennan wrote: >>> We've added duplicate indexes and analyzing,

Re: [GENERAL] Interesting streaming replication issue

2017-07-26 Thread Gunnar "Nick" Bluth
(sorry for the top post, bitchy K9 Mail) James, are you sure you're scp'ing from the archive, not from pg_xlog? Regards, Gunnar "Nick" Bluth Am 27. Juli 2017 05:00:17 MESZ schrieb James Sewell : >Hi all, > >I've got two servers (A,B) which are part of a

[GENERAL] Indexes being ignored after upgrade to 9.5

2017-07-26 Thread Nick Brennan
efore. All indexes show valid in pg_indexes. We have tried increasing effective_cache_size but no effect (the queries appear to go slower). The DB is 24x7 so we cannot reindex the tables/ partitions. Can anyone suggest why this would be happening? Many thanks Nick

Re: [GENERAL] Coditional join of query using PostgreSQL

2017-05-15 Thread Nick Dro
This is a join in a middle of query. How can I use dynamic SQL in the middle of query?ב מאי 15, 2017 20:26, David G. Johnston כתב:On Mon, May 15, 2017 at 10:02 AM, Nick Dro <postgre...@walla.co.il> wrote: Hi, I'm new to postgresql and couldn't find answer to this situation anywhe

[GENERAL] Coditional join of query using PostgreSQL

2017-05-15 Thread Nick Dro
Hi, I'm new to postgresql and couldn't find answer to this situation anywhere. I asked this here: http://stackoverflow.com/questions/43984208/coditional-join-of-query-using-postgresqlI hope there is a better solution rather than creating two separated functions :(

Re: [GENERAL] Streaming Replication Without Downtime

2017-02-17 Thread Gunnar &quot;Nick" Bluth
(sorry for the toppost, mobile device) What you're looking for is pg_basebackup with - - xlog=stream, I guess. Regards, Nick Am 17. Februar 2017 14:06:36 MEZ schrieb Gabriel Ortiz Lour : >Hi all, >I've been searching for a way to initialize a new Hot Standby node

Re: [GENERAL] pglogical cascading replication (chaining replication)

2016-07-19 Thread Nick Babadzhanian
e done is: on p2: select * from pg_replication_origin; will show all origins on p2, find the origin for p1; on p3: select pg_replication_origin_create('[origin name]'); Discussed here: https://github.com/2ndQuadrant/pglogical/issues/23 Please ignore previous message; Regards,

Re: [GENERAL] pglogical cascading replication (chaining replication)

2016-07-19 Thread Nick Babadzhanian
The solution was found thanks to Petr Jelinek from 2ndQ. > Cascading wasn't much of a priority so far. > Currently you have to create the origin manually using > pg_replication_origin_create(). > I plan to make this work seamlessly in the future release. So whats needed to be done is: on p1:

Re: [GENERAL] Merging timeseries in postgres

2016-07-14 Thread Nick Babadzhanian
Nevermind, I misunderstood your question. The answer is an outer join and if you want the exact output you provided then you can use the following clause. coalesce(dx, dx1) as date Is there any reason why these are two different tables? I'd consider changing data structure. - Original Mes

Re: [GENERAL] Merging timeseries in postgres

2016-07-14 Thread Nick Babadzhanian
Whats exactly is wrong with the following query? select dx date, nx, nx1 from test t join test1 t1 on t.dx=t1.dx1 ; - Original Message - From: "Tim Smith" To: "pgsql-general" Sent: Thursday, July 14, 2016 2:56:19 PM Subject: [GENERAL] Me

Re: [GENERAL] pglogical cascading replication (chaining replication)

2016-07-14 Thread Nick Babadzhanian
I already tried to contact them, but no luck so far. Although it seems to me that the change-set is actually forwarded, its the decoding that is failing on the receiving host. Check the log output for p2 and p3 in my previous message. Regards, Nick. - Original Message - From: "J

Re: [GENERAL] pglogical cascading replication (chaining replication)

2016-07-13 Thread Nick Babadzhanian
G: worker process: pglogical apply 13294:1876007473 (PID 14180) exited with >exit code 1 >LOG: starting apply for subscription sub_p2_to_p3_insert_only >ERROR: cache lookup failed for replication origin >'pgl_test_node_p1_provider_sub_p1_t06410f8' >LOG: worke

Re: [GENERAL] Replication with non-read-only standby.

2016-07-12 Thread Nick Babadzhanian
Thanks. I ended up using pglogical, since I don't really need Bi-directional replication and docs for UDR suggest using pglogical instead. Although I ran into a problem there, but pglogical seems to be the answer. Regards, Nick. - Original Message - From: "Sylvain Marechal&q

[GENERAL] pglogical cascading replication (chaining replication)

2016-07-12 Thread Nick Babadzhanian
I apologize if this is wrong place to ask the question. A quote from pglogical FAQ: > Q. Does pglogical support cascaded replication? > Subscribers can be configured as publishers as well thus cascaded replication > can be achieved > by forwarding/chaining (again no failover though). The only m

[GENERAL] Replication with non-read-only standby.

2016-06-30 Thread Nick Babadzhanian
ive solution to this? Regards, Nick. -- 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] Slave claims requested WAL segment already removed - but it wasn't

2016-06-03 Thread Nick Cleaton
On 2 June 2016 at 02:43, Jeff Beck wrote: > Hi- > We have a master (pg 9.4.4 on Ubuntu 14.10) and a slave (pg 9.4.8 on > Centos 7). During a period of heavy use, the slave began complaining > that the “requested WAL segment xx has already been removed”. But > the WAL segment was still on the m

Re: [GENERAL] Unexpected function behaviour with NULL and/or default NULL parameters

2015-05-06 Thread Gunnar &quot;Nick" Bluth
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 06.05.2015 um 09:57 schrieb David G. Johnston: Ooops, accidentaly replied to David directly... > Wednesday, May 6, 2015, Gunnar "Nick" Bluth > mailto:gunnar.bl...@pro-open.de>> > wrote: > > -BEGIN PGP SIGNED

[GENERAL] Unexpected function behaviour with NULL and/or default NULL parameters

2015-05-06 Thread Gunnar &quot;Nick" Bluth
(1 row) I'm completely puzzled by this behaviour; at least it should cast the "locale_specific" value into the JSON output, shouldn't it? What am I missing? Any hints appreciated! - -- Gunnar "Nick" Bluth RHCE/SCLA Mobil +49 172 8853339 Email: gunnar.bl...@pro-ope

Re: [GENERAL] Collation problem?

2015-04-26 Thread Gunnar &quot;Nick" Bluth
> letters.. So my guestion is if it is possible to get the correct > sort order without recreating all my databases or initialize > PGSQL? > Sure (i.e., if you're on a half recent version): ALTER TABLE ALTER COLUMN COLLATE http://www.postgresql.org/docs/9.4/static/sql-alt

Re: [GENERAL] FK check implementation

2014-10-13 Thread Nick Barnes
On Sat, Oct 11, 2014 at 5:01 AM, Adrian Klaver wrote: > On 10/10/2014 10:41 AM, Nick Barnes wrote: > > >> I understand why the FK insert needs to lock on the PK row. But why is >> the PK delete trying to lock the FK row? If it finds one, won't the >> delete fai

Re: [GENERAL] FK check implementation

2014-10-10 Thread Nick Barnes
On Sat, Oct 11, 2014 at 1:32 AM, Tom Lane wrote: > Nick Barnes writes: > > I'm looking at the code behind the foreign key checks in ri_triggers.c, > and > > something's got me a little confused. > > > In both cases (FK insert/update checking the PK, and PK u

[GENERAL] FK check implementation

2014-10-10 Thread Nick Barnes
I'm looking at the code behind the foreign key checks in ri_triggers.c, and something's got me a little confused. In both cases (FK insert/update checking the PK, and PK update/delete checking the FK) the check is done with a SELECT ... FOR KEY SHARE. This makes perfect sense for PK checks, but i

Re: [GENERAL] table versioning approach (not auditing)

2014-09-29 Thread Nick Guenther
On September 29, 2014 11:08:55 AM EDT, Jonathan Vanasco wrote: > >- use a "transaction" log. every write session gets logged into the >transaction table (serial, timestamp, user_id). all updates to the >recorded tables include the transaction's serial. then there is a >"transactions" table,

Fwd: Re: [GENERAL] Where art thou, plpython2.dll? (EDB installer)

2014-09-23 Thread Nick Guenther
On September 23, 2014 2:27:29 PM EDT, Adrian Klaver wrote: On 09/23/2014 11:05 AM, Nick Guenther wrote: Quoting Seref Arikan : On Tue, Sep 23, 2014 at 9:36 AM, Craig Ringer wrote: Hi all I've had some issues with how the procedural languages are packaged in the Wi

Re: [GENERAL] Where art thou, plpython2.dll? (EDB installer)

2014-09-23 Thread Nick Guenther
40eea SHA1 (/usr/local/lib/postgresql/plpython2.so) = 4dd79641cbad3f71466648559d74e6b0c4f174a3 Any other OpenBSD users that have run into this, here? -- Nick Guenther 4B Stats/CS University of Waterloo -- 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] Watching Views

2014-09-18 Thread Nick Guenther
Ah! Your reply was excellent, David. I only found it now, cleaning out my inbox. Comments inline! Quoting David G Johnston : Nick Guenther wrote As you said, attaching the trigger to a view is useless (for BEFORE/AFTER, which I'm interested in, also only works on statement level ch

Re: [GENERAL] Feature request: temporary schemas

2014-09-14 Thread Nick Guenther
On September 14, 2014 6:01:15 PM EDT, cowwoc wrote: > >On 14/09/2014 5:52 PM, Nick Guenther [via PostgreSQL] wrote: >> >> >> On September 14, 2014 5:01:54 PM EDT, cowwoc <[hidden email] >> > wrote: >> >Hi, >> > >> >I'd li

Re: [GENERAL] Feature request: temporary schemas

2014-09-14 Thread Nick Guenther
On September 14, 2014 5:01:54 PM EDT, cowwoc wrote: >Hi, > >I'd like to propose the ability to create temporary schemas. > >This would facilitate running unit tests, where developers would like >to run >the same creation script for unit tests and production code but do not What if you ran a tem

Re: [GENERAL] change the value of "unix_socket_directories" , must used "-h /xx/xx" to use the Unix domain socket

2014-08-16 Thread Nick Guenther
On August 16, 2014 11:41:02 AM EDT, lin wrote: >Hi all, >I change the value of "unix_socket_directories" in postgresql.conf , >then restart the database, but it cannot connect the database used like >this >"psql -d postgres -p 5432" , it must given the parameter " -h /xx/xx" >to use the Unix

Re: [GENERAL] Watching Views

2014-07-23 Thread Nick Guenther
Quoting David G Johnston : Nick Guenther wrote Dear List, In principle, I am looking for some way to say ``` CREATE VIEW view13131 AS select (id, name, bank_account) from actors where age > 22; WATCH view13131; ``` and get output to stdout like ``` INSERT view13131 VALUES (

[GENERAL] Watching Views

2014-07-17 Thread Nick Guenther
s and gotchas you might have to share. If I ALTER VIEW will the triggers all fire appropriately? Can I even set triggers on views? Thanks in advance -Nick Guenther 4B Stats/CS University of Waterloo [1] Cubes <http://cubes.databrewery.org/> [2] CouchDB. "Filtered Replication".

Re: [GENERAL] Why does autovacuum clean fewer rows than I expect?

2014-07-03 Thread Nick Cabatoff
We've been running 9.2 on our later branches for a while now. We're overdue to bump the older branches to a later 8.4 though, you're right. Thanks for the reminder. On Thu, Jul 3, 2014 at 7:46 PM, Michael Paquier wrote: > On Fri, Jul 4, 2014 at 7:41 AM, Nick Cabatoff

Re: [GENERAL] Why does autovacuum clean fewer rows than I expect?

2014-07-03 Thread Nick Cabatoff
hat turns up. On Thu, Jul 3, 2014 at 5:35 PM, Tom Lane wrote: > Nick Cabatoff writes: > > I'm having trouble making sense of the these two autovacuum log entries. > > I'm running PostgreSQL 8.4. > > 8.4.what? > > It'd probably be a good idea to monito

[GENERAL] Why does autovacuum clean fewer rows than I expect?

2014-07-03 Thread Nick Cabatoff
Hi, I'm having trouble making sense of the these two autovacuum log entries. I'm running PostgreSQL 8.4. [2014-05-22 04:56:43.486 EST] {537cf2c6.30f9} LOG: automatic vacuum of table "postgres.globaldicom.requests": index scans: 1 pages: 0 removed, 163600 remain tuples: 5916 rem

Re: [GENERAL] Patched odbc_dfw for PG >= 9.2 - compiles & works but has issues with NULL representation in ODBC?!?

2014-04-24 Thread Gunnar &quot;Nick" Bluth
Am 19.04.2014 12:44, schrieb Gunnar "Nick" Bluth: Heillo, after stumbling across compile errors for odbc_fdw I realised it was still on the 9.1. level. I've patched it, based on the tds_fdw code (so it's still read-only). It does compile, and I think it is general

[GENERAL] Patched odbc_dfw for PG >= 9.2

2014-04-19 Thread Gunnar &quot;Nick" Bluth
.com/bluthg/odbc_fdw According notes have been added to the Foreign_data_wrappers WIKI page as well (no need for more people to try compiling it ;-). Cheers, -- Gunnar "Nick" Bluth RHCE/SCLA Mobil +49 172 8853339 E

[GENERAL] Inserting boolean types as an alias?

2013-12-02 Thread Nick
Hello I am new to this site and also a student. I am working on an assignment and was wondering if there is a way to make an alias for a boolean? For example when I am making a table called club_games and it must contain the memberID, gameID, count, and status as column fields. When I enter the dat

Re: [GENERAL] High RAM usage on postgres

2013-03-17 Thread Gunnar &quot;Nick" Bluth
d show up in pg_relation_size and friends, but it would get sent to psql of course. Regards, -- Gunnar "Nick" Bluth RHCE/SCLA Mobil +49 172 8853339 Email: gunnar.bl...@pro-open.de __ In 1984 mainstream users w

Re: [GENERAL] PostgreSQL and a clustered file system

2012-11-12 Thread Gunnar &quot;Nick" Bluth
round, should your primary server fail. The journal replay should not hurt you too much, as the relevant I/O PG does is sync anyway. Just my 2p, -- Gunnar "Nick" Bluth RHCE/SCLA Mobil +49 172 8853339 Email: gunnar.bl...@pro-open.de

[GENERAL] At what point does a big table start becoming too big?

2012-08-22 Thread Nick
I have a table with 40 million rows and haven't had any performance issues yet. Are there any rules of thumb as to when a table starts getting too big? For example, maybe if the index size is 6x the amount of ram, if the table is 10% of total disk space, etc? -- Sent via pgsql-general mailing

[GENERAL] High CPU on read-only streaming replication server

2012-07-20 Thread Nick
My read-only streaming replication servers are showing a much higher CPU load than I would expect. None of my queries are longer than 10ms. My application server is connecting to this server via pgbouncer. Other than that, its a pretty standard setup. I haven't toyed with too many settings besid

Re: [GENERAL] High CPU on read-only streaming replication server

2012-07-20 Thread Nick
BTW, Its version 9.1.4 on a 2.2Ghz dual processor with 17GB of ram. -- 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] High CPU on read-only streaming replication server

2012-07-19 Thread Nick
On Jul 19, 1:23 pm, Nick wrote: > My read-only streaming replication servers are showing a much higher > CPU load than I would expect. > > None of my queries are longer than 10ms. > > My application server is connecting to this server via pgbouncer. > > Other than tha

[GENERAL] Return equal number of rows with same column value

2012-06-04 Thread Nick
For the data... INSERT INTO test (id,val) VALUES (1,a); INSERT INTO test (id,val) VALUES (2,a); INSERT INTO test (id,val) VALUES (3,a); INSERT INTO test (id,val) VALUES (4,a); INSERT INTO test (id,val) VALUES (5,b); INSERT INTO test (id,val) VALUES (6,b); How could I return an even amount of val?

Re: [GENERAL] Return equal number of rows with same column value

2012-06-04 Thread Nick
On Jun 4, 5:27 pm, Nick wrote: > For the data... > > INSERT INTO test (id,val) VALUES (1,a); > INSERT INTO test (id,val) VALUES (2,a); > INSERT INTO test (id,val) VALUES (3,a); > INSERT INTO test (id,val) VALUES (4,a); > INSERT INTO test (id,val) VALUES (5,b); > INSERT I

Re: [GENERAL] Chaining inserts ... This would be cool

2012-04-23 Thread Nick Apperson
thout the syntax or equivalent to what I originally posted. Thanks for the help anyway. On Mon, Apr 23, 2012 at 4:19 PM, Thom Brown wrote: > On 23 April 2012 21:49, Nick Apperson wrote: > > There are obviously workarounds for this, but I'm wondering why the > > following query

[GENERAL] Chaining inserts ... This would be cool

2012-04-23 Thread Nick Apperson
There are obviously workarounds for this, but I'm wondering why the following query shouldn't work. It seems like it should. With MVCC already present on the back-end, I can't see any reason other than additional parsing routines that this couldn't work: INSERT INTO old_login_id_to_new_account_id(

[GENERAL] Error trying to set up streaming replication

2012-03-26 Thread Nick
I followed the instructions from http://packetcloud.net/2010/12/09/setting-up-streaming-replication-in-postgresql-9-0/ When I start the standby I get this... LOG: database system was shut down in recovery at 2012-03-26 17:36:32 PDT LOG: entering standby mode cp: cannot stat `/var/lib/postgresql

[GENERAL] Yearly date comparison?

2012-02-28 Thread Nick
What is the best way to find an event with a yearly occurrence? CREATE TABLE events ( start_date DATE, end_date DATE, recurring TEXT ); INSERT INTO events (start_date, end_date, recurring) VALUES ('2010-02-28','2010-03-01','yearly'); SELECT * FROM events WHERE (start_date+'2 YEARS'::I

[GENERAL] Help speeding up a left join aggregate

2012-01-31 Thread Nick
I have a pretty well tuned setup, with appropriate indexes and 16GB of available RAM. Should this be taking this long? I forced it to not use a sequential scan and that only knocked a second off the plan. QUERY PLAN --

[GENERAL] How to know if update is from a foreign key cascade in plperl?

2012-01-25 Thread Nick
Is it possible (in a plperl function) to know if an update is from a foreign key cascade, rather than just a user submitted update statement? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-genera

Re: [GENERAL] Whats the most efficient query for this result?

2012-01-17 Thread Nick
On Jan 17, 3:33 am, t...@audioboundary.com (Tom Molesworth) wrote: > Hi Nick, > > On 17/01/12 00:18, Nick wrote: > > > > > > > > > > > I have three tables (users, books, pencils) and would like to get a > > list of all users with a count and total

Re: [GENERAL] Whats the most efficient query for this result?

2012-01-17 Thread Nick
On Jan 17, 3:33 am, t...@audioboundary.com (Tom Molesworth) wrote: > Hi Nick, > > On 17/01/12 00:18, Nick wrote: > > > > > > > > > > > I have three tables (users, books, pencils) and would like to get a > > list of all users with a count and total

Re: [GENERAL] Whats the most efficient query for this result?

2012-01-17 Thread Nick
On Jan 17, 3:33 am, t...@audioboundary.com (Tom Molesworth) wrote: > Hi Nick, > > On 17/01/12 00:18, Nick wrote: > > > > > > > > > > > I have three tables (users, books, pencils) and would like to get a > > list of all users with a count and total

[GENERAL] Whats the most efficient query for this result?

2012-01-17 Thread Nick
I have three tables (users, books, pencils) and would like to get a list of all users with a count and total price of their books and pencils for 2012-01-01... So with this data... users (user_id) 1 2 3 books (user_id, price, created) 1 | $10 | 2012-01-01 1 | $10 | 2012-01-01 3 | $10 | 2012-01-0

Re: [GENERAL] Postgresql allow connections without password [SOLVED]

2012-01-13 Thread debian nick
Thanks raymond, you were right, i never think that psql was using .pgpass file. When a delete it psql ask me for the password. THANKS I’ll never figure that out. 2012/1/13 Raymond O'Donnell > On 12/01/2012 05:16, debian nick wrote: > > I have postgresql 8.4.9 installed now, my p

[GENERAL] Postgresql allow connections without password

2012-01-12 Thread debian nick
I have postgresql 8.4.9 installed now, my problem is that from time to time my postgresql let psql version 8.4.9 access the database without asking for password (psql -d mydatabase -h myhost -U myuser), and the connection attempts from psql 8.3 are not allowed no matter what i got time out exceptio

[GENERAL] Pl/pgsql function

2011-06-04 Thread Nick Raj
I am implementing some pl/pgsql functions. Is there any way to change the input for example- I got some value by $1. I want to modify this value (means split that value), Can we do this and how? Second thing, Suppose i defined a function test as select test('geom',the_geom,time) from tablename .

Re: [GENERAL] Index Size

2011-05-30 Thread Nick Raj
On Tue, May 31, 2011 at 8:50 AM, Tom Lane wrote: > Craig Ringer writes: > > On 05/30/2011 08:53 PM, Nick Raj wrote: > >> Cube code provided by postgres contrib folder. It uses the NDBOX > structure. > >> On creating index, it's size increase at a high rate. &g

[GENERAL] Index Size

2011-05-30 Thread Nick Raj
Can some one tell me why index is becoming so large? How to compress or reduce its size? Thanks Nick

Re: [GENERAL] disable seqscan

2011-05-23 Thread Nick Raj
On Mon, May 23, 2011 at 7:35 PM, Tom Lane wrote: > Nick Raj writes: > >> Andrew Sullivan wrote: > >>> It sounds like your index can't actually be used to satisfy your > >>> query. Without seeing the table definition, index definition, and > >&g

Re: [GENERAL] disable seqscan

2011-05-23 Thread Nick Raj
On Mon, May 23, 2011 at 5:44 PM, Andreas Kretschmer < akretsch...@spamfence.net> wrote: > Andrew Sullivan wrote: > > > On Mon, May 23, 2011 at 05:31:04PM +0530, Nick Raj wrote: > > > Hi, > > > I have build an index. When, i execute the query, it gives the re

[GENERAL] disable seqscan

2011-05-23 Thread Nick Raj
an idea to force postgres to use index scan? Thanks Nick

[GENERAL] arguments are not toastable

2011-05-16 Thread Nick Raj
Hi, I have defined some function and also used NDBOX structure that having variable length. typedef struct NDBOX { int32vl_len_;/* varlena length */ unsigned int dim; doublex[1]; } NDBOX; When i called my function, it gives NDBOX to be null On debugging, i foun

[GENERAL] Toast datum

2011-05-16 Thread Nick Raj
Hi, #define DatumGetNDBOX(x)((NDBOX*)DatumGetPointer(x)) #define PG_GETARG_NDBOX(x)DatumGetNDBOX( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) ) Now i have to define #define NDBOXGetDatum(x) ()PointerGetDatum(x) Is there any need to replace this ?? with some toastable thing or is it suff

Re: [GENERAL] Debug Contrib/cube code

2011-05-13 Thread Nick Raj
, 2011 at 6:42 AM, Joshua Tolley wrote: > On Fri, May 06, 2011 at 10:43:23AM +0530, Nick Raj wrote: > > Hi, > > I am using postgresql-8.4.6. I want to debug the contrib/cube code. Can > we > > able to debug that cube code? Because there is no .configure file to > > ena

[GENERAL] Debug Contrib/cube code

2011-05-05 Thread Nick Raj
Hi, I am using postgresql-8.4.6. I want to debug the contrib/cube code. Can we able to debug that cube code? Because there is no .configure file to enable debug. Is there is any way to change make file to enable debug? Thanks Nick

[GENERAL] Defining input function for new datatype

2011-04-21 Thread Nick Raj
makes pointer from integer without a cast ../../../include/utils/timestamp.h:205: note: expected ‘FunctionCallInfo’ but argument is of type ‘unsigned int’ Can anybody figure out what kind of mistake i am doing? Also, why it got related to 'FunctionCallInfo' ? Thanks Nick

Re: [GENERAL] Typecast

2011-04-18 Thread Nick Raj
Thanks dude On Mon, Apr 18, 2011 at 2:25 PM, Chetan Suttraway < chetan.suttra...@enterprisedb.com> wrote: > > > On Fri, Apr 15, 2011 at 10:29 PM, Nick Raj wrote: > >> Hi, >> Can anybody tell me how to typecast data type Point into Datum? >> >> Thanks &g

[GENERAL] Typecast

2011-04-15 Thread Nick Raj
Hi, Can anybody tell me how to typecast data type Point into Datum? Thanks Nick

[GENERAL] Global Variables in plpgsql

2011-04-11 Thread Nick Raj
Hi, Can anyone know how to define global variable in plpgsql? Thanks Regards, Raj

[GENERAL] Integrating New Data Type

2011-04-05 Thread Nick Raj
Hi all, I have defined a new data type. I have defined in and out function for that data type. But i want to know how to integrate this data type with postgres (how postgres compile my code or know my datatype) ? Thanks, Nirmesh

Re: [GENERAL] Understanding Datum

2011-03-23 Thread Nick Raj
lue of Datum in postgres? On Thu, Mar 24, 2011 at 2:35 AM, Tom Lane wrote: > Nick Raj writes: > > In postgres, typedef uintptr_t Datum > > Datum is getting value from PG_GETARG_POINTER(1); > > But, now problem is how would i know the type of PG_GETARG_POINTER(1) > > (

Re: [GENERAL] Understanding Datum

2011-03-23 Thread Nick Raj
?? How to find out what type of pointer argument is PG_GETARG_POINTER(1)?? Thanks, Nirmesh On Wed, Mar 23, 2011 at 11:40 PM, Radosław Smogura wrote: > Nick Raj Wednesday 23 March 2011 18:45:41 > > Hi, > > I am understanding the postgres code. In code, i just want to see what > a

[GENERAL] Understanding Datum

2011-03-23 Thread Nick Raj
Hi, I am understanding the postgres code. In code, i just want to see what are values that are passing through the variables? Can you please tell me if the variable is of type Datum, then how to print its value? Because i dont the variable v type. And also what the structure of Datum? Thanks, Raj

[GENERAL] OT: Oleg Bartunov in Himalaya...

2011-03-16 Thread Nick Rudnick
x27;t reject the reflex to post this here, wow... Please excuse & all the best, Nick -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Composite index structure

2011-03-06 Thread Nick Raj
Hi all, I want to construct an "Composite Index Structure" i.e. a combination of gist and btree. What i am thinking is that first creating a Rtree structure that is pointing to another Btree structure. For example, Suppose i want to find vehicles between 2 to 4 pm on 14/2/2011 on X road. I am thi

[GENERAL] data type

2011-03-02 Thread Nick Raj
Hi, I am writing some function in postgres pl/sql. My function is of type St_ABC((select obj_geom from XYZ),(select boundary_geom from boundary)) I have table XYZ with 20,000 tuples and in boundary, i have only one geometry. In postgres, ST_intersects(obj_geom, boundary_geom) checks each obj_geom

Re: [GENERAL] Are there any projects interested in object functionality? (+ rule bases)

2011-01-21 Thread Nick Rudnick
architecture will do really significantly slower than OODBMS/ORDBMS more specialized for that sake (the same with rules...)?? Or is it worth to give it a try? This would be my last resort, Nick Although postgres at one time had "ORDBMS" as a goal, I haven't seen any real inte

Re: [GENERAL] Are there any projects interested in object functionality? (+ rule bases)

2011-01-21 Thread Nick Rudnick
allow them to use PostgreSQL for that sake. So I am meaning OO in a very broad sense. All the best, Nick On 01/21/2011 04:10 PM, Andy Colson wrote: Short answer: no. Here are some counter questions for you: Have you ever seen any actual real world usage of OORDBMS? Are there any products

[GENERAL] Are there any projects interested in object functionality? (+ rule bases)

2011-01-21 Thread Nick Rudnick
ckend constrain this in regard of performance? Thanks a lot in advance, Nick

Re: [GENERAL] Thoughts on a surrogate key lookup function?

2010-11-06 Thread Nick
) RETURNING id INTO NEW.last_name_id So by adding both the surrogate and natural keys to users table and toggling the surrogate on insert by 0 (must exist) or -1 (select or insert) I can bypass a much more complex insert statement. Is this frowned upon? I havent had many issues (but some ive been a

[GENERAL] Thoughts on a surrogate key lookup function?

2010-11-06 Thread Nick
Are there any existing trigger functions (preferably C) that could retrieve a missing value for a compound foreign key on insert or update? If this overall sounds like a really bad idea, please let me know as well. This functionality could really speed my project up though. For example, CREATE TA

Re: [GENERAL] It it possible to get this result in one query?

2010-10-15 Thread Nick
Thanks Guy, is it possible to get the 3rd column result as an array instead of string? -Nick On Oct 14, 9:27 pm, guyr-...@burntmail.com (Guy Rouillier) wrote: > Sure: > > select >     t3.id, >     coalesce >        ( >        t1.title, >        t2.

Re: [GENERAL] It it possible to get this result in one query?

2010-10-14 Thread Nick
Found a solution for what I need. Please let me know if you know of something better/faster. -Nick CREATE AGGREGATE array_accum (anyelement) ( sfunc = array_append, stype = anyarray, initcond = '{}' ); SELECT id, title, array_accum(t) AS ts FROM ( SELECT 'table_one&#

[GENERAL] It it possible to get this result in one query?

2010-10-14 Thread Nick
Is it possible to get the results of this snip of a function without using a function? All tables include an id and title column. tables := ARRAY[table_one,table_two,table_three]::VARCHAR; CREATE TEMP TABLE final_results (id INTEGER, title VARCHAR, r_types VARCHAR[]); FOR t IN ARRAY_LOWER(tables,1

Re: [GENERAL] It it possible to get this result in one query?

2010-10-14 Thread Nick
... 1 | new one | [table_one,table_three] 2 | new two | [table_two,table_three] 3 | three | [table_three] On Oct 14, 4:49 pm, Nick wrote: > Is it possible to get the results of this snip of a function without > using a function? All tables include an id and title column. > > tables := ARR

[GENERAL] Is there a bug in FOR i IN 1..10 LOOP (8.4.4)?

2010-09-11 Thread Nick
CREATE FUNCTION test() RETURNS text LANGUAGE plpgsql AS $$DECLARE num_var TEXT; BEGIN FOR i IN 1..10 LOOP num_var := num_var || ',' || i; END LOOP; RETURN num_var; END;$$; SELECT test(); returns NULL -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To ma

Re: [GENERAL] Is there a bug in FOR i IN 1..10 LOOP (8.4.4)?

2010-09-11 Thread Nick
Woops, figured it out. Just needed to declare the num_var := ''; On Sep 11, 10:45 pm, Nick wrote: > CREATE FUNCTION test() RETURNS text >     LANGUAGE plpgsql >     AS $$DECLARE >   num_var TEXT; > BEGIN >   FOR i IN 1..10 LOOP >     num_var := num_var || &#x

Re: [GENERAL] Regular expression that splits CSV string into table

2010-09-10 Thread Nick
I dont mind if the commas are at the beginning and end, im more concerned about "three,four" staying in one row because its surrounded by quotes. -Nick On Sep 10, 6:03 pm, alvhe...@commandprompt.com (Alvaro Herrera) wrote: > Excerpts from Nick's message of vie sep 10 2

Re: [GENERAL] Regular expression that splits CSV string into table

2010-09-10 Thread Nick
Yes, that gets down to the root of my question... what is the expression that would properly split the values? -Nick On Sep 10, 4:43 pm, brick...@gmail.com (bricklen) wrote: > On Fri, Sep 10, 2010 at 3:43 PM, Nick wrote: > > What would be the regexp_split_to_table pattern that split

[GENERAL] Regular expression that splits CSV string into table

2010-09-10 Thread Nick
What would be the regexp_split_to_table pattern that splits a comma separated string into a table? Im having trouble when a string contains commas or there are commas at the beginning or end String ',one,two,''three,four'',five,six,' Should return ,one two three,four five six, -- Sent via pgsql

Re: [GENERAL] Dynamically update NEW columns in plpgsql trigger

2010-09-09 Thread Nick
On Sep 9, 2:21 am, dmit...@gmail.com (Dmitriy Igrishin) wrote: > Hey Nick, > > You may do it with PL/pgSQL more easily with hstore module. > Please, refer tohttp://www.postgresql.org/docs/9.0/static/hstore.html > Please, look at the hstore(record) and populate_record(record, hst

[GENERAL] Dynamically update NEW columns in plpgsql trigger

2010-09-08 Thread Nick
I need to dynamically update NEW columns. Ive been inserting the NEW values into a temp table, updating them, then passing the temp table values back to NEW (is there a better way?). Ive had success with this method unless there is a null value... EXECUTE 'CREATE TEMP TABLE new AS SELECT $1.*' USI

Re: [GENERAL] On insert duplicate row, return existing key

2010-08-04 Thread Nick
Anyone? Please On Jul 31, 12:36 pm, Nick wrote: > If I insert a duplicate row into a table, id like to return the > existing key. > > I tried creating a rule for this... > > CREATE RULE no_duplicates AS ON INSERT TO names WHERE EXISTS (SELECT 1 > FROM names WHERE new.na

[GENERAL] Find users that have ALL categories

2010-06-30 Thread Nick
Is this the most efficient way to write this query? Id like to get a list of users that have the categories 1, 2, and 3? SELECT user_id FROM user_categories WHERE category_id IN (1,2,3) GROUP BY user_id HAVING COUNT(*) = 3 users_categories (user_id, category_id) 1 | 1 1 | 2 1 | 3 2 | 1 2 | 2 3 |

[GENERAL] Problem with query using ST_Dwithin

2010-01-28 Thread Nick
sectors_basetop.geom or artcc.the_geom, because the last working query also works when matching intersecting polygons with the zoa_sectors_basetop.geom. So looks like the problem may lie in the geometry in the table zoa_metar_xml. But can't figure why? Hope this is enough info, can anyone help

Re: [GENERAL] Problem with query using ST_Dwithin

2010-01-28 Thread Nick
On Jan 28, 4:32 pm, Nick wrote: > The following query's all work fine, > > select distinct zoa_metar_xml.stn_id, zoa_metar_xml.metar_txt, > zoa_metar_xml.time, zoa_metar_xml.flt_cat, zoa_metar_xml.cld_cvr, > zoa_metar_xml.cld_base, zoa_metar_xml.lonlat, zoa_metar_xml.geom

Re: [GENERAL] Index not used when using a function

2010-01-13 Thread Nick
On Jan 13, 4:21 pm, t...@sss.pgh.pa.us (Tom Lane) wrote: > Nick writes: > > SELECT * FROM locations WHERE id = 12345 LIMIT 1 > > uses the primary key (id) index, but... > > SELECT * FROM locations WHERE id = get_location_id_from_ip(641923892) > > LIMIT 1 > > does

  1   2   >