Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TableIterator no longer generates columns #1904

Closed
ccleve opened this issue Oct 8, 2024 · 5 comments
Closed

TableIterator no longer generates columns #1904

ccleve opened this issue Oct 8, 2024 · 5 comments

Comments

@ccleve
Copy link
Contributor

ccleve commented Oct 8, 2024

This code from the documentation for TableIterator:

use pgrx::prelude::*;

#[pg_extern]
fn employees() -> TableIterator<
    'static,
    (
        name!(id, i64),
        name!(dept_code, String),
        name!(full_text, &'static str),
    ),
> {
    TableIterator::new(vec![
        (42, "ARQ".into(), "John Hammond"),
        (87, "EGA".into(), "Mary Kinson"),
        (3, "BLA".into(), "Perry Johnson"),
    ])
}

produces this output:

select rdb.employees();
        employees        
-------------------------
 (42,ARQ,"John Hammond")
 (87,EGA,"Mary Kinson")
 (3,BLA,"Perry Johnson")
(3 rows)

No nice neat columns any more. Both 12.4 and 12.5 have this problem. I'll check earlier versions if you need me to.

@workingjubilee
Copy link
Member

workingjubilee commented Oct 9, 2024

Huh. Odd. Do you happen to have what it looked like before on-hand?

@workingjubilee
Copy link
Member

It looked like this right?

id dept_code full_text
42 ARQ John Hammond
87 EGA Mary Kinson
3 BLA Perry Johnson

@SteveLauC
Copy link
Contributor

It looked like this right?

Right, it should have multiple columns if the returned tuple has multiple elements.

@ccleve
Copy link
Contributor Author

ccleve commented Oct 9, 2024

Never mind. I was calling select employees() instead of select * from employees(). Not the first time I have made that mistake. Sorry.

@ccleve ccleve closed this as completed Oct 9, 2024
@eeeebbbbrrrr
Copy link
Contributor

@ccleve take a break man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants