Re: [SQL] selecting rows tagged with "a" but not "b"

2010-02-01 Thread Milen A. Radev
t;a" SUBTRACT select articleID from tags where tab="b" how do I do this in real SQL? Replace "SUBSTRACT" with "EXCEPT" (http://www.postgresql.org/docs/current/static/sql-select.html#SQL-EXCEPT). -- Milen A. Radev -- Sent via pgsql-sql mailing list (pgs

Re: [SQL] RAISE NOTICE

2009-05-08 Thread Milen A. Radev
r messages of a particular priority are reported to the client, written to the server log, or both is controlled by the log_min_messages and client_min_messages configuration variables. See Chapter 18 for more information." -- Milen A. Radev -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Variable number or arguments to a function possible?

2009-04-24 Thread Milen A. Radev
8.4/static/xfunc-sql.html#XFUNC-SQL-VARIADIC-FUNCTIONS), but right now the closest to what you want is function overloading (http://www.postgresql.org/docs/current/static/xfunc-overload.html). -- Milen A. Radev -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Re: How to insert Images(bnp,png,etc) into Postgresql and how to retrive the inserted Imaged using C#.net

2008-12-18 Thread Milen A. Radev
ml and look for "Working with binary data and bytea datatype". -- Milen A. Radev -- 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 provide password to pg_dump command ?

2008-09-09 Thread Milen A. Radev
ot recommended method - http://www.postgresql.org/docs/current/static/libpq-envars.html (look for PGPASSWORD). -- Milen A. Radev -- 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: FATAL: Ident authentication failed for user "postgres"

2008-09-08 Thread Milen A. Radev
- postgres" before using psql should do the trick. Please read "Chapter 21. Client Authentication" (http://www.postgresql.org/docs/current/static/client-authentication.html) for details. -- Milen A. Radev -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Re: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date

