pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedAccessing system information functions
6+ messages / 4 participants
[nested] [flat]
* Accessing system information functions
@ 2023-09-22 17:37 Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>
0 siblings, 3 replies; 6+ messages in thread
From: Johnson, Bruce E - (bjohnson) @ 2023-09-22 17:37 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Environment: Ubuntu 22.04 lts, postgres 15 installed via postgres.org<http://postgres.org; repository
I am attempting to use the system information functions here: https://www.postgresql.org/docs/15/functions-info.html
I’m logged on as the postgres superuser on the host
Trying any of the functions gives me a syntax error
postgres=# pg_database_size(avi);
ERROR: syntax error at or near "pg_database_size"
LINE 1: pg_database_size(avi);
Do I have to add anything to the search_path?
postgres=# show search_path;
search_path
-----------------
"$user", public
(1 row)
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Accessing system information functions
@ 2023-09-25 11:18 Erik Wienhold <ewie@ewie.name>
parent: Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>
2 siblings, 1 reply; 6+ messages in thread
From: Erik Wienhold @ 2023-09-25 11:18 UTC (permalink / raw)
To: Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On 2023-09-22 17:37 +0000, Johnson, Bruce E - (bjohnson) wrote:
> postgres=# pg_database_size(avi);
> ERROR: syntax error at or near "pg_database_size"
> LINE 1: pg_database_size(avi);
Call functions with SELECT, e.g.:
SELECT pg_database_size('avi');
Also, the database name must be a string.
> Do I have to add anything to the search_path?
Not for objects in schema pg_catalog which is always searched whether
it's listed in the search path or not.
--
Erik
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Accessing system information functions
@ 2023-09-25 12:28 Rob Sargent <robjsargent@gmail.com>
parent: Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>
2 siblings, 0 replies; 6+ messages in thread
From: Rob Sargent @ 2023-09-25 12:28 UTC (permalink / raw)
To: Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>; +Cc: pgsql-general@lists.postgresql.org
--Apple-Mail-D5E1F70A-7024-466A-B987-99BBE242070A
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr"></div><div dir=3D"ltr"><br=
></div><div dir=3D"ltr"><br><blockquote type=3D"cite">On Sep 25, 2023, at 5:=
05 AM, Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu> wr=
ote:<br><br></blockquote></div><blockquote type=3D"cite"><div dir=3D"ltr">=EF=
=BB=BF
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
Environment: Ubuntu 22.04 lts, postgres 15 installed via <a href=3D"http://p=
ostgres.org">
postgres.org</a> repository
<div><br>
</div>
<div>I am attempting to use the system information functions here: <a h=
ref=3D"https://www.postgresql.org/docs/15/functions-info.html">https://www.p=
ostgresql.org/docs/15/functions-info.html</a></div>
<div><br>
</div>
<div>I=E2=80=99m logged on as the postgres superuser on the host</div>
<div><br>
</div>
<div>Trying any of the functions gives me a syntax error</div>
<div><br>
</div>
<div>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">postgres=3D# pg_=
database_size(avi);</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">ERROR: syn=
tax error at or near "pg_database_size"</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">LINE 1: pg_datab=
ase_size(avi);</span></p>
</div>
<div> </div>
<div>Do I have to add anything to the search_path?</div>
<div><br>
</div>
<div>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">postgres=3D# sho=
w search_path;</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures"> sea=
rch_path </span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">----------------=
-</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures"> "$user", p=
ublic</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">(1 row)</span></=
p>
</div>
<div><span style=3D"font-variant-ligatures: no-common-ligatures"><br>
</span></div>
<div><br>
</div>
<div><br></div></div></blockquote><div><br></div>Select pg_database_size(avi=
);<div><br><blockquote type=3D"cite"><div dir=3D"ltr"><div>
<div><br></div>
</div>
</div></blockquote></div></body></html>=
--Apple-Mail-D5E1F70A-7024-466A-B987-99BBE242070A--
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Accessing system information functions
@ 2023-09-25 12:31 Rob Sargent <robjsargent@gmail.com>
parent: Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>
2 siblings, 1 reply; 6+ messages in thread
From: Rob Sargent @ 2023-09-25 12:31 UTC (permalink / raw)
To: Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>; +Cc: pgsql-general@lists.postgresql.org
--Apple-Mail-B833652C-BCFB-4FF8-B113-7586E593F768
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D=
utf-8"></head><body dir=3D"auto"><div dir=3D"ltr"></div><div dir=3D"ltr"><br=
></div><div dir=3D"ltr"><br><blockquote type=3D"cite">On Sep 25, 2023, at 5:=
05 AM, Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu> wr=
ote:<br><br></blockquote></div><blockquote type=3D"cite"><div dir=3D"ltr">=EF=
=BB=BF
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
Environment: Ubuntu 22.04 lts, postgres 15 installed via <a href=3D"http://p=
ostgres.org">
postgres.org</a> repository
<div><br>
</div>
<div>I am attempting to use the system information functions here: <a h=
ref=3D"https://www.postgresql.org/docs/15/functions-info.html">https://www.p=
ostgresql.org/docs/15/functions-info.html</a></div>
<div><br>
</div>
<div>I=E2=80=99m logged on as the postgres superuser on the host</div>
<div><br>
</div>
<div>Trying any of the functions gives me a syntax error</div>
<div><br>
</div>
<div>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">postgres=3D# pg_=
database_size(avi);</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">ERROR: syn=
tax error at or near "pg_database_size"</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">LINE 1: pg_datab=
ase_size(avi);</span></p>
</div>
<div> </div>
<div>Do I have to add anything to the search_path?</div>
<div><br>
</div>
<div>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">postgres=3D# sho=
w search_path;</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures"> sea=
rch_path </span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">----------------=
-</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures"> "$user", p=
ublic</span></p>
<p style=3D"margin: 0px; font-style: normal; font-variant-caps: normal; font=
-stretch: normal; font-size: 18px; line-height: normal; font-family: Consola=
s; font-size-adjust: none; font-kerning: auto; font-variant-alternates: norm=
al; font-variant-ligatures: normal; font-variant-numeric: normal; font-varia=
nt-east-asian: normal; font-variant-position: normal; font-feature-settings:=
normal; font-optical-sizing: auto; font-variation-settings: normal; backgro=
und-color: rgb(225, 225, 225);">
<span style=3D"font-variant-ligatures: no-common-ligatures">(1 row)</span></=
p>
</div>
<div><span style=3D"font-variant-ligatures: no-common-ligatures"><br>
</span></div>
<div><br>
</div>
<div><br></div></div></blockquote><div><br></div>And single quote name. 'avi=
'<br><blockquote type=3D"cite"><div dir=3D"ltr"><div>
<div>-- <br>
Bruce Johnson<br>
University of Arizona<br>
College of Pharmacy<br>
Information Technology Group<br>
<br>
Institutions do not have opinions, merely customs<br>
<br>
</div>
<br>
</div>
</div></blockquote></body></html>=
--Apple-Mail-B833652C-BCFB-4FF8-B113-7586E593F768--
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [EXT]Re: Accessing system information functions
@ 2023-09-25 15:50 Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>
parent: Erik Wienhold <ewie@ewie.name>
0 siblings, 0 replies; 6+ messages in thread
From: Johnson, Bruce E - (bjohnson) @ 2023-09-25 15:50 UTC (permalink / raw)
To: Erik Wienhold <ewie@ewie.name>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Thank you.
On Sep 25, 2023, at 4:18 AM, Erik Wienhold <ewie@ewie.name> wrote:
External Email
On 2023-09-22 17:37 +0000, Johnson, Bruce E - (bjohnson) wrote:
postgres=# pg_database_size(avi);
ERROR: syntax error at or near "pg_database_size"
LINE 1: pg_database_size(avi);
Call functions with SELECT, e.g.:
SELECT pg_database_size('avi');
Also, the database name must be a string.
Do I have to add anything to the search_path?
Not for objects in schema pg_catalog which is always searched whether
it's listed in the search path or not.
--
Erik
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Accessing system information functions
@ 2023-09-25 18:05 Pavel Stehule <pavel.stehule@gmail.com>
parent: Rob Sargent <robjsargent@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: Pavel Stehule @ 2023-09-25 18:05 UTC (permalink / raw)
To: Rob Sargent <robjsargent@gmail.com>; +Cc: Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>; pgsql-general@lists.postgresql.org
Hi
po 25. 9. 2023 v 19:51 odesílatel Rob Sargent <robjsargent@gmail.com>
napsal:
>
>
> On Sep 25, 2023, at 5:05 AM, Johnson, Bruce E - (bjohnson) <
> Johnson@pharmacy.arizona.edu> wrote:
>
> Environment: Ubuntu 22.04 lts, postgres 15 installed via postgres.org repository
>
>
> I am attempting to use the system information functions here:
> https://www.postgresql.org/docs/15/functions-info.html
>
> I’m logged on as the postgres superuser on the host
>
> Trying any of the functions gives me a syntax error
>
> postgres=# pg_database_size(avi);
>
> ERROR: syntax error at or near "pg_database_size"
>
> LINE 1: pg_database_size(avi);
>
> Do I have to add anything to the search_path?
>
> postgres=# show search_path;
>
> search_path
>
> -----------------
>
> "$user", public
>
> (1 row)
>
>
>
you are missing SELECT keyword
(2023-09-25 20:05:08) postgres=# select pg_database_size('postgres');
┌──────────────────┐
│ pg_database_size │
╞══════════════════╡
│ 7901667 │
└──────────────────┘
(1 row)
Regards
Pavel
>
> And single quote name. 'avi'
>
> --
> Bruce Johnson
> University of Arizona
> College of Pharmacy
> Information Technology Group
>
> Institutions do not have opinions, merely customs
>
>
>
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2023-09-25 18:05 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-22 17:37 Accessing system information functions Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>
2023-09-25 11:18 ` Erik Wienhold <ewie@ewie.name>
2023-09-25 15:50 ` Johnson, Bruce E - (bjohnson) <Johnson@pharmacy.arizona.edu>
2023-09-25 12:28 ` Rob Sargent <robjsargent@gmail.com>
2023-09-25 12:31 ` Rob Sargent <robjsargent@gmail.com>
2023-09-25 18:05 ` Pavel Stehule <pavel.stehule@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox