Re: [SQL] DB link from postgres to Oracle; how to query Dbname.tablename?

2013-10-02 Thread Jayadevan M
preceding 3 lines from PG_LINK;* > > I tried dbname.tablename syntax, but it didn't work! BTW, all my tables > belong to public schema. > > Does anyone with DB link expertise try to answer my question? > > Thanks, > Bhanu M. Gandikota > Mobile: (415) 420-7740 &g

[SQL] Aggregate over a linked list

2013-01-17 Thread M Lubratt
Hello! I trade futures contracts and I have a PostgreSQL 9.2 database that keeps track of all of my trading activity. The table includes columns for the futures contract, the entry and exit dates and the profit for that particular trade. Now, futures contracts expire, so within a trade being ind

Re: [SQL] How to limit access only to certain records?

2012-06-22 Thread Jayadevan M
HI, > > is there a way to limit access for some users only to certain records? > > e.g. there is a customer table and there are account-managers. > Could I limit account-manager #1 so that he only can access customers > only acording to a flag? > > Say I create a relation cu_am ( customer_id,

Re: [SQL] Postgresql function which compares values from both tables

2012-03-19 Thread Jayadevan M
Hi, > To: pgsql-sql@postgresql.org > Subject: [SQL] Postgresql function which compares values from both tables > > hi , > how to write a function which should read data from 2 tables having > same number of columns and should show the common values from those tables. If you want to compare and

[SQL] help on a function with exception

2012-03-14 Thread M. D.
Hi, I want to do a check on a column if other columns meet certain conditions. The program I'm working with allows to create additional columns on every 'object' - called extra data, but I have no control over the program. I want to enforce the values on this one extra data to be of type dat

[SQL] running totals with end of month line

2011-11-30 Thread M. D.
Hi everyone, I would like to create a query that does a running total for each account, but I also want to show a 'phantom' row that gives the end of month with the last day of the month as the transaction date. Here's a sample query: SELECT n.customer_id, n

[SQL] Cursor names in a self-nested function

2011-08-18 Thread Kidd, David M
s. Any other solutions are of cause welcome. Many thanks, - David David M. Kidd Research Associate Center for Population Biology Silwood Park Campus Imperial College London 0207 594 2470

[SQL] parsing audit table

2011-08-16 Thread M. D.
Hi everyone, I'm a bit lazy, or actually in a bit of a crunch. I added an audit recording a few months ago, but never really used it much, but today I'm seeing a bunch of suspicious activity by one user. Does someone have any function to quickly parse this data? I followed this: http://wik

[SQL] group by with sum and sum till max date

2011-07-05 Thread M. D.
This is a little hard to explain, and I'm not sure if it's possible, but here goes. This is my query: select year, month, (select number from account where account.account_id = view_account_change.account_id) as number, (select name from account where account.account_id = view_account_change.a

Re: [SQL] Get the max viewd product_id for user_id

2010-12-05 Thread Jayadevan M
> > The issue in both approaches is that if I have two product_ids that are > > viewed same number of times and share the first place as most viewed > > products by that user, I'll get only one of them (LIMIT 1 OR MAX() can > > only return one row :). > > > > And then, to jump again into my own m

Re: [SQL] Get the max viewd product_id for user_id

2010-12-03 Thread Jayadevan M
Hello, > I went this way, but for a large number of user_id's, it's quite slow: > > CREATE VIEW v_views AS >SELECT user_id, product_id, count(*) as views >FROM viewlog >GROUP BY user_id, product_id > > SELECT >DISTINCT user_id, >(SELECT product_id FROM v_views inn WHERE inn.u

Re: [SQL] Calculate next event date based on instance of the day of week

2010-12-02 Thread Jayadevan M
Hello, > I have a table which stores an event date. The event is stored as a > standard mm/dd/yy entry. > > I then need to calculate based on the dd value, WHICH day of the > week that is (e.g. Wednesday) and which occurrence of that day of > the week, within the month, it is (e.g. the THIRD We

Re: [SQL] find and replace the string within a column

2010-09-24 Thread Jayadevan M
Hello, > the below one help's me to find the data within the two brackets. > > SELECT name,(REGEXP_MATCHES(name, E'\\(.+?\\)'))[1] from person; > regexp_matches > > (S/o Sebastin ) > - > Trying to work with your code - upda

Re: [SQL] SUM the result of a subquery.

2010-09-02 Thread Jayadevan M
> SELECT SUM ( > (SELECT i.id_item, i.price, SUM (o.quantity), ROUND (SUM > (o.quantity) * i.price, 2) AS cost > FROM orders o > JOIN items i ON i.id_item = o.id_item > WHERE o.date_order BETWEEN '2010-01-01' AND '2010-01-31' > GROUP BY i.id_item, i.price) > ); > > No luck. Obviously SUM expects

Re: [SQL] backup and document views and user functions

2010-08-30 Thread Hélder M . Vieira
carefully if this is waht you're looking for. Regards, Helder M. Vieira -- 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] [GENERAL] How to Get Column Names from the Table

2010-07-07 Thread Jayadevan M
> Use: > \d tablename And what I really like about it is the way you can make a guess about the table name and use * . postgres-# \d mt* Table "public.mt1" Column | Type | Modifiers +-+--- id | integer | Table "public.mt2" Column | Type | Modi

Re: [SQL] LEFT OUTER JOIN issue

2010-04-21 Thread Jayadevan M
Hi, > SELECT ct.dat,ct.heur,hp.datmesure,hp.heuremesure,hp.t FROM calendar_temp as ct > LEFT OUTER JOIN h_part as hp > ON ct.dat = hp.datmesure > AND ct.heur = hp.heuremesure > WHERE > hp.poste_idposte = 275 > ORDER BY ct.dat, ct.heur > dat heur datmesure heu

Re: [SQL] SQL syntax rowcount value as an extra column in the result set

2010-03-25 Thread Jayadevan M
Hi, >It works, but you should use a recent version: >test=*# select count(1) over (), i from foo; > count | i >---+ > 8 | 1 > 8 | 2 > 8 | 3 > 8 | 6 > 8 | 7 > 8 | 9 > 8 | 13 > 8 | 14 >(8 rows) > test=*# select version(); >

Re: [SQL] SQL syntax rowcount value as an extra column in the result set

2010-03-25 Thread Jayadevan M
Hi, I don't think so. Oracle - SQL> select count(*) over () as ROWCOUNT , first_name from people; ROWCOUNT FIRST_NAME -- - --- 6 Mary 6 Mary 6 John 6 John

Re: [SQL] SQL syntax rowcount value as an extra column in the result set

2010-03-25 Thread Jayadevan M
Hi, Is this what you are trying to do? postgres=# select * from (select count(*) from people ) p, (select firstname from people)p2; count | firstname ---+--- 5 | Mary 5 | Mary 5 | John 5 | John 5 | Jacob (5 rows) I do not know about the performance impact of s

Re: [SQL] left outer join on more than 2 tables? (UNCLASSIFIED)

2009-06-17 Thread Hall, Crystal M CTR DISA JITC
Classification: UNCLASSIFIED Caveats: NONE My problem with that is that you are counting rows per region and you have done a left jion on region. That means there will be at least one row per region even if there are 0 compliants. It might yield the same result now, but if you even have a p

Re: [SQL] left outer join on more than 2 tables? (UNCLASSIFIED)

2009-06-16 Thread Hall, Crystal M CTR DISA JITC
Classification: UNCLASSIFIED Caveats: NONE Maybe I am way of base here, but I see a reference to region in this query. However, I think count(cm.id) is correct because some would have a count of 0. Count(*) would produce counts when there are no complaints. (If I understand the logic, again, I

Re: [SQL] left outer join on more than 2 tables? (UNCLASSIFIED)

2009-06-16 Thread Hall, Crystal M CTR DISA JITC
Classification: UNCLASSIFIED Caveats: NONE Pardon my lameness, I have JUST dipped my toes in PostgreSQL and want to try this out! I'm probably wrong but here goes my very first PostgreSQL join attempt! SELECT region_name, count(complaint.id) FROM region LEFT JOIN city ON (region.id = city.reg

Re: [SQL] Problemas com Procedure no PostgreSQL

2009-04-17 Thread Hélder M . Vieira
ias nos select e update, uma vez que não há join envolvidos Cumprimentos, Hélder M. Vieira create or replace function trava_inadimplentes ( pdias_vencido integer, pund_local varchar(3), pcnpj varchar(18) ) returns boolean as $$ declare spermite_bloqueio varchar(1); inro_re

Re: [SQL] Problemas com Procedure no PostgreSQL

2009-04-17 Thread Hélder M . Vieira
caso continue a ter problemas, volte a publicar aqui o script na sua nova redacção. Já agora, quando publicar mensagens nesta lista, caso lhe seja possível escreva em inglês. Cumprimentos, Helder M. Vieira -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make chan

[SQL] looking for example of inserting into a view

2008-08-20 Thread EXT-Rothermel, Peter M
I can't seem to find an example I vaguely remember seeing when I was originally learning about INSERT rules and views. This example features a view that is an outer join of several tables. The example shows how to generate a CSV file of the data in the view and then loading the data into the origi

[SQL] LIMIT question

2008-08-19 Thread EXT-Rothermel, Peter M
I need to use a LIMIT count in a query but I also need to know how many rows the query itself would yield without the limit. I can do this inside a transaction like this BEGIN SELECT COUNT(*) from table1 where blah; select * from table1 where blah LIMIT 1000; COMMIT Now I can give some feedback l

[SQL] Savepoints and SELECT FOR UPDATE in 8.2

2008-08-01 Thread EXT-Rothermel, Peter M
I have a client application that needs: SELECT a set of records from a table and lock them for potential updates. for each record make some updates to this record and some other records in other tables call some call a function that does some application logic that does not access the da

Re: [SQL] Having the sum of two queries

2007-07-16 Thread Hélder M . Vieira
ect status from imported_users ) as fff group by status; Regards, ´ Helder M. Vieira ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] Removing duplicate rows

2007-02-06 Thread Hélder M . Vieira
eate temporary table mytesttable (like mymaintable excluding constraints excluding defaults); Regards, Hélder M. Vieira ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] Looping recordset

2007-01-25 Thread Hélder M . Vieira
selected rows or, perhaps, use the SELECT in the FOR..LOOP and subsequently perform the DELETE. Hélder M. Vieira ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command

[SQL] pg_dump

2006-09-05 Thread M. Santosa
I've install postgres in linux. but pg_dump its not working at all. if i execute the pg_dump to the file like this pg_dump -Upostgres -dpostgres > file.dmp the file file.dmp is empty and if i execute the psql with list database option, the result is error -bash-3.00$ psql -l ERROR: relation

Re: [SQL] distinct with sum

2006-07-09 Thread Hélder M . Vieira
sum there. The query: select distinct on (id_prod) id_prod, id_unit, sum(quantity) as result from products where determinant = false group by id_prod, id_unit select id_prod, id_unit, sum(quantity) as result from products where determinant = false group by id_prod, id_unit Hélder M. Vieira

[SQL] Re: [SQL] Problema com função UPPER

2006-06-20 Thread Hélder M . Vieira
Eduardo, creio que o problema decorre do jogo de caracteres usado... No meu caso, uma vez que vivo em Portugal, uso o jogo LATIN9 quando crio uma nova base de dados. Simplificando: CREATE DATABASE xpto WITH OWNER = postgres ENCODING = 'LATIN9' TABLESPACE = pg_default;

[SQL] References NULL field

2006-04-02 Thread Paul M Foster
FROM registrars, notes WHERE regname = 'blah' no matter that I put after the 'blah' (or nothing), I get no results. As soon as I add notes into the tables being queried, I get nothing. There's some special way I need to shape this query, but I don't know what it is. Any

[SQL] Locale and pattern matching

2005-12-07 Thread Hélder M . Vieira
users: Until now, I've been selecting LATIN1 encoding, but after a few tests, I came to think that LATIN9 is a better option (the euro sign...). For those who regularly use LATIN9, what is your opinion ? Is it indeed a better option ? Thank you. Hélder M. Vieira LATIN CAPITA

Re: [SQL] Quote_literal()

2005-12-03 Thread James M Doherty
the one of the functions. Any way thanks for taking the time to look at my issue. Jim James M Doherty Principal JMD CONSULTING 411 Thunderbay Dr Georgetown, TX 78626 A reputation is something others give you HONOR is something you give yourself! -Original Message- From: Tom Lane [mai

Re: [SQL] quote_literal() fails with unmatched quotes

2005-11-30 Thread James M Doherty
Nmostlikemat := ''10/3/2009''; What happens is that quote_literal works for everyone in the example but this one. Jim James M Doherty Principal JMD CONSULTING 411 Thunderbay Dr Georgetown, TX 78626 A reputation is something others give you HONOR is something you give your

[SQL] Quote_literal()

2005-11-30 Thread James M Doherty
declare SQL text; NSQLtext; SQL := ''10/3/2009''; NSQL := quote_literal(SQL); The result is '10/3/2009 with no closing quote. Jim James M Doherty Principal JMD CONSULTING 411 Thunderbay Dr Georgetown, TX 78626 A reputation is something

[SQL] quote_literal() fails with unmatched quotes

2005-11-30 Thread James M Doherty
error returns from postgres 8.1 ERROR: unterminated quoted string at or near "'2009-10-03" at character 122 QUERY: insert into scenario_inv (inv_id,record_date,scenario_type,mostlikemat,mktpr,mktyld ) values ( '405832','2005-06-30','1','2009-10-03

Re: [SQL] max() unexpected type conversion

2005-11-21 Thread Hélder M . Vieira
underlying data is of type 'varchar', one has to be always very cautious about the 'text' conversion, otherwise all readings after the first will return null instead of valid data. Helder M. Vieira ---(end of broadcast)--- TIP 4: H

[SQL] max() unexpected type conversion

2005-11-21 Thread Hélder M . Vieira
x27;); insert into test (testcol) values ('B'); insert into test (testcol) values ('B'); insert into test (testcol) values ('C'); insert into test (testcol) values ('C'); select max(testcol) from test; Thank you Hélder M. Vieira

Re: [SQL] how to do a find and replace

2005-11-17 Thread Hélder M . Vieira
-matching.html), it isn't mentioned in section '9.4. String Functions and Operators' (http://www.postgresql.org/docs/8.1/interactive/functions-string.html). Hélder M. Vieira ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] table listing queries

2005-08-25 Thread Hélder M . Vieira
probably happens because of the need for some kind of unified repository of objects pertaining to different database engines. Helder M. Vieira ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] Fwd: How to encrypt a column

2005-08-11 Thread Hélder M . Vieira
rypted column be of type "text" ? I'd check a previous critical point ... The encrypt() function output. What is the range of characters in encrypt() output ? Control, null or false escape characters, if not properly escaped, could be misleading either sprintf or t

Re: [SQL] 'select where' using multiple columns.

2005-08-05 Thread Hélder M. Vieira
;%String%' OR surname LIKE '%String%' Helder M. Vieira ---(end of broadcast)--- TIP 6: explain analyze is your friend

[SQL] Question about update syntaxt

2005-04-29 Thread Michael M Friedel
igure that will make Postgresql accept these kind of statments ? ---- Michael M Friedel Research & Development ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

[SQL] unsubscribe pgsql-sql

2005-03-31 Thread Robin M.
unsubscribe pgsql-sql ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] Failed system call was shmget(key=1, size=1155072, 03600).

2004-12-03 Thread Andrew M
Hi, when building postgreSQL 8 I get the following error message: DETAIL: Failed system call was shmget(key=1, size=1155072, 03600). HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currentl

Re: [SQL] Querying a list field against another list

2004-11-27 Thread m
Try this: CREATE OR REPLACE FUNCTION csv_matches(TEXT, TEXT) RETURNS BOOLEAN AS $$ DECLARE -- $1 is the field text, $2 is the list of ints to try and match. m TEXT; f TEXT; i INTEGER := 1; j INTEGER; BEGIN IF $1 IS NULL THEN RETURN &#

[SQL] HowTo change encoding type....

2004-11-25 Thread Andrew M
Hi, how do I change the encoding type in postgreSQL (8) from UTF-8 to ISO-8859-1? many thanks Andrew <>  +The home of urban music + http://www.beyarecords.com ---(end of broadcast)--- TIP 8: explain analyze is your friend

[SQL] TEXT::CIDR/INET::CIDR output confusion

2004-11-12 Thread Alexander M. Pravking
uch=# SELECT version(); version PostgreSQL 7.4.5 on i386-portbld-freebsd5.3, compiled by GCC cc (GCC) 3.4.2 [FreeBSD] 20040728 -- Fduch M. Pravking --

Re: [SQL] CHECK col A not NULL if col B='x'

2004-09-28 Thread Alexander M. Pravking
constraint "test_a" [EMAIL PROTECTED] INSERT INTO test VALUES (1, 'x'); INSERT 107539 1 -- Fduch M. Pravking ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] create unique index schema.index_name on table (column)?

2004-09-13 Thread =?ISO-8859-1?Q?m=D8ntar3?=
I'm working with a closed source application that reads an ASCII file and as it does it (via ODBC) creates tables and indexes, inserting as it goes. Like so: CREATE TABLE bgsuser.CAXCTRLD ( CTRLS INTEGER, INTVL INTEGER); CREATE UNIQUE INDEX bgsuser.PRIMARY_CAXCTRLD ON bgsuser.CAXCTRLD (CTRLS,IN

[SQL] HOW TO HANDLE ZEROS IN DATE FIELD?

2004-09-10 Thread James M Doherty
e have experience in solving this problem. The other alternative I thought of was to write a trigger to fix it ?? James M Doherty [EMAIL PROTECTED] Georgetown, TX 78626 "There is no luck without discipline" IRISH PROVERB ---(end of broadcast)---

Re: [SQL] Storing properties in a logical way.

2004-09-06 Thread Daniel M.
On Sun, 05 Sep 2004 19:51:44 +0200, Pierre-Frédéric Caillaud <[EMAIL PROTECTED]> wrote: >> But after looking closely at the list of a possible properties, i found >> out that some of them depend on others. For example, if item is a >> PDF document, it can have an index. But a document can also ha

[SQL] Storing properties in a logical way.

2004-09-05 Thread Daniel M.
Hello everybody, In a database there is a table with items, and each item can have 0 to n properties. The objective is to store information about items' properties in a mentioned database in a logical and an efficient way. Usually it is easily done by creating a validation table with a list of poss

Re: [SQL] Problem in age on a dates interval

2004-07-19 Thread Alexander M. Pravking
e Petrosky <[EMAIL PROTECTED]> writes: > > > > > >>wow at first I thought I had my head around a leap > >>year problem so I advanced your query a year > >> > >> > > > >I think what's going on here is a difference of i

[SQL] Indexable (constant LIKE prefix_keyfield) ?

2004-07-14 Thread Alexander M. Pravking
l' AND 'literal' LIKE prefix || '%' ORDER BY prefix DESC LIMIT 1; Looks like the best way, but I'm not sure this is always correct. Comments, suggestions, please? -- Fduch M. Pravking ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] UPDATE ... WHERE (subselect on the same table)

2004-06-29 Thread Alexander M. Pravking
When an alias is provided, it completely hides the actual name of the table or table function; /me should RTFM... (repeating hundred times) -- Fduch M. Pravking ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

[SQL] UPDATE ... WHERE (subselect on the same table)

2004-06-29 Thread Alexander M. Pravking
used here will work correctly, i.e. will the "test.name" always refer the column in outer table, not inner (t2)? Thanks in advance. -- Fduch M. Pravking ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] feature request ?

2004-06-24 Thread Alexander M. Pravking
?column? -- (0 rows) So if you care, you SHOULD use IS [NOT] NULL, as Michael Glaesemann suggested. If you don't want expression to be calculated twice, use a temporary variable. -- Fduch M. Pravking ---(end of broadcast)--- TIP 1: s

Re: RES: [SQL] Datetime problem

2004-06-14 Thread Alexander M. Pravking
s timestamp WITH time zone. This is probably a documentation bug... -- Fduch M. Pravking ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [SQL] Memory usage on subselect

2004-05-23 Thread Alexander M. Pravking
On Sun, May 23, 2004 at 12:28:18PM -0400, Tom Lane wrote: > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > I've got a memory usage problem when I try to do a subselect on the same > > table as the main select (PostgreSQL 7.3.4 on FreeBSD). Here's m

[SQL] Memory usage on subselect

2004-05-22 Thread Alexander M. Pravking
s2.edate > now(); Seq Scan on services s2 (cost=0.00..56.08 rows=1 width=0) (actual time=177.01..177.01 rows=0 loops=1) Filter: ((id <> 561) AND (sreq(id, 'ipacct_ip'::text, now()) = sreq(561, 'ipacct_ip'::text, now())) AND (sdate < now()) AND (edate > now())) Total

Re: [SQL] Database triggers

2004-04-19 Thread Charity M
Thank you, will look at the reference manual. This is how I've done it to this point. It runs and the trigger is created but am not quite sure if its the right thing. CREATE OR REPLACE TRIGGER QUOTE_TRG BEFORE INSERT or DELETE OR UPDATE ON QUOTE FOR EACH ROW DECLARE today_date date;

[SQL] Database triggers

2004-04-19 Thread Charity M
I have a lab assignment that I have been struggling with. We are using oracle sql. Can someone please help me. See the lab below. I have done ques 1 - 3 thus far and am now stuck on triggers ques 4 - 6. THIS IS THE LAB: 1. Create a table called QUOTE. · Give the table an initial and n

[SQL] Row count after SELECT INTO?

2004-04-07 Thread Alexander M. Pravking
third? I tried to GET DIAGNOSTICS nrows = ROW_COUNT, bit it seems to get only value of 0 or 1. Is this how it supposed to be when SELECTing INTO a single variable? The only way I see now is a FOR ... IN SELECT loop, and I woner if there is a simpler solution. Could you please help me? -- Fduch M

[SQL] Entered data appears TWICE in table!!?

2004-04-05 Thread Ron M.
first, last) values ('Bill' , 'Smith'); ***Then look at the table: select * from rnmrgntable; And I get: firstlast BillSmith BillSmith EVERYTHING I enter appears twice, duplicated on two rows as in this example. What the heck's going on? Ron M.

Re: [SQL] Break a report in Run Time

2004-03-11 Thread Jonathan M. Gardner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday 11 March 2004 9:11 am, Jander wrote: > I need to abort the SQL process running in DB Server. > If you are in psql, you can cancel any query with CTRL-C. Otherwise, you can kill the process running the query using the "kill" c

Re: [SQL] VIEW on lookup table

2004-03-05 Thread Jonathan M. Gardner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Friday 27 February 2004 2:18 pm, JJ Gabor wrote: > Hello all, > > I have a lookup table consisting of 100,000+ rows. > > 99% of the lookup values resolve to 'Unknown'. > > Building the lookup table takes a long time. > > I would like to remove the '

Re: [SQL] Triggers

2004-03-05 Thread Jonathan M. Gardner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday 26 February 2004 2:18 am, Philip J. Boonzaaier wrote: > The technical reference gives an example of a trigger on a table - > employee Just to test this, I have created the following table, > CREATE TABLE employee > (name VARCHAR(30), > age

Re: [SQL] query optimization

2004-03-05 Thread Jonathan M. Gardner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday 04 March 2004 9:56 am, Charles Hauser wrote: > All, > > I have the following query which is running quite slow on our server > and was hoping someone would have suggestions how I might improve it. > Might want to try emailing the performan

Re: [HACKERS] [SQL] Materialized View Summary

2004-02-25 Thread Jonathan M. Gardner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm not sure if my original reply made it through. Ignore the last one if it did. On Tuesday 24 February 2004 1:48 pm, Robert Treat wrote: > On Tue, 2004-02-24 at 12:11, Richard Huxton wrote: > > On Tuesday 24 February 2004 16:

[SQL] Materialized View Summary

2004-02-24 Thread Jonathan M. Gardner
ner [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFAO3eZqp6r/MVGlwwRAnpEAKC8+/lFyPBbXetPEfFLwgUvJZLCmgCfYlmR 0vZmCcbGSNT/m/W8QOIhufk= =snCu -END PGP SIGNATURE- ---(end of broadcast)--- TIP 9: the pl

[SQL] Pgaccess problem on RedhatLinux9

2003-12-22 Thread vijaykumar M
Hi All, Previously i was used RedhatLinux7.2 & Postgres7.4, that time i'm able to use the pgaccess command to view the tables. Presently, i'm using RedhatLinux9 & Postgres7.4, here i'm not able to use the pgaccess command. It is saying "command not found." One thing, i observed was on R

[SQL] Pgaccess problem

2003-12-16 Thread vijaykumar M
Hi All, I am trying to install pgaccess on a redhat 7.2 linux server with postgres7.4. Everything seems to be alright but when I go to run pgaccess I get an error message saying Application initialization failed: no display name and no $DISPLAY environment v ariable Error in startup script: in

Re: [SQL] Problem with intervals

2003-12-02 Thread Alexander M. Pravking
this moment), but noone took a shot at it, AFAIK. Note also, that in 7.3 "timestamp" means "timestamp without time zone", while in 7.2 it's "timestamp with time zone". -- Fduch M. Pravking ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [SQL] Validity check in to_date?

2003-12-02 Thread Alexander M. Pravking
On Tue, Dec 02, 2003 at 01:55:06PM +0300, Alexander M. Pravking wrote: > Try using check (VALUE::text::date). Assuming check expects boolean result, it's (VALUE::text::date IS NOT NULL) -- Fduch M. Pravking ---(end of broadcast)--- TIP

Re: [SQL] Validity check in to_date?

2003-12-02 Thread Alexander M. Pravking
but there's one from text to date. Try using check (VALUE::text::date). -- Fduch M. Pravking ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] Validity check in to_date?

2003-12-02 Thread Alexander M. Pravking
less optimistic with this: > > # select '31.11.2003'::date; > ERROR: date/time field value out of range: "31.11.2003" Exactly! But date_in formats are too limited and "floaty", especially in 7.3 or less. -- Fduch M. Pravking ---(end o

Re: [SQL] Validity check in to_date?

2003-12-02 Thread Alexander M. Pravking
rought up. > You may search the archives on "date plausibility" are related terms. I'm sure too, but it's really hard to find a good keyword sequence when searching such sort of things :( Anyway, thank you for attention. -- Fduch M. Pravking ---

[SQL] Validity check in to_date?

2003-11-27 Thread Alexander M. Pravking
find a workaround now and will appreciate any help. fduch=# SELECT version(); version - PostgreSQL 7.3.4 on i386-portbld-freebsd4.8, compiled by GCC 2.95.4 -- Fduch M. Pravking

Re: [SQL] how to read bytea contents by using pgsql scripts

2003-11-24 Thread vijaykumar M
Hi Christoph, Yes, U catched my problem, i want to know the original stored contents (not in byte form). With thanks and regards Vijay From: Christoph Haller <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] (vijaykumar M) CC: [EMAIL PROTECTED] Subject: Re: [SQL] how to read bytea conte

Re: [SQL] how to read bytea contents by using pgsql scripts

2003-11-24 Thread vijaykumar M
From: Christoph Haller <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] (vijaykumar M) CC: [EMAIL PROTECTED] Subject: Re: [SQL] how to read bytea contents by using pgsql scripts Date: Mon, 24 Nov 2003 11:26:02 MET > > Hi All, > Is their any way to read the bytea contents by using pgsq

[SQL] how to read bytea contents by using pgsql scripts

2003-11-24 Thread vijaykumar M
Hi All, Is their any way to read the bytea contents by using pgsql script. Thanks & regards Vijay _ BharatMatrimony.com. http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 India's premium matrimonial website. --

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Alexander M. Pravking
On Thu, Nov 13, 2003 at 12:35:41PM -0500, Tom Lane wrote: > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > Very well then... Can I return a null record from such function > > explicitly? Sorry, I could't find it anywhere in docs or examples. > >

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Alexander M. Pravking
On Thu, Nov 13, 2003 at 12:27:58PM -0500, Tom Lane wrote: > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > Does "NULL result" mean an empty rowset if the function returns a record? > > No, it means a null record. "Empty rowset" w