2008-07-30 Thread Milen A. Radev
); sql> 1 (Mon =1 ... Sun =7?) You need "TO_CHAR" (http://www.postgresql.org/docs/current/static/functions-formatting.html) - "SELECT to_char(current_date, 'Dy')". -- Milen A. Radev -- 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] comment on COLUMN, broken or misunderstanding?

2008-02-17 Thread Milen A. Radev
rs aggregates, functions, operators, types, relations (tables, views, indexes, sequences, large objects), rules, and triggers.' (http://www.postgresql.org/docs/8.2/static/app-psql.html, look for "\dd"). You could see the comment for the column with "\d+ table_name". -- M

Re: [SQL] PL/pgSQL question

2008-02-14 Thread Milen A. Radev
res x%ROWTYPE; BEGIN if $1 THEN RETURN NEXT res; ELSE RETURN; END IF; END;$_$ LANGUAGE plpgsql; -- Milen A. Radev ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at

Re: [SQL] How to use serial variable to insert into muiti-recrods?

2007-09-06 Thread Milen A. Radev
error at or near "default" > SQL state: 42601 > Character: 24" > -- Milen A. Radev ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] Table-name as parameter to plpgsql

2007-07-30 Thread Milen A. Radev
quot;$1" LINE 1: INSERT INTO $1 (some_field) VALUES('some_value') Any hints on how to use function-parameters as table-names like I'm trying to above? Use EXECUTE (http://www.postgresql.org/docs/current/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-E

Re: [SQL] simple SQL question

2007-06-25 Thread Milen A. Radev
been playing around with string functions but cannot seem to > figure out a quick solution. Does anyone have any suggestions? Use "to_char(int, text)", details here - http://www.postgresql.org/docs/current/static/functions-formatting.html -- Milen A. Radev

Re: [SQL] system table storing sequence attributes

2007-05-22 Thread Milen A. Radev
d like to know what is the current value > of the sequence. I don't wish to know this in the same session where I > add/remove records. Why do you need to know that? I can't think of any reason. [...] -- Milen A. Radev ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Milen A. Radev
s to be accurate upto the 6th decimal > place, and was wondering if people use floating point types for this sort > of thing. -- Milen A. Radev ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Floating point type to store numbers

2007-04-17 Thread Milen A. Radev
gresql.org/docs/current/static/datatype-numeric.html#DATATYPE-FLOAT) : " - If you require exact storage and calculations (such as for monetary amounts), use the numeric type instead." So if you decide to use floats after this warning you are on your own. -- Milen A. Rad

Re: [SQL] Serial

2007-04-03 Thread Milen A. Radev
ng it like that. The sequence was created without any > error. But for the create table i get > > ERROR: syntax error at or near "nextval" at character 38 > > What should i do? Add the missing "default": CREATE TABLE mytable ( n_gen int DEFAULT nex

Re: [SQL] Substitute

2007-03-20 Thread Milen A. Radev
or 'replace' here - http://www.postgresql.org/docs/8.2/static/functions-string.html. -- Milen A. Radev ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] CREATE TABLE

2007-03-09 Thread Milen A. Radev
l-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS Excerpt: "Quoting an identifier also makes it case-sensitive, whereas unquoted names are always folded to lower case." -- Milen A. Radev ---(end of broadcast)--- TIP 7: You can help support

Re: [SQL] Help with quotes in plpgsql

2006-12-19 Thread Milen A. Radev
Richard Ray написа: > On Tue, 19 Dec 2006, Milen A. Radev wrote: > >> Richard Ray : >>> How should this be properly quoted >>> >>> create or replace function test(integer) returns setof text as $$ >>> declare >>> a recor

Re: [SQL] Help with quotes in plpgsql

2006-12-19 Thread Milen A. Radev
n$> $$ language 'plpgsql'; CREATE FUNCTION milen=> No problems here. What version are you using? -- Milen A. Radev ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] Omission of 'FROM' ? diff between pgsql 7.4.1 and pgsql 8.1.4

2006-09-15 Thread Milen A. Radev
t; me as referencing this problem. Anyone with more knowledge that can point me > in > the right direction? Look here for "add_missing_from" - http://www.postgresql.org/docs/8.1/static/runtime-config-compatible.html#RUNTIME-CONFIG-COMPATIBLE-VERSION -- Milen A. Radev

Re: [SQL] Mac Address

2006-09-02 Thread Milen A. Radev
but I didn't find how to > get the MAC Address. Is it possible ? No - the client and the server communicate using TCP/IP as transport/internet layer but that does not mean they use Ethernet as network access layer. -- Milen A. Radev ---(end of broadcast)

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread Milen A. Radev
ion also didn't provide much help ( the examples in > C). I was mainly looking for example showing how to refer 'OLD' and 'NEW' > rows using PL/pgSQL. > > Can someone please direct me to some such examples? http://www.postgresql.org/docs/8.1/static/plpgsql-

Re: [SQL] How to find entries missing in 2nd table?

2006-07-11 Thread Milen A. Radev
CK AS D ON ( C.CONTROLLER_ID = D.CONTROLLER_ID) > > WHERE D.CONTROLLER_ID IS NULL; > Or (SELECT controller_id FROM control) EXCEPT (SELECT controller_id FROM datapack) ? -- Milen A. Radev ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Counting the rows INSERTed/UPDATEd?

2006-05-01 Thread Milen A. Radev
tgresql.org/docs/8.1/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS -- Milen A. Radev ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Interval subtracting

2006-02-18 Thread Milen A. Radev
Milorad Poluga написа: > On Saturday 18 February 2006 15:24, Milen A. Radev wrote: >> Milorad Poluga написа: >>> Hi all, >>> >>> Is there something incorrect in the above query ? >>> SELECT '10 years 1 mons 1 days'::interval - &#

Re: [SQL] Interval subtracting

2006-02-18 Thread Milen A. Radev
tgreSQL 8.0.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) / How many days are there in a month? -- Milen A. Radev ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] new rule syntax?

2006-02-05 Thread Milen A. Radev
ault value of "add_missing_from" setting (http://www.postgresql.org/docs/8.1/static/runtime-config-compatible.html#RUNTIME-CONFIG-COMPATIBLE-VERSION). -- Milen A. Radev ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, ple

[SQL] Difficulties with a master-detail query

2005-09-22 Thread Milen A. Radev
t; table. Аnd that two in "COUNT(s.skill_id)>=2" is there because the count of the languages. Any ideas for simpler and more universal query? Please CC me, because I'm not subscribed. -- Milen A. Radev ---(end of broadcast)