[SQL] hints or suggestion for optimizer

2002-07-18 Thread adrian
How can I optimize Postrges SQL when I would like have ordering kolumns without clause ORDER BY - in Oracle you can use hints to suggestion optimizer. for example. SELECT /*+ INDEX_ASC TAB(TAB_PK) +/ * FROM TAB - most efficent SELECT * FROM TAB ORDER BY TAB_PK where TAB_PK - is unique

Re: [SQL] psql question

2000-11-24 Thread Adrian Phillips
your ip to Clayton> connect, not an easy thing if your dial up!! Or, assuming you have ssh access, use ssh to setup a tunnel between the two. Sincerely, Adrian Phillips -- Your mouse has moved. Windows NT must be restarted for the change to take effect. Reboot now? [OK]

[SQL] bytea

2003-02-05 Thread Adrian Chong
Hello, I have a table containing a field of type bytea: CREATE TABLE a_table ( a_field bytea ); How can I import a file in a SQL script? What function I can use? Thank you very much. Adrian ---(end of broadcast)--- TIP 4: Don't &#x

Re: [SQL] bytea

2003-02-05 Thread Adrian Chong
Hi Christoph, Thanks for your reply. But what I want to do is loading a file of a particular path with a sql statement in psql. Why I need to care about how the file looks like? Thanks. Adrian - Original Message - From: "Christoph Haller" <[EMAIL PROTECTED]> To: <[E

Re: [SQL] begin update ... syntax error

2004-04-10 Thread Adrian Klaver
gt; > > ---(end of broadcast)--- > TIP 5: Have you checked our extensive FAQ? > >http://www.postgresql.org/docs/faqs/FAQ.html -- Adrian Klaver [EMAIL PROTECTED] ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [SQL] ERROR: Invalid regular expression: parentheses ( ) not balanced

2004-08-25 Thread Adrian Klaver
- > TIP 6: Have you searched our list archives? > >http://archives.postgresql.org I don't know what to make of it but the problem seems to start at the lines I have marked 1 & 2 and involves the lo_import function. I have not used lo_import and s

[SQL] Trick to 'run' a view on two databases and combine the result ?

2005-01-14 Thread Din Adrian
Hello, I have a 'big problem' : I have to show some data from two identical databases so I need to run a querry (view, ..etc) on both databases and show the united result ... Any ideea how to obtain this result ? Thank You, Adrian Din -- Using Opera's revolutionary e-ma

[SQL] Record type in sql

2005-01-17 Thread Din Adrian
int2, nume text); is this possible? Thank You, Adrian Din -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining col

[SQL] private table

2005-01-26 Thread Din Adrian
Hello, I am want to use a private table in postgresql(every client to see his own data). Is this possible? How can I do it! Thank you, Adrian Din -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ ---(end of broadcast)---

Re: [SQL] [PERFORM] Tunning postgresql on linux (fedora core 3)

2005-02-03 Thread Din Adrian
sorry about cc ... this is the site: http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html but I gues is not right ... hmm Adrian Din On Thu, 03 Feb 2005 14:52:04 +, Richard Huxton wrote: I'll repeat myself: Please CC the mailing list as well as replying to me, so

Re: [SQL] SQL error: function round(double precision, integer) does not exist

2005-02-28 Thread Din Adrian
the round sintax is round(numeric,int) not round (double,int) you must cast the value into numeric: ex: round (cast(doublecolumn as numeric),2) should work ok Adrian Din, Om Computer & SoftWare On Sun, 27 Feb 2005 15:26:07 -0800, TJ O'Donnell <[EMAIL PROTECTED]> wrote: I receive

Re: [SQL] PostgreSQL and Delphi 6

2005-06-16 Thread Din Adrian
we are using postgresql8 +psqlodbc8+ delphi7 ... the only problem is the server side cursor = doesn't work properly ... so we are using client side for datasets :) On Wed, 15 Jun 2005 23:49:29 -0400, Postgres Admin <[EMAIL PROTECTED]> wrote: I have a client who wants to use Delphi

Re: [SQL] PostgreSQL and Delphi 6

2005-06-16 Thread Din Adrian
s, but we are satified with the results (we are developing a big ERP app for two years - it also works over internet on 2-3 clients with relative slow net connections : 56-128 Kb/s). Adrian Din, Om Computer & Software, Bucuresti,Romania On Thu, 16 Jun 2005 08:09:56 -0400, Postgres Admin

Re: [SQL] PostgreSQL and Delphi 6

2005-06-16 Thread Din Adrian
d and post-it you stay 1 min !? ) - for curiosity how do you deal with this posible problem ? Adrian Din, Om Computer & Software, Bucuresti, Romania On Thu, 16 Jun 2005 09:54:21 -0300, grupos <[EMAIL PROTECTED]> wrote: Hi J! We use here vitavoom from Steve Howe (www.vitavoom.com). It&

Re: [SQL] PostgreSQL and Delphi 6

2005-06-16 Thread Din Adrian
7;post' button the driver automatically refresh the current dataset and the user have to wait many seconds (or min?!) until it's finish. ok? How did you say you avoided this ? Adrian Din, Om Computer & SoftWare Bucuresti, Romania On Thu, 16 Jun 2005 10:29:38 -0300, grupos <[EMAIL PRO

Re: [SQL] UPDATEABLE VIEWS ... Examples?

2005-06-20 Thread Din Adrian
because I do 2 updates in rule of update view and the odbc driver (psqlodbc ) or delphi wants to do update based on every field ... (also is no key in view!!!???) ... if anybody have a solution to this problem !? Best Regards, Adrian Din, Om Computer & SoftWare B

[SQL] Help on Procedure running external function

2005-07-04 Thread Din Adrian
Hello, I have a 'big' problem: I am trying to run from a procedure a function witch generate a new document number (max from table +1 ) and after to insert a document with this number, but the function returns me the same number each time because the tranzaction is not finished and the inser

Re: [SQL] Help on Procedure running external function

2005-07-04 Thread Din Adrian
Yes , I know what sequence is, but our procedure for generating doc numbers is v. big and has manny (4) parameters and we did'nt use sequence in it for this reason any other advice ? thak you, Adi On Mon, 04 Jul 2005 14:47:16 +0200, Zac <[EMAIL PROTECTED]> wrote: Din A

Re: [SQL] Help on Procedure running external function

2005-07-05 Thread Din Adrian
t;get_me_next_number" function) thank you, Adria Din On Mon, 04 Jul 2005 17:27:20 +0200, Zac <[EMAIL PROTECTED]> wrote: Din Adrian wrote: Yes , I know what sequence is, but our procedure for generating doc numbers is v. big and has manny (4) parameters and we did'nt use se

Re: [SQL] Help on Procedure running external function

2005-07-05 Thread Din Adrian
our right I should change the get_number procedure to create 'on the fly sequences' for each new user settings (in our app the user have the power to set the way of generating number for every type of document) (for that I need time wich I don't have now :) )... anyway .. is workin

Re: [SQL] Help on Procedure running external function

2005-07-05 Thread Din Adrian
and raise by 1 instead of running again the get_next_number function (because as I said - it give the same max number (the insert into table is not 'visible') )) ... as I said it's 'solved' ... thank you, Adrian Din On Tue, 5 Jul 2005 07:39:48 -0500, Bruno Wolff III <

Re: [SQL] Is it possible to redirect an update/insert/delete to a different table?

2005-11-20 Thread Adrian Klaver
y apples and > pears tables)... > > Thanks very much for your help. > > Andy > > > > ---(end of broadcast)--- > TIP 5: don't forget to increase your free space map settings -- Adrian Klaver [EMAIL PROTECTED]

Re: [SQL] Executing plpgsql scripts using psql, is that possible?

2006-01-16 Thread Adrian Klaver
choose an index scan if your joining column's datatypes do not >match If you want to use plpgsql it will need to be within a function. In your reply you mention creating user-defined functions as part of the set up procedure. It would not be weird to include

Re: [SQL] Trigger, record "old" is not assigned yet

2006-07-13 Thread Adrian Klaver
ed before insertion the record "old" is not > assigned. Is there a way to distinguish in the trigger procedure from > an insert statement to an update statement? > > > > Regards, > > > > > > -- > > Daniel CAUNE > > Ubisoft Onli

Re: [SQL] Bit by "commands ignored until end of transaction block" again

2009-07-23 Thread Adrian Klaver
ook at Savepoint rollback and Database-level autocommit. -- Adrian Klaver akla...@comcast.net -- 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] mail alert

2009-08-13 Thread Adrian Klaver
hanks!! > If at all possible, try to move all that information into schema's of one database. As it stands now you have a lot of moving parts to keep track of via external processes. It is possible but you lose transactional support and trust me that turns into a royal pain. -- Adria

Re: [SQL] Serious problems with non-primary foreign keys

2009-09-13 Thread Adrian Klaver
, PRIMARY KEY(company_id)); > Any ideas on how to fix this? Thank you, > janneaa I think more information is required. First the complete transaction. Second the complete error message, especially the part that explains what is causing the CREATE INDEX command to fail. Third I do not see

Re: [SQL] Rules, functions and RETURNING

2009-09-17 Thread Adrian Klaver
> > Thank your in advance for your help. > > regards, > nico > > -- > Nico Mandery I am going to assume that '--do something' is more complicated then getting the mytable_id. If that is the case why not create an INSERT function/trigger that does the 'someth

Re: [SQL] How to order varchar data by word

2009-10-14 Thread Adrian Klaver
t; Many thanx in advance, > > Best, > Oliveiros Can you show the SQL you are using? -- Adrian Klaver akla...@comcast.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] How to order varchar data by word

2009-10-20 Thread Adrian Klaver
esql.org/docs/8.4/interactive/multibyte.html#AEN30078 -- Adrian Klaver akla...@comcast.net -- 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] Sqldf - error message

2009-11-20 Thread Adrian Klaver
OP is talking about are variables that are coerced to being 'tables'. I can see no mailing list for sqldf itself. The closet I could come is https://stat.ethz.ch/mailman/listinfo/r-help which seems to have quite a few discussions on sqldf and would probably be the better place t

Re: [SQL] Schema's, roles and privileges

2009-11-30 Thread Adrian Klaver
easiest solution would be to change the search_path in: citext.sql.in uuid-ossp.sql.in These files are found in the respective contrib directories. Uninstall the modules. Rerun make and then reinstall. From here: http://www.postgresql.org/docs/8.4/interactive/ddl-schemas.html "There is nothin

Re: [SQL] plpgsql loop question

2010-02-10 Thread Adrian Klaver
drea One thing I would do is rename your zones record variable. pgsql does not deal well with a variable having the same name as a schema object, in this case your table zones. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] Please delete my email

2010-03-15 Thread Adrian Klaver
a sin coche que sin Messenger www.vivirmessenger.com To unsubscribe go here: http://www.postgresql.org/mailpref/pgsql-sql Thanks, -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mai

Re: [SQL] Remove my e-mail

2010-03-15 Thread Adrian Klaver
On 03/15/2010 10:24 AM, Daniel Guedes wrote: Hi!, I don't want to receive more emails from postgresql. Please remove my email from your delivery list. Thanks To unsubscribe go here: http://www.postgresql.org/mailpref/pgsql-sql Thanks, -- Adrian Klaver adrian.kla...@gmail.com -- Sen

Re: [SQL] sorry, now with subject... trigger & nextval(seq)

2010-05-20 Thread Adrian Klaver
DECLARE > pid_num bigint; > BEGIN > select into pid_num from select nextval($); > RETURN pid_num; > END; > ' LANGUAGE 'plpgsql'; > > -- and how will the trigger looks like > ??? You know serial is just a shortcut for: pid int NOT NULL

Re: [SQL] COPY command and required file permissions

2010-06-25 Thread Adrian Klaver
ows: drwxrwxr-x 3 ruby_process postgres I have also tried moving the files to /tmp and performing the copy from there, unsuccesfuly. Any ideas would be appreciated. Thanks, -Harold Are you connecting to the database as a superuser to run the COPY command? -- Adrian Klaver adria

Re: [SQL] Round integer division

2010-06-25 Thread Adrian Klaver
> anything about this in the archives or the data type documentation. Is > there something obvious that I'm I missing? > > Thanks, > > -- > > Lee Hachadoorian > PhD Student, Geography > Program in Earth & Environmental Sciences > CUNY Graduate Center See here for e

Re: [SQL] COPY command and required file permissions

2010-06-25 Thread Adrian Klaver
org/docs/8.4/interactive/app-psql.html -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Help with queries.

2010-09-21 Thread Adrian Johnson
all coordinates in snps table. Then I want to get those entries where sample 1 and sample 2 have in common and sample 1 and sampl3 in common. I do not know how to get these entries. Could any one help me please. thank you. adrian -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To

Re: [SQL] Help with queries.

2010-09-21 Thread Adrian Johnson
d combine this with results Y. How is it possible to do this? Thank you for your help. Adrian. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] unique fields

2010-09-22 Thread Adrian Johnson
adrian -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] psql -f COPY from STDIN

2010-11-12 Thread Adrian Klaver
cat event.csv | psql -f event.sql What's the problem? Many thanks in advance. -- Adrian Klaver adrian.kla...@gmail.com -- 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] Need help with plpgsql function.

2010-11-14 Thread Adrian Klaver
RETURN QUERY SELECT 10,20 UNION ALL SELECT 30,40; > ELSE > RETURN QUERY SELECT 60,70 UNION ALL SELECT 80,90; > END IF; > RETURN; > END; > $$ LANGUAGE plpgsql; > > SELECT * FROM foo(1); > SELECT * FROM foo(2); > > Regards > > Pavel Stehule >

Re: [SQL] insert from a select

2010-11-24 Thread Adrian Klaver
E 1: ... cl.depart, cl.sessionid, cl.instrid, cl.classseq,(select fa.. ^ Looks like the result of the 'select facility.." is being inserted into the schedule column. > > Johnf -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] create function problem

2010-12-30 Thread Adrian Klaver
IF to ELSEIF should fix it. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] create role

2010-12-30 Thread Adrian Klaver
g variants change a role's session default for a configuration variable, either for all databases or, when the IN DATABASE clause is specified, only for sessions in the named database. Whenever the role subsequently starts a new session, the specified value becomes the session de

Re: [SQL] create role

2010-12-31 Thread Adrian Klaver
f there is such a schema. (If not, $user is ignored.) " "The default value for this parameter is '"$user", public' (where the second part will be ignored if there is no schema named public). This supports shared use of a database (where no users have private sc

Re: [SQL] create role

2010-12-31 Thread Adrian Klaver
the search order for unqualified object names. What you can see or do with those objects is determined by the privileges on those objects. Those privileges come from either the role that created the object or are GRANT(ed) by a sufficiently privileged role to another role. -- Adrian Klaver adrian.kla...@gmail.com -- 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] explicit casts

2011-01-05 Thread Adrian Klaver
gt; need to add explicit type casts. > QUERY: select to_date(date_trunc('month',add_months( $1 > ,1)),'-MM-DD') - 1 > CONTEXT: PL/pgSQL function "last_day" line 6 at SQL statement > > > how would i apply the following solution > > date_trunc('

Re: [SQL] explicit casts

2011-01-05 Thread Adrian Klaver
yyy-mm-dd'), -1), 'fmMonth') > as prev_month_name > from dual > > > But i still miss some lines in order to properly explicit casts in the > query > > cheers, > iuri My guess is you upgraded from a version prior to 8.3. In 8.3 many of the impli

Re: [SQL] Help needed in skipping column for copy command

2011-01-17 Thread Adrian Klaver
tell me how can I make copy command to ignore the data missing column ? as the data in file is unknown so it column name is which is missing is not known in advance. You can specify a column list to COPY. See here: http://www.postgresql.org/docs/9.0/interactive/sql-copy.html Thanks Amar -- A

Re: [SQL] quotes etc

2011-02-22 Thread Adrian Klaver
am I wrong? > > Johnf Dollar quoting ? : http://www.postgresql.org/docs/9.0/interactive/sql-syntax-lexical.html 4.1.2.4. Dollar-Quoted String Constants test(5432)aklaver=>SELECT $$D' Andes$$; ?column? -- D' Andes -- Adrian Klaver adrian.kla...@gmail.com

Re: [SQL] what's wrong in this procedure?

2011-02-25 Thread Adrian Klaver
ado", "Completo") GROUP BY o.data_fim; ' language 'sql'; the column is t.status and not "Aguardando Pagto"; what's wrong ? thanks Try single quotes, 'Aguardando Pagto' -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-

Re: [SQL] is there a refactor

2011-04-05 Thread Adrian Klaver
ics t2 stone serial_test messages binary_test user_test timestamp_test role_t py_test money_test lock_test local_1 lang_test interval_test foob fooa fldlength fk_1 default_test csv_null check_two check_test array_test (29 rows) -- Adrian Klaver adrian.kla...@gmail.com -- Sent

Re: [SQL] Get id of a tuple using exception

2011-04-14 Thread Adrian Klaver
he EXCEPTION to return that id instead of using a select to know wich was > the id of the triple already existing in the table? If the id is the PRIMARY KEY then it would be the same as the id you tried to INSERT correct? > > Thanks, > Filipe -- Adrian Klaver adrian.kla...@gmail

Re: [SQL] Get id of a tuple using exception

2011-04-14 Thread Adrian Klaver
; any tuple that already exists in the table I want to get the id of the > original tuple. > To your original question I am not aware of a way of returning the id of the offending tuple, other than through a SELECT. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgs

Re: [SQL] problem with update data sets from front ends 8.4, Ubuntu 10.04

2011-05-23 Thread Adrian Klaver
other? > > I believe something has changed perhaps in sql from 8.3 to 8.4, or I have > missed something with restoring the files. Did you do a full restore or selective? > > > Any assistance offered will be appreciated. -- Adrian Klaver adrian.kla...@gmail.com

Re: [SQL] ERROR: malformed record literal: "",DETAIL: Missing left parenthesis?

2011-07-06 Thread Adrian Klaver
z_drop is being applied to the first parameter only. Emi EXECUTE test('', '1', '1', '1', '1', '1', '1', '1', '1', '', 1, 1, '1', '0', '0', '0', '0&#

Re: [SQL] using explain output within pgsql

2011-07-10 Thread Adrian Klaver
www.postgresql.org/docs/9.0/interactive/sql-explain.html I believe you are looking for: explain (ANALYZE, FORMAT YAML) create table... > > Does anybody has an idea how to retrieve the output of explain within pgsql > and store this in a variable? > An alternative would be any other wa

Re: [SQL] why these results?

2011-08-01 Thread Adrian Klaver
1 > (1 row) > > is correct. > > But now if I do: > > > select count(*) from table where col::text !~~* '%text%'; > count > --- > 98 > (1 row) > > Shouldn't it be 99? That is out of 100 records there is one that has > "text

Re: [SQL] pgadmin debugger

2011-08-13 Thread Adrian Klaver
/www.postgresonline.com/journal/archives/214-Using-PgAdmin-PLPgSQL-De > bugger.html > > Any idea? http://www.enterprisedb.com/docs/en/8.4/pgadmin/debugger.html -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make ch

Re: [SQL] bigint and unix time

2011-08-14 Thread Adrian Klaver
a given value of integer the storage should be the same for each up to the limit of the integer field. Would seem that whatever is putting values into time is inflating the values if they are actually referring to contemporary time values. > > > > As you understand, I always ge

Re: [SQL] pgadmin debugger

2011-08-14 Thread Adrian Klaver
On Sunday, August 14, 2011 10:15:43 am David Harel wrote: > On Sat, 2011-08-13 at 12:56 -0700, Adrian Klaver wrote: > > On Saturday, August 13, 2011 12:39:44 pm David Harel wrote: > > > Greetings, > > > > > > I use Ubuntu 10.04. I have postgresql version 8.4.8

Re: [SQL] pgadmin debugger

2011-08-15 Thread Adrian Klaver
On Sunday, August 14, 2011 11:33:13 am David Harel wrote: > On Sun, 2011-08-14 at 11:07 -0700, Adrian Klaver wrote: > > On Sunday, August 14, 2011 10:15:43 am David Harel wrote: > > > On Sat, 2011-08-13 at 12:56 -0700, Adrian Klaver wrote: > > > > On Saturday, Aug

Re: [SQL] bigint and unix time

2011-08-15 Thread Adrian Klaver
WHERE bint BETWEEN extract(epoch from (date 'now' - integer '30')) AND extract(epoch from (date 'now')); bint -- (0 rows) That being said, if your time values are the order of magnitude shown they will not meet the criteria abov

Re: [SQL] bigint and unix time

2011-08-16 Thread Adrian Klaver
ime' values by 1,000,000 to make them seconds. Like: SELECT ticket, "time"/100, author, field, oldvalue, newvalue FROM ticket_change where "time"/100 BETWEEN extract(epoch from (date 'now' - integer '30')) AND extract(epoch

Re: [SQL] FW: Hi

2011-09-10 Thread Adrian Klaver
be nice:) If the above was it then that explains the problem. First I think you are looking for psql not pgsql. Second it should be psql -U postgres ... > > Regards, Mandana -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make c

Re: [SQL] using a generated series in function

2011-12-16 Thread Adrian Klaver
select foo.week_date, xchromasun._chromasun_getqtyordered(303, > foo.week_date) as week_qty from > (select ((date_trunc('week', '2011-11-20'::date )::date) + (i+6)) as > week_date from generate_series(0,84,7) > i ) as foo > > The above works! > > Johnf &g

Re: [SQL] using a generated series in function

2011-12-17 Thread Adrian Klaver
On Saturday, December 17, 2011 8:50:52 am John Fabiani wrote: > As always I respect your insights - Adrian. I do understand what I did > wrong in my first attempt at getting my statement to work. But it is > either over my head or there is something missing. Where is the "from&qu

Re: [SQL] Column "..." does not exist (view + union)

2011-12-17 Thread Adrian Klaver
lhasindex UNION (SELECT relname FROM pg_class WHERE relhasoids ORDER BY relpages); > > > thanks, > stefan -- Adrian Klaver adrian.kla...@gmail.com -- 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] avoid the creating the type for setof

2011-12-30 Thread Adrian Klaver
.1. Declaring Function Parameters Search for RETURNS TABLE > > return > > > Johnf -- Adrian Klaver adrian.kla...@gmail.com -- 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] compare table names

2012-01-09 Thread Adrian Klaver
tmp_staging0109 > tmp_staging1229 > tmp_staging0108 > > How can I write this correctly? As far as I can tell it is correct. 0108,0109 and 1229 are all less than 1230. What happens if you do?: select tablename from pg_tables where tablename like 'tmp_staging%' an

Re: [SQL] compare table names

2012-01-09 Thread Adrian Klaver
ld_1 desc limit 1; fld_1 - tmp_staging1229 > > Thanks. > Tony -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing li

Re: [SQL] compare table names

2012-01-09 Thread Adrian Klaver
tmp_staging0109 tmp_staging0108 tmp_staging1229 (3 rows) test(5432)aklaver=>SELECT fld_1 from name_test where fld_1 < 'tmp_staging'|| to_char(current_date-interval '10 days','MMDD') and fld_1 > 'tmp_staging0131'; fld_1 -

Re: [SQL] Unable To Modify Table

2012-01-12 Thread Adrian Klaver
TAIL: Key (id)=(11) is still referenced from table "orders". > [/CODE] > > How does one accomplish my goal? Is this difficult to change or once > that foreign key is created, are you stuck with that particular > constraint? You are pushing in the wrong directio

Re: [SQL] Unable To Modify Table

2012-01-12 Thread Adrian Klaver
On Thursday, January 12, 2012 9:02:35 am David Johnston wrote: > > > Adrian, you are not helping...if ON UPDATE CASCADE was enabled on "orders" > the error in question would never have appeared and the UPDATE would have > succe

Re: [SQL] UPDATE COMPATIBILITY

2012-01-17 Thread Adrian Klaver
e > FROM salesmen s > WHERE s.id = accounts.sales_id For completeness, you could also do: UPDATE accounts SET (contact_last_name,contact_first_name)= (s.last_name,s.first_name) FROM salesmen s WHERE s.id = accounts.sales_id Gets you a little closer to what you want:) -- Adri

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Adrian Klaver
8.3- I believe you could only call it as SELECT * from date_range (asdate, afdate)::date AS asdate; > > Is there a way to use the integer only generate_series in 8.3 to generate > dates by typecasting to/from integers? -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sq

Re: [SQL] date range to set of dates expansion

2012-01-19 Thread Adrian Klaver
On 01/19/2012 09:17 AM, Samuel Gendler wrote: On Thu, Jan 19, 2012 at 8:20 AM, Adrian Klaver mailto:adrian.kla...@gmail.com>> wrote: On Thursday, January 19, 2012 7:59:27 am Gary Stainburn wrote: > The following code works in 8.4 but not 8.3. > Anyone know why, or wh

Re: [SQL] Display Length Between Var & Varchar

2012-01-31 Thread Adrian Klaver
at the Manual is very helpful in this regard:) http://www.postgresql.org/docs/9.0/interactive/datatype-character.html character varying(n), varchar(n)variable-length with limit character(n), char(n) fixed-length, blank padded -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql

Re: [SQL] type cast about int to bit

2012-02-06 Thread Adrian Klaver
ither char or varchar depending on whether they are bit or bit varying. In the first case you are basically doing an int-->char, for which there is a built in cast. In the second case you are doing int-->varchar for which there is not a cast. -- Adrian Klaver adrian.kla...@gmail.com --

Re: [SQL] type cast about int to bit

2012-02-06 Thread Adrian Klaver
(4)::varbit(4); varbit 1010 (1 row) test(5432)aklaver=>SELECT 10::bit(4)::varbit(3); varbit 101 -- Adrian Klaver adrian.kla...@gmail.com -- 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] pg_dump - 8.3 - schemas

2012-02-16 Thread Adrian Klaver
command line statement you are using? Are doing both dumps as the same user? Thanks Edward W. Rouse -- Adrian Klaver adrian.kla...@gmail.com -- 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] pg_dump - 8.3 - schemas

2012-02-16 Thread Adrian Klaver
postgresql.conf. This can create the illusion that only one schema is available in a database. One way to check is to use the fully qualified name for a table you know to be in the reports schema. Ex: select * from reports.some_table; -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql

Re: [SQL] pg_dump - 8.3 - schemas

2012-02-16 Thread Adrian Klaver
at is the error reported? What do the Postgres logs show when you restore the data? Do a pg_restore -l against the dump file. This will list the contents of the dump. See if the schema and contents are there. -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing

Re: [SQL] on insert rule with default value

2012-02-22 Thread Adrian Klaver
efault) will be filled in by the planner with a constant null expression. " If you want all the gory details read through section 37, in particular 37.3 :) The above is why I use triggers now. It is a lot easier to follow the logic in a trigger than in a rule. > >

Re: [SQL] SQL View to PostgreSQL View

2012-02-27 Thread Adrian Klaver
r=b.chr > ^ > > ** Error ** > > ERROR: schema "dbo" does not exist > SQL state: 3F000 > Character: 761 Do you in fact have a schema dbo? If so can you access the schema and table using some other method, for instance using psql? -- A

Re: [SQL] Problems with ODBC connections

2012-02-27 Thread Adrian Klaver
ror message would be helpful:)? A common reason for this is a firewall between the client and server that is preventing connection to the server port. Another reason is a pg_hba.conf that has not been configured to allow connections from the client. -- Adrian Klaver adrian.kla...@gmail.com --

Re: [SQL] Change Ownership Recursively

2012-03-01 Thread Adrian Klaver
it's tables. Can we start fresh and assume I just got the request to change the specified database and all of it's tables, sequences, views,& triggers to Lauren? See above. For future reference including the Postgres version would be helpful. This area ownership/grants/etc has undergon

Re: [SQL] Change Ownership Recursively

2012-03-01 Thread Adrian Klaver
what I was looking for or missed it. On Thu, Mar 1, 2012 at 1:36 PM, Adrian Klaver wrote: For future reference including the Postgres version would be helpful. This area ownership/grants/etc has undergone a lot of changes over the various versions. I specified above I was using 9.1 PostgreS

Re: [SQL] pg_dump: aborting because of server version mismatch

2012-05-11 Thread Adrian Klaver
e path in your script. *pg_dump: aborting because of server version mismatch* -e All database backups complete! -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Finding Max Value in a Row

2012-05-11 Thread Adrian Klaver
Well the question to ask is if it is declared CHAR was that done for a legitimate reason? One reason I can think of is to have leading 0s in a 'number'. Might want to double check that code downstream is not depending on CHAR behavior. -- Adrian Klaver adrian.kla...@gmail.com -- S

Re: [SQL] Insane behaviour in 8.3.3

2012-06-14 Thread Adrian Klaver
9 total transactions thus far, in 70 > different postgresql slave installations (mixture of 8.3.3 and 8.3.13) (we > are a shipping company), > until i got this error report from a user yesterday. > > What could be causing this? How could i further investigate this? The only thing I co

Re: [SQL] must appear in GROUP by clause issue

2012-06-29 Thread Adrian Klaver
net> -- Adrian Klaver adrian.kla...@gmail.com -- 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] pg_restore problem

2012-09-13 Thread Adrian Klaver
t was the pg_dump command you used? -- Rgds Kjell Inge Øygard Electronic Chart Centre www.ecc.no <http://www.ecc.no> -- Adrian Klaver adrian.kla...@gmail.com -- 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] pg_restore problem

2012-09-14 Thread Adrian Klaver
rgds Kjell Inge Ø -- Adrian Klaver adrian.kla...@gmail.com -- 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] Load UTF8@psql into latin1@mysql through JDBC

2012-12-12 Thread Adrian Klaver
tor-j-reference-charsets.html "All strings sent from the JDBC driver to the server are converted automatically from native Java Unicode form to the client character encoding, including all queries sent " > > Thanks a lot! > Emi > > -- Adrian Klaver adrian.kla...@gm

Re: [SQL] Load UTF8@psql into latin1@mysql through JDBC

2012-12-12 Thread Adrian Klaver
atin1, the french character cannot be auto-loaded. You might get an answer sooner at: https://groups.google.com/group/mybatis-user Thanks. -- Emi -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscrip

Re: [SQL] Query execution based on a condition

2012-12-29 Thread Adrian Klaver
specific without more information. In a particular the condition/field being tested and values being tested for. Respectfully, Jorge Maldonado -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

  1   2   >