Re: [SQL] STRICT function returning a composite type

2003-11-13 Thread Alexander M. Pravking
arguments; > instead a NULL result is assumed automatically. Does "NULL result" mean an empty rowset if the function returns a record? -- Fduch M. Pravking ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

[SQL] STRICT function returning a composite type

2003-11-13 Thread Alexander M. Pravking
x27;-infinity', 'yesterday', 'today', 'infinity'); sdate | edate ---+--- | (1 row) Is it possible without returning SETOF ts_bounds? fduch=# SELECT version(); version -----

Re: [SQL] Temporary tables

2003-09-28 Thread vijaykumar M
Hi, Try the below steps .. 1. Write one procedure to create tempory table (generic purpose) ** CREATE OR REPLACE FUNCTION SP_CREATE_TEMP_TABLE () RETURNS VARCHAR AS ' DECLARE L_SchemaName name; BEGIN EXECUTE ''CREATE TEMPORARY T

Re: [SQL] few questions ..?

2003-09-25 Thread vijaykumar M
Thanks richards ..i will go through that doc.. With Regards Vijay From: Richard Huxton <[EMAIL PROTECTED]> To: "vijaykumar M" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: Re: [SQL] few questions ..? Date: Thu, 25 Sep 2003 11:07:00 +0100 On Thursday 25 September 2003 09:

[SQL] few questions ..?

2003-09-25 Thread vijaykumar M
Hi All, I have few questions, kindly suggest your comments on this.. 1. Is that postgres supports distributed database ? In oracle, by creating Dblink we can communicate the remorte database from the local one. How you could implement this in postgres database. 2. Is the

[SQL]

2003-09-25 Thread vijaykumar M
Hi all, I have few questions to clear my self.. 1. Is that postgres supports distributed database ? _ Talk to Karthikeyan. Watch his stunning feats. http://server1.msn.co.in/sp03/tataracing/index.asp Download images. ---

Re: [SQL] Backup of multiple tables

2003-09-19 Thread Alexander M. Pravking
dumped from the script before and release them after dump is complete... But there could be dead-lock conditions. What will gurus say? -- Fduch M. Pravking ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Backup of multiple tables

2003-09-19 Thread Alexander M. Pravking
b2" without success. Here's a perl script I used to dump all the tables separately. I'm not sure most of options do work there, I didn't test ;-) It won't be hard to make it dump certain tables, I think. -- Fduch M. Pravking dump.pl Description: Perl program

[SQL] createlang problme

2003-09-12 Thread vijaykumar M
Hi All, i'm using RedhatLinux7.2, on top of this i upgrade the Postgres with V7.3.3. After that, i tried to create a language with a createlang command. ERROR: Load of file /usr/local/pgsql/lib/plpgsql.so failed: /usr/local/pgsql/lib/plpgsql.so: un defined symbol: xlateSqlType createlang: language

[SQL] createlang plpgsql failing on redhatlinux7.2

2003-09-12 Thread vijaykumar M
Hi All, I'm getting some problem on "createlang plpgsql". with REDHATLINUX7.2 These are all my system configurations.. We have a machine with  RedhatLinix 7.2, on top of this i upgraded the postgresql7.3.3 version. After creating a database, i'm trying to create a language for that database by us

Re: [SQL] Expression transformation curiosity

2003-08-17 Thread Alexander M. Pravking
e same problem several weeks ago on 7.3.3 with 4 such OR's. The final filter became monsterous, and the query was very slow. I've simply rewritten the query using UNION, and it became much faster. -- Fduch M. Pravking ---(end of broadcast)--

[SQL] Problem with looping on a table function result

2003-07-31 Thread Alexander M. Pravking
o the trick without writing one more PL/PgSQL table function doing FOR row IN SELECT ... LOOP or using client-side loop? Thanks for your help. -- Fduch M. Pravking ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

  1   2   >